Version 10 (modified by 10 years ago) ( diff ) | ,
---|
The current version of the code has changed the temperature from computational units to Kelvin or solves the energy equation instead of temperature. This note is to check the parameter and equations changes need to do to be consistent comparing the old ways of thermal diffusion equation in Astrobear. So lhs of the equation was replaced by the derivative of the energy. This try is to derive the equations in cgs and convert the SI equations and parameters in Betti's document to parameters should be used in AstroBEAR.
Messy!! You don't want to read this!
1. Equations
The heat diffusion equation solved in AstroBEAR is equivalent to
where everything is in cgs unit or Kelvin and
is the specific heat capacity.In order to find the relationship between Betti's document, we have to rewrite the first equation in wiki:TempEquations to make temperature as in Kelvin instead of which is in Joule:
and inwhere
is in unit of Joule per kg per kelvin. andor
By converting everything but the Boltzmann constant in the above equation to cgs units we have
Here or
where
is in unit of erg per g per kelvin and 1 erg per g per kelvin = Joule per kg per kelvinSo the
in the new version of the code should be.and
is in SI unit?And since we use the subroutine getdEdT to get the energy derivative so
And same as blog:bliu01092014, we define
And so same as blog:bliu01092014, we have
In Betti's data,
, so- Scales for converting from cgs to cu ScaleFlux is the scale which converts the heat flux from cgs units to computational units in AstroBEAR. Since
The new scaleFlux is or as the temperature is in Kelvin now. While in the older version where the temperature is in c.u. scale, So scaleFlux is instead…
scaleDiff is the scale that converts the kappa1 from cgs units to computational units. Since
SoThese scales are defined in physics_control.f90
- subroutine getdEdT in EOS.f90
This subroutine will return the value of dE/dT which has a unit as C.U. Energy/Kelvin
- source and stencil_fix(0) in diffusion.f90 will be modified as
source = ((ndiff-1.0)/(ndiff+1.0))*dot_product(T(0:2*nDim),stencil_fixed(0:2*nDim)) - T(0)*GetdEdT(Info%q(i,j,k,:)) stencil_fixed(0) = stencil_fixed(0) - GetdEdT(Info%q(i,j,k,:))
comparing with the old way
! source = ((ndiff-1.0)/(ndiff+1.0))*dot_product(T(0:2*nDim),stencil_fixed(0:2*nDim)) - T(0)*gamma7*Info%q(i,j,k,1) ! stencil_fixed(0) = stencil_fixed(0) - gamma7*Info%q(i,j,k,1)
So the lefthand side vector has unit of Kelvin and righthand side vector has unit of C.U.energy