wiki:ThermalConduction

Diffusion Solvers in AstroBEAR

Astrobear supports both implicit and explicit thermal diffusion that is both isotropic and anistropic. We first derive the equations for the implicit-anisotropic case, and then discuss simplifications that arise for isotropic and explicit versions.

Basic Equations

The anisotropic conduction equation is

however, the conduction coefficients have a Temperature dependence.

Just FYI, some references will define variables a bit differently, and write these equations like this:

where the c's are coefficients usually given as some number in references.

We will use and the same for where and

Collecting power's of T

So we can rewrite the equations as

Einstein simplification

or in Einstein notation

or

Implicitization

Now we can rewrite the equation

where the or subscript on , , and is implied.

and

and and

Now to solve this implicitly, we need to replace with where

Note for Backward Euler, and for Crank Nicholson,

where and

Now we can expand the derivatives and get

Discretization

We then need expressions for

Using the above definitions, we can write the discretized equation as

where

where the in corresponds to the term.

Also note, that the indexing of the temperatures is commutative, and that all of the diagonal temperature terms will have two contributions. One from and one from . We can rewrite

where

Summary

Effective diffusion coeffiient ==

The traditional diffusion equation looks like

where is the diffusion coefficient. For uniform density, magnetic field, and for , the equations revert to the traditional diffusion equation with

Isotropic Case

For the Isotropic Case, the diffusion equation looks like

or in Einstein notation

which we can rewrite as

This is the exact same form as before, but now

is diagonal so the cross terms vanish

and

and it is independent of direction, so it is just a scalar.

So in summary we have

and

And our equation becomes

Now in the code, is assumed constant

And stencil(0) has the coefficient of , and stencil(1:2*ndim) has the coefficients of and source has everything else. Note that the coefficients has a term for and but the way the code is written, it loops over each neighbor and adds the contribution from and on separate iterations.

Time stepping

The implicit method requires approximating

but solving this accurately with a linear method requires

but this restricts our time step. Using the instantaneous derivatives, we can calculate the maximum time step as

so

Explicit Case

For the Explicit case, we just set which sets and and we have

Explicit time stepping

For the explicit scheme to be stable, we must have

Flux limiting

Limiting the fluxes in the explicit case is not too difficult, however in the implicit case, we cannot limit the flux directly, but must instead, limit the conductivities.

We can limit using or do something like

Boundary Terms

Explicit

Here, the boundary terms are quite straightforward. We can just use the regular boundary conditions (or user specified boundary conditions). The only difficulty arises when trying to set a heat flux since this involves solving a non-linear equation. One solution is to set the heat flux explicitly - instead of indirectly through the temprature. Then use extrapolating (pr reflecting) BC's for temperature so there is no heat flux initially calculated along the boundary - and then add in the flux in a separate step.

Implicit

For reflecting - or extrapolating boundary terms, we can just transfer the coefficients for the boundary terms and apply them to their mirror zone. The only thing to be careful about - is that for the anisotropic case, there are corner zones who's coefficients may need to be transferred twice. This just requires transferring corner zone coefficients, to edge zones, before transferring edge zones, to the central cell in the stencil.

Last modified 3 years ago Last modified on 12/20/21 12:34:33
Note: See TracWiki for help on using the wiki.