Version 1 (modified by 14 years ago) ( diff ) | ,
---|
Ambient Objects
Description
As its name implies, the Ambient
object contains information about the background for a simulation. Unlike the UniformRegion
object, the Ambient
object has no shape or physical extent. It essentially does what the InitAmbient
routine did using data from the modules.data
file. This however, prevented users from being able to calculate and specify the initial ambient values at run time. The Ambient
object allows for a simple interface for setting the background density, velocity, pressure, and magnetization. The object (if used) must be created during the ProglemModuleInit
subroutine.
Object Attributes
TYPE AmbientDef REAL(KIND=qPREC) :: density=1d0 REAL(KIND=qPREC) :: v(3)=0d0 REAL(KIND=qPREC) :: pressure=1d0 REAL(KIND=qPREC) :: B(3) = 0d0 INTEGER :: iTracer=0 END TYPE AmbientDef
The default values for density and pressure are both 1. The velocity and magnetization vectors are 0 - and there is no ambient tracer. To turn on an ambient tracer, the value of iTracer needs to be initialized to a valid tracer index using the AddTracer routine.
How to Use this Object
This object is perhaps the simplest to use since it has no shape. One only has to create the ambient object and modify its default values as necessary (and potentially add a tracer field) as follows…
SUBROUTINE ProblemModuleInit() TYPE(AmbientDef), POINTER :: Ambient CALL CreateAmbient(Ambient) Ambient%density=10 Ambient%pressure=100 Ambient%B(:)=(/1d0, 0d0, 0d0/) Ambient%v(:)=(/0d0, 0d0, 0d0/) CALL AddTracer(Ambient%iTracer, 'Ambient Tracer') END SUBROUTINE ProblemModuleInit
Grids then will be initialized with the correct energy etc… before being passed into the various other grid initialization routines.