xx HydroBase

HydroBase

Tanja Bode <tanja.bode@physics.gatech.edu> Frank Lxffler <knarf@cct.lsu.edu>

April 29, 2010

Abstract

HydroBase extends the CactusEinstein framework to include an interface for magnetohydrodynamics to work within. HydroBase’s main function is to store the primitive variables, common among hydrodynamic simulations, commonly needed parameters, and schedule groups for the main functions of a hydrodynamics code. This has been done with an eye on Whisky, but can be used to implement any hydrodynamics formulation.

1 Introduction

The idea behind this thorn is to create a slim, common set of variables, parameters and scheduling groups which can then be used by different hydrodynamics codes. It should contain the common concepts of different hydrodynamics codes, but at the same time it should be as slim as possible to remain as general as possible. HydroBase should not contain the actual source code of typical routines of hydrodynamics codes, it should merely provide a common setup in which hydrodynamics codes can put their routines.

Because there exist different formulations of the hydrodynamics equations and not all of them involve concepts like conserved variabled or treat them differently, which is the reason why these variables are not defined in HydroBase but this is left to the hydrodynamics codes.

One of the advantages of such a common base is that modules of hydrodynamics codes only working with entities defined in HydroBase could be used interchangeably. Prime examples for this are initial data solvers or importers and analysis modules. Another advantage is that the format of output generated by different hydrodynamics codes in Cactus would be the same, including variable names and unit conventions, which would improve the ability to compare results of different codes directly a lot.

2 Using this Thorn

HydroBase is to be used as a central part of hydrodynamics fields just as ADMBase is used as a central part of spacetime evolution and analysis codes. HydroBase only stores variables which are common to most if not all hydrodynamics codes solving the Euler equations, the so called primitive variables. These are also the variables which are needed to couple to a spacetime solver and which are usually needed by analysis thorns. The usage of a common set of variables by different hydrodynamics codes creates the possibility to share parts of the code, e.g.xinitial data solvers or analysis routines.

Currently the defined primitive variables are (seex[1] for details):

rho: rest mass density

press: pressure

eps: specific internal energy

vel[3]: contravariant fluid three velocity with respect to the Eulerian observer defined as

in terms of the four-velocity , lapse , and shift vector .

Y_e: electron fraction temperature: temperature

entropy: specific entropy per particle

Bvec[3]: contravariant magnetic field vector defined as in terms of the dual to the Faraday tensor and the unit normal of the foliation of spacetime .

HydroBase also sets up scheduling blocks that organize the main functions which modules of a hydrodynamics code may need. All of those scheduling blocks are optional, however if used, they might simplify existing codes and make them more interoperable. HydroBase itself does not schedule something inside most of the groups which it provides.

Currently the scheduling blocks are:

Initializing the primitive variables

Converting primitive variables to conservative variables

Calculating the right hand side (RHS) in the method of lines (MoL)

Setting and updating an excision mask

Applying boundary conditions

In this way the initiation of the primitive variables, methods to recover the conservative variables, and basic atmosphere handling can be implemented in different thorns while allowing a central access point for analysis thorns.

3 Units

HydroBase does not require a specific set of units itself. However so that there are no misunderstandings between thorns a specific set of units is suggested. These units are derived from the conventions

which are commonly used in astrophysics and in relativity. The former sets the mass scale to the solar one and the latter adopts the same units for time, length and mass.

We assume the following definitions and constants of nature:

This corresponds to the following units for mass, length, time, and magnetic field:

Inserting the SI units into the above unit correspondences, we find the following conversion factors:

where T (Tesla) is the magnetic field unit in SI, , and G (Gauss) is its cgs equivalent, .

4 Acknowledgments

This thorn was produced by Tanja Bode, Roland Haas, Frank Lxffler, and Erik Schnetter.

References

[1]xxxJ.xA. Font. Numerical hydrodynamics in General Relativity. Living Rev. Relativity, 3, 2000. [Article in on-line journal], cited on 31/07/01, http://www.livingreviews.org/ Articles/Volume3/2000-2font/index.html.

[2]xxxF. Banyuls, J.xA. Font, J.xM.xA. Ibanez, J.xM.xA. Marti, and J.xA. Miralles. Numerical 3+1 General Relativistic Hydrodynamics: A Local Characteristic Approach. ApJ, 476, 221, 1997.

[3]xxxL. Antxn, O. Zanotti, J.xA. Miralles, J.xM. Martx, J.xM. Ibxxez, J.xA. Font, and J.xA Pons. Numerical 3+1 General Relativistic Magnetohydrodynamics: A Local Characteristic Approach. ApJ, 637, 296 – 312, 2006.

5 Parameters

11abarxevolutionxmethod 10Scope: restrictedx01 KEYWORD

11Description: Evolution method for Abar

11 Range 10 x01 Default: none
11none  10Evolution for Abar is disabled

11

11bvecxevolutionxmethod  10Scope: restrictedx01  KEYWORD

11Description: Evolution method for Bvec

11 Range 10 x01 Default: none
11none  10Evolution for Bvec is disabled

11

11entropyxevolutionxmethod 10Scope: restrictedx01  KEYWORD

11Description: Evolution method for entropy

11 Range 10 x01 Default: none
11none  10Evolution for entropy is disabled

11

11evolutionxmethod  10Scope: restrictedx01  KEYWORD

11Description: The hydro evolution method

11 Range 10 x01 Default: none
11none  10hydro variables are not evolved

11

11hydroxexcision  10Scope: restrictedx01  INT

11Description: Turn on of off (default) storage for hydro excision

11 Range 10 x01 Default: (none)
110:*  10Anything else than 0 turns hydroxexcision on, added to by other thorns

11

11initialxabar  10Scope: restrictedx01  KEYWORD

11Description: Initial value for Abar

11 Range 10 x01 Default: none
11none  10inactive
11zero  10initially set to zero
11read from file  10Read the initial data using the IOUtil file reader. Note that this only allows you to read the data from a file, it does not actually do it. You still have to programme the IOUtil file reader accordingly.

11initialxaphi  10Scope: restrictedx01  KEYWORD

11Description: Initial value for Aphi

11 Range 10 x01 Default: none
11none  10inactive
11zero  10initially set to zero
11read from file  10Read the initial data using the IOUtil file reader. Note that this only allows you to read the data from a file, it does not actually do it. You still have to programme the IOUtil file reader accordingly.

11

11initialxavec  10Scope: restrictedx01  KEYWORD

11Description: Initial value for Avec

11 Range 10 x01 Default: none
11none  10inactive
11zero  10initially set to zero
11read from file  10Read the initial data using the IOUtil file reader. Note that this only allows you to read the data from a file, it does not actually do it. You still have to programme the IOUtil file reader accordingly.

11

11initialxbvec  10Scope: restrictedx01  KEYWORD

11Description: Initial value for Bvec

11 Range 10 x01 Default: none
11none  10inactive
11zero  10initially set to zero
11read from file  10Read the initial data using the IOUtil file reader. Note that this only allows you to read the data from a file, it does not actually do it. You still have to programme the IOUtil file reader accordingly.

11

11initialxentropy  10Scope: restrictedx01  KEYWORD

11Description: Initial value for entropy

11 Range 10 x01 Default: none
11none  10inactive
11zero  10initially set to zero
11read from file  10Read the initial data using the IOUtil file reader. Note that this only allows you to read the data from a file, it does not actually do it. You still have to programme the IOUtil file reader accordingly.

11

11initialxhydro  10Scope: restrictedx01  KEYWORD

11Description: The hydro initial data

11 Range 10 x01 Default: zero
11zero  10hydro variables are set to vacuum (without atmosphere)
11read from file  10Read the initial data using the IOUtil file reader. Note that this only allows you to read the data from a file, it does not actually do it. You still have to programme the IOUtil file reader accordingly.

11

11initialxtemperature  10Scope: restrictedx01  KEYWORD

11Description: Initial value for temperature

11 Range 10 x01 Default: none
11none  10inactive
11zero  10initially set to zero
11read from file  10Read the initial data using the IOUtil file reader. Note that this only allows you to read the data from a file, it does not actually do it. You still have to programme the IOUtil file reader accordingly.

11initialxyxe  10Scope: restrictedx01  KEYWORD

11Description: Initial value for Yxe

11 Range 10 x01 Default: none
11none  10inactive
11one  10initially set to one
11read from file  10Read the initial data using the IOUtil file reader. Note that this only allows you to read the data from a file, it does not actually do it. You still have to programme the IOUtil file reader accordingly.

11

11prolongationxtype  10Scope: restrictedx01  STRING

11Description: The prolongation operator used by Carpet for HydroBase variables

11 Range 10 x01 Default: ENO
11ENO  10Third order ENO operators; only third order is implemented
11WENO  10Fifth order WENO operators; only fifth order is implemented
11.*  10Anything else

11

11temperaturexevolutionxmethod 10Scope: restrictedx01  KEYWORD

11Description: Evolution method for temperature

11 Range 10 x01 Default: none
11none  10Evolution for temperature is disabled

11

11timelevels  10Scope: restrictedx01  INT

11Description: Number of time levels in evolution scheme

11  Range  10  x01  Default: 1

111:3  10

11

11yxexevolutionxmethod  10Scope: restrictedx01  KEYWORD

11Description: Evolution method for Yxe

11 Range 10 x01 Default: none
11none  10Evolution for Yxe is disabled

11

11filereaderxidxvars  10Scope: shared from IOx01STRING

11

6 Interfaces

General Implements: hydrobase

Inherits: initbase Grid Variables 6.0.1 PUBLIC GROUPS

11x Group Names x10x Variable Names xx01 Details x11x
11 rho 10 rho x01 compact110
11                 10  x01 description11rest mass density
11                 10  x01 dimensions113
11                 10  x01 distribution11DEFAULT
11                 10  x01 group type11GF
11 10 x01 tags11ProlongationParameter=”HydroBase::prolongationxtype” tensortypealias=”Scalar” interpolator=”matter”
11                 10  x01 timelevels113
11                 10  x01variable type11REAL
11 press 10 press x01 compact110
11                 10  x01 description11gas pressure
11                 10  x01 dimensions113
11                 10  x01 distribution11DEFAULT
11                 10  x01 group type11GF
11 10 x01 tags11ProlongationParameter=”HydroBase::prolongationxtype” tensortypealias=”Scalar” interpolator=”matter”
11                 10  x01 timelevels113
11                 10  x01variable type11REAL
11 eps 10 eps x01 compact110
11                 10  x01 description11specific internal energy
11                 10  x01 dimensions113
11                 10  x01 distribution11DEFAULT
11                 10  x01 group type11GF
11 10 x01 tags11ProlongationParameter=”HydroBase::prolongationxtype” tensortypealias=”Scalar” interpolator=”matter”
11                 10  x01 timelevels113
11                 10  x01variable type11REAL
11 vel 10 vel x01 compact110
11                 10  x01 description11velocity vx
11                 10  x01 dimensions113
11                 10  x01 distribution11DEFAULT
11                 10  x01 group type11GF
11 10 x01 tags11ProlongationParameter=”HydroBase::prolongationxtype” tensortypealias=”U” interpolator=”matter”
11                 10  x01 timelevels113
11                 10  x01vararrayxsize113
11                 10  x01variable type11REAL
11 wxlorentz 10 wxlorentz x01 compact110
11                 10  x01 description11Lorentz Factor
11                 10  x01 dimensions113
11                 10  x01 distribution11DEFAULT
11                 10  x01 group type11GF
11 10 x01 tags11ProlongationParameter=”HydroBase::prolongationxtype” tensortypealias=”Scalar” interpolator=”matter”
11                 10  x01 timelevels113
11                 10  x01variable type11REAL
11 yxe 10 Yxe x01 compact110
11                 10  x01 description11Electron Fraction
11                 10  x01 dimensions113
11                 10  x01 distribution11DEFAULT
11                 10  x01 group type11GF
11 10 x01 tags11ProlongationParameter=”HydroBase::prolongationxtype” tensortypealias=”Scalar” interpolator=”matter”
11                 10  x01 timelevels113
11                 10  x01variable type11REAL

11x Group Names x10x Variable Names xx01 Details x11x
11 abar 10 Abar x01 compact110
11                 10  x01 description11Average atomic mass [atomic mass unit]
11                 10  x01 dimensions113
11                 10  x01 distribution11DEFAULT
11                 10  x01 group type11GF
11 10 x01 tags11ProlongationParameter=”HydroBase::prolongationxtype” tensortypealias=”Scalar” interpolator=”matter”
11                 10  x01 timelevels113
11                 10  x01variable type11REAL
11 temperature 10 temperature x01 compact110
11                 10  x01 description11Temperature [MeV]
11                 10  x01 dimensions113
11                 10  x01 distribution11DEFAULT
11                 10  x01 group type11GF
11 10 x01 tags11ProlongationParameter=”HydroBase::prolongationxtype” tensortypealias=”Scalar” interpolator=”matter”
11                 10  x01 timelevels113
11                 10  x01variable type11REAL
11 entropy 10 entropy x01 compact110
11                 10  x01 description11Specific Entropy [kxb/baryon]
11                 10  x01 dimensions113
11                 10  x01 distribution11DEFAULT
11                 10  x01 group type11GF
11 10 x01 tags11ProlongationParameter=”HydroBase::prolongationxtype” tensortypealias=”Scalar” interpolator=”matter”
11                 10  x01 timelevels113
11                 10  x01variable type11REAL
11 bvec 10 Bvec x01 compact110
11                 10  x01 description11Magnetic field components Bx
11                 10  x01 dimensions113
11                 10  x01 distribution11DEFAULT
11                 10  x01 group type11GF
11 10 x01 tags11ProlongationParameter=”HydroBase::prolongationxtype” tensortypealias=”U” tensorparity=-1 interpolator=”matter”
11                 10  x01 timelevels113
11                 10  x01vararrayxsize113
11                 10  x01variable type11REAL
11 avec 10 Avec x01 compact110
11                 10  x01 description11Vector potential
11                 10  x01 dimensions113
11                 10  x01 distribution11DEFAULT
11                 10  x01 group type11GF
11 10 x01 tags11ProlongationParameter=”HydroBase::prolongationxtype” tensortypealias=”D” jacobian=”jacobian” interpolator=”matter”
11                 10  x01 timelevels113
11                 10  x01vararrayxsize113
11                 10  x01variable type11REAL
11 aphi 10 Aphi x01 compact110
11                 10  x01 description11Electric potential for Lorentz Gauge
11                 10  x01 dimensions113
11                 10  x01 distribution11DEFAULT
11                 10  x01 group type11GF
11 10 x01 tags11ProlongationParameter=”HydroBase::prolongationxtype” tensortypealias=”Scalar” jacobian=”jacobian” interpolator=”matter”
11                 10  x01 timelevels113
11                 10  x01variable type11REAL

11

11x Group Names x10x Variable Names xx01 Details x11x
11hydroxexcisionxmask10 hydroxexcisionxmask x01  compact110
11                  10  x01 description11Mask for hydro excision
11                  10  x01 dimensions113
11                  10  x01 distribution11DEFAULT
11                  10  x01 group type11GF
11 10 x01 tags11Prolongation=”None” checkpoint=”no”
11                  10  x01 timelevels111
11                  10  x01variable type11INT

11

Adds header: HydroBase.h

Uses header: HydroBase.h 7 Schedule This section lists all the variables which are assigned storage by thorn EinsteinBase/HydroBase. Storage can either last for the duration of the run (Always means that if this thorn is activated storage will be assigned, Conditional means that if this thorn is activated storage will be assigned for the duration of the run if some condition is met), or can be turned on for the duration of a schedule function.

Storage x

11Always:  11Conditional:
11rho[timelevels]  11press[timelevels]
11eps[timelevels]  11temperature[timelevels]
11vel[timelevels]  11entropy[timelevels]
11wxlorentz[timelevels]11hydroxexcisionxmask
11x  11Yxe[timelevels]
11x  11Abar[timelevels]
11x  11Bvec[timelevels]
11x  11Avec[timelevels]
11x  11Aphi[timelevels]

11x  11x

11

Scheduled Functions

CCTKxINITIAL (conditional) x hydrobasexinitial x hydrobase initial data group x

11x11After: 11admbasexinitialdata
11 x 11x  11admbasexinitialgauge
11 x 11x  11ioutilxrecoveridfromdatafiles
11 x 11Before:11admbasexpostinitial
11 x 11x  11settmunu
11 x 11Type: 11group

11

CCTKxSTARTUP (conditional) x hydrobasexstartup x startup banner

11x11Language:11c
11 x 11Type: 11function

11

CCTKxINITIAL (conditional) x hydrobasexprim2coninitial x recover the conservative variables from the primitive variables x

11x11After: 11hydrobasexinitial
11 x 11Before:11settmunu
11 x 11Type: 11group

11

HydroBasexInitial (conditional) x hydrobasexzero x set up vacuum hydro initial data x

11x11Language:11c
11 x 11Type: 11function
11 x 11Writes: 11hydrobase::rho(everywhere)
11 x 11x  11rhoxp(everywhere)
11 x 11x  11rhoxpxp(everywhere)
11 x 11x  11hydrobase::vel(everywhere)
11 x 11x  11velxp(everywhere)
11 x 11x  11velxpxp(everywhere)
11 x 11x  11hydrobase::wxlorentz(everywhere)
11 x 11x  11wxlorentzxp(everywhere)
11 x 11x  11wxlorentzxpxp(everywhere)
11 x 11x  11hydrobase::eps(everywhere)
11 x 11x  11epsxp(everywhere)
11 x 11x  11epsxpxp(everywhere)
11 x 11x  11hydrobase::abar(everywhere)
11 x 11x  11abarxp(everywhere)
11 x 11x  11abarxpxp(everywhere)
11 x 11x  11hydrobase::temperature(everywhere)
11 x 11x  11temperaturexp(everywhere)
11 x 11x  11temperaturexpxp(everywhere)
11 x 11x  11hydrobase::entropy(everywhere)
11 x 11x  11entropyxp(everywhere)
11 x 11x  11entropyxpxp(everywhere)

11

HydroBasexInitial (conditional) x hydrobasexyxexone x set electron fraction to 1 x

11x11Language:11c
11 x 11Type: 11function
11 x 11Writes: 11hydrobase::yxe(everywhere)
11 x 11x  11yxexp(everywhere)
11 x 11x  11yxexpxp(everywhere)

11

HydroBasexInitial (conditional) x hydrobasexbvecxzero x set magnetic field to 0

11x11Language:11c
11 x 11Type: 11function
11 x 11Writes: 11hydrobase::bvec(everywhere)
11 x 11x  11bvecxp(everywhere)
11 x 11x  11bvecxpxp(everywhere)

11

HydroBasexInitial (conditional) x hydrobasexavecxzero x set vector potential to 0 x

11x11Language:11c
11 x 11Type: 11function
11 x 11Writes: 11hydrobase::avec(everywhere)
11 x 11x  11avecxp(everywhere)
11 x 11x  11avecxpxp(everywhere)

11

HydroBasexInitial (conditional) x hydrobasexaphixzero x set vector potential phi to 0 x

11x11Language:11c
11 x 11Type: 11function
11 x 11Writes: 11hydrobase::aphi(everywhere)
11 x 11x  11aphixp(everywhere)
11 x 11x  11aphixpxp(everywhere)

11

HydroBasexInitial (conditional) x hydrobasexexcisionmasksetup x set up hydro excision mask x

11x11Type:11group

11

CCTKxPOSTREGRIDINITIAL (conditional) x hydrobasexexcisionmasksetup x set up hydro excision mask x

11x11Before:11molxpoststep
11 x 11Type: 11group

11

CCTKxPOSTREGRID (conditional) x hydrobasexexcisionmasksetup x set up hydro excision mask

11x11Before:11molxpoststep
11 x 11Type: 11group

11

CCTKxPOSTxRECOVERxVARIABLES (conditional) x hydrobasexexcisionmasksetup x set up hydro excision mask x

11x11Before:11molxpoststep
11 x 11Type: 11group

11

CCTKxPARAMCHECK (conditional) x hydrobasexparamcheck x check that hydrobase parameters are consistent x

11x11Language:11c
11 x 11Type: 11function

11

HydroBasexExcisionMaskSetup (conditional) x hydrobasexinitexcisionmask x initialize hydro excision mask to ’no excision everywhere’ x

11x11Language:11c
11 x 11Type: 11function
11 x 11Writes: 11hydrobase::hydroxexcisionxmask(everywhere)

11

CCTKxPOSTSTEP (conditional) x hydrobasexexcisionhasbeenset x group to schedule thorns changing the mask before and thorns using the mask after x

11x11Type:11group

11

MoLxCalcRHS (conditional) x hydrobasexrhs x groups for scheduling tasks for calculating rhs of hydro variables x

11x11Type:11group

11

MoLxPostStep (conditional) x hydrobasexpoststep x post step tasks for hydro thorns

11x11After: 11admbasexsetadmvars
11 x 11Before:11settmunu
11 x 11Type: 11group

11

HydroBasexPostStep (conditional) x hydrobasexboundaries x hydrobase-internal boundary conditions group x

11x11Before:11hydrobasexcon2prim
11 x 11Type: 11group

11

HydroBasexBoundaries (conditional) x hydrobasexselectxboundaries x group to schedule the boundary condition functions x

11x11Type:11group

11

HydroBasexBoundaries (conditional) x applybcs x apply the boundary conditions of hydrobase x

11x11After:11hydrobasexselectxboundaries
11 x 11Type:11group

11

HydroBasexPostStep (conditional) x hydrobasexcon2prim x convert from conservative to primitive variables x

11x11Type:11group

11

CCTKxPOSTPOSTINITIAL (conditional) x hydrobasexcon2prim x convert from conservative to primitive variables (might be redundant) x

11x11Before:11admconstraintsgroup
11 x 11Type: 11group

11

Aliased Functions

11Alias Name: xxxxxxx11Function Name:
11ApplyBCs  11HydroBasexApplyBCs
11HydroBasexCon2Prim 11Con2Prim