5 #ifndef ERF_LAGRANGIANMICROPHYSICS_H
6 #define ERF_LAGRANGIANMICROPHYSICS_H
8 #ifdef ERF_USE_PARTICLES
31 LagrangianMicrophysics () { }
34 ~LagrangianMicrophysics () =
default;
37 LagrangianMicrophysics (
const int& ,
38 const MoistureType& a_model_type )
41 amrex::Abort(
"No Lagrangian moisture model implemented yet!") ;
45 void Define (
const int& lev,
49 m_moist_model->Define(sc);
53 void Init (
const int& lev,
54 const amrex::MultiFab& cons_in,
55 const amrex::BoxArray& grids,
56 const amrex::Geometry& geom,
57 const amrex::Real& dt_advance,
58 std::unique_ptr<amrex::MultiFab>& z_phys_nd,
59 std::unique_ptr<amrex::MultiFab>& detJ_cc )
override
62 m_moist_model->Init(cons_in, grids, geom, dt_advance,
68 const amrex::Real& dt_advance,
70 const amrex::Real& time,
72 amrex::Vector<amrex::Vector<amrex::MultiFab>>& a_vars,
73 const amrex::Vector<std::unique_ptr<amrex::MultiFab>>& a_z)
override
76 m_moist_model->Advance(dt_advance, iter, time, a_vars, a_z);
81 amrex::MultiFab& cons_in )
override
84 m_moist_model->Update_Micro_Vars(cons_in);
89 amrex::MultiFab& cons_in )
override
92 m_moist_model->Update_State_Vars(cons_in);
97 const int& varIdx )
override
99 return (lev > 0 ?
nullptr : m_moist_model->Qmoist_Ptr(varIdx));
105 return (a_lev > 0 ? 0 : m_moist_model->Qmoist_Size());
111 return m_moist_model->Qstate_Size();
115 inline void initParticles ( std::unique_ptr<amrex::MultiFab>& z_phys_nd )
117 m_moist_model->InitParticles(z_phys_nd);
121 inline void restartParticles ( amrex::ParGDBBase* a_gdb,
const std::string& a_fname)
123 m_moist_model->RestartParticles(a_gdb, a_fname);
127 inline ERFPC* getParticleContainer ()
const
129 return m_moist_model->getParticleContainer();
133 inline const std::string& getName ()
const
135 return m_moist_model->getName();
142 std::vector<int>& a_idx,
143 std::vector<std::string>& a_names )
const override
146 m_moist_model->Qmoist_Restart_Vars( a_sc, a_idx, a_names );
156 template<
class NewMoistModel>
159 m_moist_model = std::make_unique<NewMoistModel>();
162 std::unique_ptr<NullMoistLagrangian> m_moist_model;
Contains the base class for microphysics.
Contains the Lagrangian moisture model base class.
Base class for microphysics interface.
Definition: ERF_Microphysics.H:13
virtual int Get_Qmoist_Size(const int &)=0
get the number of moisture model variables
virtual void Define(const int &, SolverChoice &)=0
define the microphysics object
virtual void Init(const int &, const amrex::MultiFab &, const amrex::BoxArray &, const amrex::Geometry &, const amrex::Real &, std::unique_ptr< amrex::MultiFab > &, std::unique_ptr< amrex::MultiFab > &)=0
initialize the microphysics object
virtual void Update_State_Vars_Lev(const int &, amrex::MultiFab &)=0
update ERF state variables from microphysics variables
virtual void Update_Micro_Vars_Lev(const int &, amrex::MultiFab &)=0
update microphysics variables from ERF state variables
virtual int Get_Qstate_Size()=0
get the number of moisture-model-related conserved state variables
virtual void Advance(const int &, const amrex::Real &, const int &, const amrex::Real &, const SolverChoice &, amrex::Vector< amrex::Vector< amrex::MultiFab >> &, const amrex::Vector< std::unique_ptr< amrex::MultiFab >> &)=0
advance microphysics for one time step
virtual amrex::MultiFab * Get_Qmoist_Ptr(const int &, const int &)=0
get pointer to a moisture variable
virtual void Get_Qmoist_Restart_Vars(int, const SolverChoice &, std::vector< int > &, std::vector< std::string > &) const =0
get the indices and names of moisture model variables for restart at a given level
static MoistureModelType modelType(const MoistureType a_moisture_type)
query if a specified moisture model is Eulerian or Lagrangian
Definition: ERF_Microphysics.H:64
Definition: ERF_DataStruct.H:78