WOLFRAM

represents a diffusion term with model variables vars.

represents a diffusion term with diffusion coefficient .

DiffusionPDETerm[vars,c,pars]

uses model parameters pars.

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:
  • cscalar , isotropic diffusion
    {c1,,cn}
  • vector , orthotropic diffusion
  • {{c11,,c1n},,{cn1,,cnn}}
  • matrix , anistropic diffusion
  • 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:
  • parameterdefaultsymbol
    "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:
  • dimensionreductionequation
    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 all

Basic Examples  (6)Summary of the most common use cases

Define a stationary diffusion term:

Out[1]=1

Activate the term:

Out[2]=2

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

Out[1]=1

Activate the term:

Out[2]=2

Define a symbolic diffusion term:

Out[1]=1

Activate the term:

Out[2]=2

Find the eigenvalues of a diffusion term:

Out[1]=1

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

Out[1]=1

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

Out[1]=1

Visualize the smoothing of the initial condition through time:

Out[2]=2

Check that the area under the curves remains constant:

Out[3]=3

Scope  (31)Survey of the scope of standard use cases

1D  (6)

Define a symbolic diffusion term:

Out[1]=1

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

Out[1]=1

Define a time-dependent diffusion term:

Out[1]=1

Activate the term:

Out[2]=2

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

Out[1]=1

Activate the term:

Out[2]=2

Use DiffusionPDETerm for modeling an eigenvalue problem:

Out[1]=1

Use DiffusionPDETerm to set up a 1D Poisson equation:

Out[1]=1

Visualize the result:

Out[2]=2

1D Axisymmetric  (1)

Set up a 1D axisymmetric diffusion equation:

Out[1]=1

Apply Activate to the term:

Out[2]=2

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

Out[1]=1

2D  (12)

Define a 2D stationary diffusion term:

Out[1]=1

Activate the term:

Out[2]=2

Set up a 2D stationary diffusion equation:

Out[1]=1

Activate the term:

Out[2]=2

Set up a 2D time-dependent diffusion equation:

Out[1]=1

Activate the term:

Out[2]=2

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

Out[1]=1

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

Out[1]=1

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

Out[1]=1

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

Out[1]=1

Use DiffusionPDETerm to set up a 2D Poisson equation:

Out[1]=1

Visualize the result:

Out[2]=2

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

Out[1]=1

Visualize the result:

Out[2]=2

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

Out[1]=1

Visualize the result:

Out[2]=2

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

Out[1]=1

Visualize the result:

Out[2]=2

Use an anisotropic diffusion coefficient:

Out[1]=1

Visualize the result:

Out[2]=2

2D Axisymmetric  (3)

Set up a 2D axisymmetric diffusion equation:

Out[1]=1

Apply Activate to the term:

Out[2]=2

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

Out[2]=2

Set up a 2D axisymmetric diffusion equation:

Out[1]=1

Apply Activate to the term:

Out[2]=2

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

Out[1]=1

Apply Activate to the term:

Out[2]=2

3D  (1)

Use DiffusionPDETerm to set up a 3D Poisson equation:

Out[1]=1

Visualize the result:

Out[3]=3

Coupled  (5)

Define a diffusion term with multiple dependent variables:

Out[1]=1

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

Out[1]=1

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

Out[1]=1

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

Out[1]=1
Out[2]=2

Off-diagonal diffusion coefficients are possible in coupled PDEs:

Solve the equations:

Visualize the results:

Out[3]=3

Coupled Axisymmetric  (3)

Use DiffusionPDETerm to set up a 1D axisymmetric equation with multiple dependent variables:

Out[2]=2

Specify boundary conditions:

Solve the equations numerically:

Out[14]=14

Solve the same equation symbolically:

Out[11]=11

Visualize the difference between the results:

Out[15]=15

Define an axisymmetric diffusion term with multiple dependent variables:

Out[1]=1

Apply Activate to the term:

Out[2]=2

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

Solve the coupled PDEs:

Visualize the results:

Out[4]=4

Applications  (9)Sample problems that can be solved with this function

Use DiffusionPDETerm with a variable diffusion coefficient:

Out[8]=8

Solve the equation:

Out[9]=9

Compute the flux:

Out[10]=10

Visualize the result:

Out[11]=11

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.

Set up the equation:

Out[1]=1

Specify boundary conditions:

Solve the equation:

Out[3]=3

Or solve it symbolically with DSolveValue:

Out[4]=4

Visualize the difference between the results:

Out[5]=5

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

Set up the model:

Out[2]=2

Solve the equation:

Out[3]=3

Compute the flux:

Out[4]=4

Visualize the result:

Out[5]=5

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

Solve the equation:

Out[7]=7

Visualize the species concentration:

Out[8]=8

Define a Helmholtz model:

Solve for the eigenvalues of the Helmholtz equation:

Out[2]=2

Solve the Helmholtz equation with a source term:

Out[3]=3

Visualize the solution:

Out[4]=4

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.

Set up the region:

Set up the PDE model:

Out[2]=2

Solve the axisymmetric equation:

Out[3]=3

Visualize the result:

Out[4]=4

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

Out[5]=5

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

Set up the region:

Find the thermal conductivity for air:

Set up the PDE model:

Solve the equation and measure the time and memory needed to do so:

Visualize the axisymmetric result:

Out[5]=5

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

Use DiffusionPDETerm to set up a plane stress operator. Set up the coupled coefficients:

Set up the model:

Out[2]=2

Set up a region:

Out[3]=3

Solve the equations:

Out[4]=4

Visualize the results:

Out[5]=5
Out[6]=6

Compute the flux:

Out[7]=7

Define a Stokes-flow model:

Set up the equation:

Out[2]=2

Define a narrowing region:

Set up a boundary condition:

Solve the equation:

Visualize the solution:

Out[6]=6

Extend a Stokes-flow model to a NavierStokes-flow model. Define a Stokes-flow model:

Define a NavierStokes-flow model:

Set up the equation:

Out[3]=3

Define a region:

Set up a boundary condition:

Solve the equation:

Visualize the solution:

Out[7]=7

Properties & Relations  (3)Properties of the function, and connections to other functions

Verify that anisotropic diffusion is the same as :

Out[1]=1
Out[2]=2

Visualize that there is no difference in the two solutions:

Out[3]=3

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

Out[1]=1

The analytical solution is an infinite series:

Out[2]=2

Extract a few terms from the Inactive sum:

Visualize the difference between the numerical and the analytical solutions:

Out[4]=4

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

Out[1]=1

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

Out[2]=2

Possible Issues  (5)Common pitfalls and unexpected behavior

The negative sign in the operator does not need to be given:

Out[1]=1

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

Out[1]=1

A subsequent substitution must account for that:

Out[2]=2

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

Out[3]=3

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

Out[4]=4

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:

Out[1]=1

Solve the equation:

Note that the result tries to take the dot product of a scalar with the gradient of the solution:

Out[3]=3

Visualizing the result does not work:

Out[4]=4

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

Out[5]=5

Solve the equation:

Compute the flux:

Out[7]=7

Visualize the result:

Out[8]=8

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

Out[9]=9

DiffusionPDETerm models , not :

Visualize the difference in the solutions:

Out[3]=3
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).

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 ]}

@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 ]}

@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 ]}