wiki:WindObjects

Version 8 (modified by trac, 12 years ago) ( diff )

Wind Objects

Description

As its name implies, the Wind object was originally created to simulate a stellar wind. However, the actual object is a little more generic. It can represent any continuous inflow or outflow condition that, by default, is an inflow coming from the lower x boundary of the domain. The Wind object allows for a simple interface for setting the flow's density, velocity, temperature, and magnetization. The object (if used) must be created during the ProblemModuleInit subroutine.


Object Attributes

   INTEGER, PARAMETER :: NOWAVE = 0, SQUAREWAVE = 1, SINEWAVE = 2

   TYPE WindDef
      INTEGER :: dir = 1
      INTEGER :: edge = 1
      REAL(KIND=qPREC) :: velocity = 0d0
      REAL(KIND=qPREC) :: density=1d0
      REAL(KIND=qPREC) :: temperature=1d0
      REAL(KIND=qPREC) :: B(3) = 0d0
      REAL(KIND=qPREC) :: period = 0d0
      REAL(KIND=qPREC) :: amplitude = 0d0
      INTEGER :: waveform = NOWAVE
      INTEGER :: Type = 0
      INTEGER :: iTracer = 0 
   END TYPE WindDef

The default values for density and temperature are both 1. The velocity and magnetization vectors are 0, and there is no wind tracer. To turn on a wind tracer, the value of iTracer needs to be initialized to a valid tracer index using the AddTracer routine.

The dir and edge parameters define the direction of the wind and which boundary the wind comes from. For dir: the x, y, z directions are 1, 2, 3 respectively. For edge: the lower x, lower y, lower z, upper x, upper y, upper z boundaries are 1,2,3,4,5,6 respectively.

The default value for type is 0, which corresponds to USER_DEFINED. This means that the user has total control of the Wind object's parameters. The other type is 1 which is OUTFLOW_ONLY. This type will override some of the parameters to ensure that the wind is an outflow instead of an inflow.

Period, amplitude, and waveform are all parameters used for a velocity perturbation. Their default is 0 (i.e. no perturbation).


How to Use this Object

Firstly, the USE Winds statement will be required at the top of the module. Then, one just has to create the wind object and modify its default values as necessary (and potentially add a tracer field) as follows…

SUBROUTINE ProblemModuleInit()
  TYPE(WindDef), POINTER :: Wind

  CALL CreateWind(Wind) 

  Wind%density=10
  Wind%temperature=100
  Wind%B(:)=(/1d0, 0d0, 0d0/)
  Wind%velocity=1d5

  CALL AddTracer(Wind%iTracer, 'Wind Tracer')

END SUBROUTINE ProblemModuleInit

This set up is your most basic constant, magnetized wind coming in from the lower x boundary with the specified parameters. Grids then will be initialized with the correct energy etc… before being passed into the various other grid initialization routines.

Note: See TracWiki for help on using the wiki.