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,
74 const amrex::GpuArray<ERF_BC, AMREX_SPACEDIM*2>& a_phys_bc_types )
override
77 m_moist_model->Advance(dt_advance, iter, time, a_vars, a_z, a_phys_bc_types);
82 amrex::MultiFab& cons_in )
override
85 m_moist_model->Update_Micro_Vars(cons_in);
90 amrex::MultiFab& cons_in )
override
93 m_moist_model->Update_State_Vars(cons_in);
98 const int& varIdx )
override
100 return (lev > 0 ?
nullptr : m_moist_model->Qmoist_Ptr(varIdx));
106 return (a_lev > 0 ? 0 : m_moist_model->Qmoist_Size());
112 return m_moist_model->Qstate_Size();
116 inline void initParticles ( std::unique_ptr<amrex::MultiFab>& z_phys_nd )
118 m_moist_model->InitParticles(z_phys_nd);
122 inline void restartParticles ( amrex::ParGDBBase* a_gdb,
const std::string& a_fname)
124 m_moist_model->RestartParticles(a_gdb, a_fname);
128 inline ERFPC* getParticleContainer ()
const
130 return m_moist_model->getParticleContainer();
134 inline const std::string& getName ()
const
136 return m_moist_model->getName();
143 std::vector<int>& a_idx,
144 std::vector<std::string>& a_names )
const override
147 m_moist_model->Qmoist_Restart_Vars( a_sc, a_idx, a_names );
157 template<
class NewMoistModel>
160 m_moist_model = std::make_unique<NewMoistModel>();
163 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:14
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 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:69
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 >> &, const amrex::GpuArray< ERF_BC, AMREX_SPACEDIM *2 > &)=0
advance microphysics for one time step
Definition: ERF_DataStruct.H:82