Version 2 (modified by 13 years ago) ( diff ) | ,
---|
===================================
Viscosity and Resistivity in AstroBEAR
===================================
Viscosity
The viscosity term in the Navier-Stokes Equation can be separated as:
For the applications we are considering, the fluid is isotropic. Under this assumption, the tensor can be expressed as the following combination of two scalar dynamic viscosities and :
where I is the unit tensor.
It can be proven that the stress tensor should have zero trace, which leads to the following relation between and :
Combining these relations, we can write down the final form of the separated viscous equation:
Notice that this equation already counts the effect of all the elements in a viscosity tensor, assuming the fluid itself is isotropic.
Resistivity
The resistivity equation can be written as:
Here, the magnetic field are located at face centers. Using the face centered magnetic field, we can calculate the edge centered currents, which then give a source term.
The curl of the edge centered source term gives a face centered , which can then be applied to the face centered magnetic field.
===================================
Implementation
===================================
Viscosity
The viscous source term is calculated rigorously by first finding the tensor elements at the surrounding face centers of a cell center considered:
The
Therefore the scheme requires a 20 point stencil in 3-D configuration, which makes the implicit scheme a bit complicated. The following graph shows such a stencil in 2-D setting:
Using this stencil setting, one can get face centered velocity divergence for the cell considered, and then calculate the gradient components located at the cell center.
In the viscous plasma context, the physical viscosity can be calculated rigorously. The plasma viscosity is proportional to the product of ion mean free path and the ion thermal energy:
In our code, we offer the option to calculate the realistic viscosity using the following equation:
The ion mass and local temperature should be readily available, but a good estimate of ion diameter usually requires look up a ionic radius table.
As an estimate, one can use that of hydrogen, about 0.1~0.2 nm.
One can see that the viscosity itself is anisotropic and depends on the local temperature.
That is why we have both the and terms in our viscosity equation, and have to calculate face centered source terms before applying the final divergence.
The viscosity interface is as follows:
The viscosity source term can be turned on in astrobear by putting the viscosity flag to true:
lViscous = .true.
The second parameter VisType determines which type of viscosity one requires: 1 for constant viscosity; 2 for real physical viscosity.
The third parameter viscosity is the user defined constant viscosity.
The viscosity module is tested to be working compatibly with implicit thermal conduction module and uniform gravity module.
Resistivity
For each cell, the resistive source term is calculated by taking the curl of face centered magnetic field. This results in a 12 dimension array that stores the current source terms running over the 12 edges of a cell in 3-D. This array is then used to calculate the new face centered magnetic field. The stencil for this explicit solver is a 3 by 3 cube surrounding the cell we want to update. See the following diagram:
In cgs units, the real magnetic diffusivity can be written as:
where
The cross field diffusivity can thus be expressed as function of electron temperature
where
THe Coulomb logarithm for interested number density is plotted below:
The parallel diffusivity however, is dependent on
For
Currently in the code, the realistic resistivity gets calculated at each cell edges by averaging the temperatures surrounding that edge. So the temperature effect is taken into full consideration. But the Coulomb log is assigned as a constant, although it may change depending on the temperature and particle density.
The resistivity interface is as follows:
The resistive source term can be turned on in astrobear by putting the resistive flag to true:
lresistive = .true.
The second parameter ResType determines which type of resistivity one requires: 1 for constant computational resistivity; 2 for real physical resistivity.
The third parameter resistivity is the user defined constant resistivity.
===================================
Multiphysics Integration
===================================
Taking viscosity as an example. The goal for the multiphysics modules is to calculate a change of velocisty inside a grid, using the known hydro vars.
This integration can be done before any hyperbolic updates. We denote the hyperbolic update, integrated source term calculation and explicit source term calculation as H, S and E.
The operators applied are as follows:
But this operator does not commute with its own transpose, meaning that
This is obvious with for example, viscosity, in which the E operator raises temperature and lowers the velocity profile. The hyperbolic solver will have a different response to the data modified by E comparing to that of unmodified.
A symmetric operator splitting can be achieved if we do
Since the commutator of this operator with its transpose will be zero.
For any given grid, the external explicit solver requires two steps of updating. The tricky part of the solver is to figure out what to use at the grid boundaries. The three different boundary situations are summarized below:
(1)For any physical boundary, use the physical boundary condition.(outflow: impose a fixed velocity; and so on)
(2)For any internal boundary to direct neighbors, get the needed data directly by communication.
(3)For any internal boundary to parent level, we need the following ghosting scheme:
When advancing dt, we have 10 ghost zones, we also need to explicitly store , the time derivative of velocity advection to be used for adjacent child grids.
The steps are:
1) apply E(dt/2) to internal + ghost 1~8 using ghost 9 and 10.
2) apply H(dt/2) to internal + ghost 1~4 using ghost 5~8.
3) apply another H(dt/2) to internal using ghost 1~4.
4) manually update ghost 1~2 using .
5) apply E(dt/2) to internal again using the updated ghost 1~2.
From here, we can see two problems of putting the explicit operator into the source term integration:
1) each complete update requires two more ghost zones on parent-child boundaries which does not fit into the source term subcyclilng. (N subcycling requires 2N ghost zones)
2) for internal boundary to direct neighbors, the two grids need to communicate in order to . This again does not fit into the source term subcycling. (there is no communications happening during subcycling in the current code)
Attachments (3)
- thermalconddiagram.png (7.2 KB ) - added by 13 years ago.
- coulomblog.png (22.4 KB ) - added by 13 years ago.
- saturationflux.png (14.1 KB ) - added by 13 years ago.
Download all attachments as: .zip