DiffusionPDETerm
✖
DiffusionPDETerm
Details




- Diffusion is a central concept of physics that is used in a number of domains, such as thermodynamics, acoustics, structural mechanics and fluid dynamics.
- Diffusion is also known as conduction.
- Diffusion with a diffusion coefficient
is the process of equilibration solely driven by a gradient of the dependent variable
:
- DiffusionPDETerm returns a differential operators term to be used as a part of partial differential equations:
- DiffusionPDETerm can be used to model diffusion equations with dependent variable
, independent variables
and time variable
.
- Stationary model variables vars are vars={u[x1,…,xn],{x1,…,xn}}.
- Time-dependent model variables vars are vars={u[t,x1,…,xn],{x1,…,xn}} or vars={u[t,x1,…,xn],t,{x1,…,xn}}.
- The diffusion term
in context with other PDE terms is given by:
- During diffusion, the medium in which the diffusion happens remains stationary, in contrast to convection where the medium is the transport mechanism.
- The diffusion coefficient
can have the following forms:
-
scalar , isotropic diffusion
{c1,…,cn} - vector
, orthotropic diffusion
{{c11,…,c1n},…,{cn1,…,cnn}} - matrix
, anistropic diffusion
- vector
- For a system of PDEs with dependent variables {u1,…,um}, the diffusion represents:
- The diffusion term in context systems of PDE terms:
- The diffusion coefficient
is a tensor of rank 4 of the form
where each submatrix
is an
matrix that can be specified in the same way as for a single dependent variable.
- The diffusion coefficient
can depend on time, space, parameters and the dependent variables.
- The following parameters pars can be given:
-
parameter default symbol "RegionSymmetry" None - A possible choice for the parameter "RegionSymmetry" is "Axisymmetric".
- "Axisymmetric" region symmetry represents a truncated cylindrical coordinate system where the cylindrical coordinates are reduced by removing the angle variable as follows:
-
dimension reduction equation 1D 2D - The coefficient
affects the meaning of NeumannValue.
- All quantities that do not explicitly depend on the independent variables given are taken to have zero partial derivative.






Examples
open allclose allBasic Examples (6)Summary of the most common use cases
Define a stationary diffusion term:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-6a2ghy


https://wolfram.com/xid/0bzqzcro9ea1fovbu-oa75fr

Define a stationary diffusion term with a parametric diffusion coefficient replaced:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-y453ds


https://wolfram.com/xid/0bzqzcro9ea1fovbu-hnt4kr

Define a symbolic diffusion term:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-q26ow7


https://wolfram.com/xid/0bzqzcro9ea1fovbu-1485kk

Find the eigenvalues of a diffusion term:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-sbsmdw

Construct a Poisson equation from basic terms and solve it symbolically:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-sakglf

Solve a time-dependent diffusion equation with a Gaussian initial condition:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-2r8h1y

Visualize the smoothing of the initial condition through time:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-jmbppv

Check that the area under the curves remains constant:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-qhjc1q

Scope (31)Survey of the scope of standard use cases
1D (6)
Define a symbolic diffusion term:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-mq8yxf

Not specifying a diffusion coefficient will result in an identity matrix coefficient:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-oycuqa

Define a time-dependent diffusion term:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-l1q57y


https://wolfram.com/xid/0bzqzcro9ea1fovbu-nxbkl

Define a stationary diffusion term with a parametric diffusion coefficient replaced:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-kgqoxy


https://wolfram.com/xid/0bzqzcro9ea1fovbu-1b5da0

Use DiffusionPDETerm for modeling an eigenvalue problem:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-rodqku

Use DiffusionPDETerm to set up a 1D Poisson equation:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-baak2e


https://wolfram.com/xid/0bzqzcro9ea1fovbu-u0jfow

1D Axisymmetric (1)
Set up a 1D axisymmetric diffusion equation:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-i2eeu1

Apply Activate to the term:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-weq7mi

Verify that the axisymmetric case is a consequence of using a truncated cylindrical coordinate system using the operators that compose the diffusion equation:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-id1t1j

2D (12)
Define a 2D stationary diffusion term:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-gmmpen


https://wolfram.com/xid/0bzqzcro9ea1fovbu-z0sc14

Set up a 2D stationary diffusion equation:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-9mpx31


https://wolfram.com/xid/0bzqzcro9ea1fovbu-tbuq4l

Set up a 2D time-dependent diffusion equation:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-wlbr0z


https://wolfram.com/xid/0bzqzcro9ea1fovbu-1db6sl

Not specifying a diffusion coefficient will result in an identity matrix coefficient:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-7k5vqe

Define a 2D orthotropic stationary diffusion term with a vector diffusion coefficient:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-c0ibpf

Define a 2D stationary diffusion term with an anisotropic diffusion matrix:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-h6n90o

Define a 2D diffusion term with an anisotropic diffusion matrix:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-q20qls

Use DiffusionPDETerm to set up a 2D Poisson equation:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-futv7o


https://wolfram.com/xid/0bzqzcro9ea1fovbu-edayxf

Construct a Poisson equation from basic PDE terms and solve it numerically:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-rix32r


https://wolfram.com/xid/0bzqzcro9ea1fovbu-fo25oj

Use a vector-valued diffusion coefficient that has a larger diffusion constant in the direction than the
direction:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-st3h3f


https://wolfram.com/xid/0bzqzcro9ea1fovbu-ifwdbk

Use a vector-valued diffusion coefficient that has a larger diffusion constant in the direction than the
direction:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-wrln97


https://wolfram.com/xid/0bzqzcro9ea1fovbu-xwvygy

Use an anisotropic diffusion coefficient:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-twdq7z


https://wolfram.com/xid/0bzqzcro9ea1fovbu-ra7zn7

2D Axisymmetric (3)
Set up a 2D axisymmetric diffusion equation:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-e4v8gb

Apply Activate to the term:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-g75pae

Verify that the axisymmetric case is a consequence of using a truncated cylindrical coordinate system using the operators that compose the diffusion equation:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-m3nsq

Set up a 2D axisymmetric diffusion equation:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-58qw8l

Apply Activate to the term:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-6rpvj9

Set up a 2D axisymmetric time-dependent diffusion equation:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-ge4kw4

Apply Activate to the term:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-dtt6us

3D (1)
Use DiffusionPDETerm to set up a 3D Poisson equation:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-c60l9u


https://wolfram.com/xid/0bzqzcro9ea1fovbu-cg4ia

Coupled (5)
Define a diffusion term with multiple dependent variables:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-4r1hdd

Define a diffusion term with multiple dependent variables and multiple diffusion coefficients:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-6ayqdv

Define a diffusion term with multiple dependent variables and anisotropic diffusion coefficients:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-zyryfd

Define a diffusion term with multiple dependent variables and all coefficients specified:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-rrzw71


https://wolfram.com/xid/0bzqzcro9ea1fovbu-3wy5a3

Off-diagonal diffusion coefficients are possible in coupled PDEs:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-q4os6r


https://wolfram.com/xid/0bzqzcro9ea1fovbu-bxqjzn

https://wolfram.com/xid/0bzqzcro9ea1fovbu-dlnd81

Coupled Axisymmetric (3)
Use DiffusionPDETerm to set up a 1D axisymmetric equation with multiple dependent variables:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-nc7lfk


https://wolfram.com/xid/0bzqzcro9ea1fovbu-ks02iq
Solve the equations numerically:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-q4ht4

Solve the same equation symbolically:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-boufji

Visualize the difference between the results:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-ld6cu7

Define an axisymmetric diffusion term with multiple dependent variables:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-unc25

Apply Activate to the term:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-bxj18b

Define a 2D diffusion axisymmetric term with multiple dependent variables and multiple diffusion coefficients:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-ea96io


https://wolfram.com/xid/0bzqzcro9ea1fovbu-f8xpbs

https://wolfram.com/xid/0bzqzcro9ea1fovbu-cwwqcl

https://wolfram.com/xid/0bzqzcro9ea1fovbu-j7gnv2

Applications (9)Sample problems that can be solved with this function
Use DiffusionPDETerm with a variable diffusion coefficient:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-3dnjo6


https://wolfram.com/xid/0bzqzcro9ea1fovbu-v3xa4k


https://wolfram.com/xid/0bzqzcro9ea1fovbu-mtucqa


https://wolfram.com/xid/0bzqzcro9ea1fovbu-7o73xy

Use DiffusionPDETerm to model conductive heat transfer using an axisymmetric geometry.
The region of analysis is a 2D region. Instead of defining the full 2D region in Cartesian coordinates , you can define a region with truncated cylindrical coordinates in 1D
. The cylindrical coordinate variables
and
vanish because the system is rotationally symmetric around the
axis.

https://wolfram.com/xid/0bzqzcro9ea1fovbu-ddauin


https://wolfram.com/xid/0bzqzcro9ea1fovbu-5ise49

https://wolfram.com/xid/0bzqzcro9ea1fovbu-c47tj1

Or solve it symbolically with DSolveValue:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-dom6fn

Visualize the difference between the results:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-kw0f8r

Use DiffusionPDETerm to model species diffusion under a dam. Set up the region:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-ntfh44

https://wolfram.com/xid/0bzqzcro9ea1fovbu-1wzugl


https://wolfram.com/xid/0bzqzcro9ea1fovbu-h8juq4


https://wolfram.com/xid/0bzqzcro9ea1fovbu-2tis1m


https://wolfram.com/xid/0bzqzcro9ea1fovbu-0zwblu

Find the concentration of species under the dam. Construct the model:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-b9km2u

https://wolfram.com/xid/0bzqzcro9ea1fovbu-swulzj

Visualize the species concentration:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-dw51b5


https://wolfram.com/xid/0bzqzcro9ea1fovbu-1w36
Solve for the eigenvalues of the Helmholtz equation:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-cg765y

Solve the Helmholtz equation with a source term:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-bfm8gc


https://wolfram.com/xid/0bzqzcro9ea1fovbu-dxhrsa

Use DiffusionPDETerm to model conductive heat transfer using an axisymmetric geometry. The region of analysis is a 3D hollow cylinder. Instead of defining the full 3D region in Cartesian coordinates , you can define a region with truncated cylindrical coordinates in 2D
. The cylindrical coordinate variable
vanishes because the system is rotationally symmetric around the
axis.

https://wolfram.com/xid/0bzqzcro9ea1fovbu-h0s39

https://wolfram.com/xid/0bzqzcro9ea1fovbu-ic22hc

Solve the axisymmetric equation:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-iqsrmt


https://wolfram.com/xid/0bzqzcro9ea1fovbu-htitkz

Visualize the result in 3D space for part of the cylinder:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-bt46u6

Use DiffusionPDETerm to model a nonlinear conductive heat transfer using an axisymmetric geometry.

https://wolfram.com/xid/0bzqzcro9ea1fovbu-gdty9
Find the thermal conductivity for air:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-pg3osk

https://wolfram.com/xid/0bzqzcro9ea1fovbu-g5w6rt
Solve the equation and measure the time and memory needed to do so:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-kz2q8
Visualize the axisymmetric result:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-oevjd

Print the total time to do the computation and number of megabytes used during the evaluation:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-k7k1yy
Use DiffusionPDETerm to set up a plane stress operator. Set up the coupled coefficients:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-mm0icq


https://wolfram.com/xid/0bzqzcro9ea1fovbu-guenwu


https://wolfram.com/xid/0bzqzcro9ea1fovbu-g77gn8


https://wolfram.com/xid/0bzqzcro9ea1fovbu-oef3fb


https://wolfram.com/xid/0bzqzcro9ea1fovbu-nfaofz


https://wolfram.com/xid/0bzqzcro9ea1fovbu-xeh5mr


https://wolfram.com/xid/0bzqzcro9ea1fovbu-kmit6b


https://wolfram.com/xid/0bzqzcro9ea1fovbu-kqfq17

https://wolfram.com/xid/0bzqzcro9ea1fovbu-piftwv


https://wolfram.com/xid/0bzqzcro9ea1fovbu-lkdoer

https://wolfram.com/xid/0bzqzcro9ea1fovbu-63imdl

https://wolfram.com/xid/0bzqzcro9ea1fovbu-l2dvxi

https://wolfram.com/xid/0bzqzcro9ea1fovbu-s73evl

Extend a Stokes-flow model to a Navier–Stokes-flow model. Define a Stokes-flow model:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-r6w4c3
Define a Navier–Stokes-flow model:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-7anqg3

https://wolfram.com/xid/0bzqzcro9ea1fovbu-5co8b4


https://wolfram.com/xid/0bzqzcro9ea1fovbu-07p7u2

https://wolfram.com/xid/0bzqzcro9ea1fovbu-72s594

https://wolfram.com/xid/0bzqzcro9ea1fovbu-ftjmbu

https://wolfram.com/xid/0bzqzcro9ea1fovbu-ng3ezz

Properties & Relations (3)Properties of the function, and connections to other functions
Verify that anisotropic diffusion is the same as
:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-dxq7mi


https://wolfram.com/xid/0bzqzcro9ea1fovbu-k0c95l

Visualize that there is no difference in the two solutions:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-su02vt

Solve a time-dependent diffusion equation with a Gaussian initial condition:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-3kw5jc

The analytical solution is an infinite series:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-f7zr24

Extract a few terms from the Inactive sum:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-24gjj2
Visualize the difference between the numerical and the analytical solutions:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-gsyn4l

The equilibration property of the diffusion term manifests itself in the smoothing of a discontinuous initial condition:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-mcyo3a

Visualize the discontinuous initial condition and the smoothed evolution of the initial condition:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-e8e3mm

Possible Issues (5)Common pitfalls and unexpected behavior
The negative sign in the operator does not need to be given:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-36w55v

A symbolic diffusion coefficient is interpreted as a matrix diffusion coefficient:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-0692w2

A subsequent substitution must account for that:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-uy2whj

An alternative is to specify the symbolic diffusion coefficient as a matrix:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-5t1q7k

A numeric diffusion coefficient will automatically be multiplied with an IdentityMatrix of proper dimensions:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-ycmeqd

While solving the differential equation with a scalar diffusion coefficient has been made to work for convenience, subsequent operations may rely on a proper setup:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-b33xxy


https://wolfram.com/xid/0bzqzcro9ea1fovbu-kjzd3p
Note that the result tries to take the dot product of a scalar with the gradient of the solution:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-hgm8k8

Visualizing the result does not work:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-nxuhhv

One alternative is to directly specify the diffusion coefficient. In the case of a number, the diffusion coefficient is multiplied with the IdentityMatrix:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-wjuswg


https://wolfram.com/xid/0bzqzcro9ea1fovbu-na1e86

https://wolfram.com/xid/0bzqzcro9ea1fovbu-ouy4h


https://wolfram.com/xid/0bzqzcro9ea1fovbu-9r5vzy

Yet another alternative is to specify the substituted value as a matrix of dimensions of the number of independent variables:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-dgdm9o

DiffusionPDETerm models , not
:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-pjcisp

https://wolfram.com/xid/0bzqzcro9ea1fovbu-sv8g46
Visualize the difference in the solutions:

https://wolfram.com/xid/0bzqzcro9ea1fovbu-cc4zlm

Wolfram Research (2020), DiffusionPDETerm, Wolfram Language function, https://reference.wolfram.com/language/ref/DiffusionPDETerm.html (updated 2022).
Text
Wolfram Research (2020), DiffusionPDETerm, Wolfram Language function, https://reference.wolfram.com/language/ref/DiffusionPDETerm.html (updated 2022).
Wolfram Research (2020), DiffusionPDETerm, Wolfram Language function, https://reference.wolfram.com/language/ref/DiffusionPDETerm.html (updated 2022).
CMS
Wolfram Language. 2020. "DiffusionPDETerm." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2022. https://reference.wolfram.com/language/ref/DiffusionPDETerm.html.
Wolfram Language. 2020. "DiffusionPDETerm." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2022. https://reference.wolfram.com/language/ref/DiffusionPDETerm.html.
APA
Wolfram Language. (2020). DiffusionPDETerm. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DiffusionPDETerm.html
Wolfram Language. (2020). DiffusionPDETerm. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DiffusionPDETerm.html
BibTeX
@misc{reference.wolfram_2025_diffusionpdeterm, author="Wolfram Research", title="{DiffusionPDETerm}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/DiffusionPDETerm.html}", note=[Accessed: 29-April-2025
]}
BibLaTeX
@online{reference.wolfram_2025_diffusionpdeterm, organization={Wolfram Research}, title={DiffusionPDETerm}, year={2022}, url={https://reference.wolfram.com/language/ref/DiffusionPDETerm.html}, note=[Accessed: 29-April-2025
]}