Athena++/Atmosphere
Planetary Atmosphere Simulator
hydro_srcterms.hpp
Go to the documentation of this file.
1 #ifndef HYDRO_SRCTERMS_HYDRO_SRCTERMS_HPP_
2 #define HYDRO_SRCTERMS_HYDRO_SRCTERMS_HPP_
3 //========================================================================================
4 // Athena++ astrophysical MHD code
5 // Copyright(C) 2014 James M. Stone <jmstone@princeton.edu> and other code contributors
6 // Licensed under the 3-clause BSD License, see LICENSE file for details
7 //========================================================================================
9 // \brief defines class HydroSourceTerms
10 // Contains data and functions that implement physical (not coordinate) source terms
11 
12 // C headers
13 
14 // C++ headers
15 
16 // Athena++ headers
17 #include "../../athena.hpp"
18 #include "../../athena_arrays.hpp"
19 
20 // Forward declarations
21 class Hydro;
22 class ParameterInput;
23 
25 // \brief data and functions for physical source terms in the hydro
26 
28  public:
30 
31  // accessors
32  Real GetGM() const {return gm_;}
33  Real GetG1() const {return g1_;}
34  Real GetG2() const {return g2_;}
35  Real GetG3() const {return g3_;}
36  Real GetOmegaX() const {return omegax_;}
37  Real GetOmegaY() const {return omegay_;}
38  Real GetOmegaZ() const {return omegaz_;}
39 
40  // data
42 
43  // functions
44  void AddHydroSourceTerms(const Real time, const Real dt, const AthenaArray<Real> *flx,
45  const AthenaArray<Real> &p,
47  void PointMass(const Real dt, const AthenaArray<Real> *flx,const AthenaArray<Real> &p,
49  void ConstantAcceleration(const Real dt, const AthenaArray<Real> *flx,
51  // shearing box src terms
52  void ShearingBoxSourceTerms(const Real dt, const AthenaArray<Real> *flx,
54  Real UnstratifiedDisk(const Real x1, const Real x2, const Real x3);
55 
56  void SelfGravity(const Real dt, const AthenaArray<Real> *flx,
60 
61  // coriolis acceleration
62  void Coriolis123(const Real dt, const AthenaArray<Real> *flx,
64  void CoriolisXYZ(const Real dt, const AthenaArray<Real> *flx,
66 
67  private:
68  Hydro *pmy_hydro_; // ptr to Hydro containing this HydroSourceTerms
69  Real gm_; // GM for point mass MUST BE LOCATED AT ORIGIN
70  Real g1_, g2_, g3_; // constant acc'n in each direction
71  Real Omega_0_, qshear_; // Orbital freq and shear rate
72  int ShBoxCoord_; // ShearCoordinate type: 1=xy (default), 2=xz
73 
74  Real omega1_, omega2_, omega3_; // constant coriolis acc'n in each direction
75  Real omegax_, omegay_, omegaz_; // coriolis acc'n in cartesian direction
76 };
77 #endif // HYDRO_SRCTERMS_HYDRO_SRCTERMS_HPP_
double Real
Definition: athena.hpp:29
void(*)(MeshBlock *pmb, const Real time, const Real dt, const AthenaArray< Real > &prim, const AthenaArray< Real > &bcc, AthenaArray< Real > &cons) SrcTermFunc
Definition: athena.hpp:181
Real GetGM() const
void PointMass(const Real dt, const AthenaArray< Real > *flx, const AthenaArray< Real > &p, AthenaArray< Real > &c)
void ShearingBoxSourceTerms(const Real dt, const AthenaArray< Real > *flx, const AthenaArray< Real > &p, AthenaArray< Real > &c)
void CoriolisXYZ(const Real dt, const AthenaArray< Real > *flx, const AthenaArray< Real > &p, AthenaArray< Real > &c)
add source terms for constant coriolis acceleration in
Real GetOmegaY() const
void EnrollSrcTermFunction(SrcTermFunc my_func)
Real GetG2() const
void AddHydroSourceTerms(const Real time, const Real dt, const AthenaArray< Real > *flx, const AthenaArray< Real > &p, const AthenaArray< Real > &b, AthenaArray< Real > &c)
HydroSourceTerms(Hydro *phyd, ParameterInput *pin)
void SelfGravity(const Real dt, const AthenaArray< Real > *flx, const AthenaArray< Real > &p, AthenaArray< Real > &c)
Real GetOmegaX() const
Real UnstratifiedDisk(const Real x1, const Real x2, const Real x3)
Real GetG3() const
Real GetG1() const
Real GetOmegaZ() const
void ConstantAcceleration(const Real dt, const AthenaArray< Real > *flx, const AthenaArray< Real > &p, AthenaArray< Real > &c)
void Coriolis123(const Real dt, const AthenaArray< Real > *flx, const AthenaArray< Real > &p, AthenaArray< Real > &c)
source terms due to constant coriolis acceleration
SrcTermFunc UserSourceTerm
Definition: hydro.hpp:33