/home/runner/work/amr-wind/amr-wind/amr-wind/equation_systems/PDEHelpers.H Source File

AMR-Wind API: /home/runner/work/amr-wind/amr-wind/amr-wind/equation_systems/PDEHelpers.H Source File
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
PDEHelpers.H
Go to the documentation of this file.
1#ifndef PDEHELPERS_H
2#define PDEHELPERS_H
3
4#include <string>
5
11
12namespace amr_wind {
13namespace pde_impl {
14
16AMREX_INLINE std::string conv_term_name(const std::string& var)
17{
18 return var + "_conv_term";
19}
20
22AMREX_INLINE std::string diff_term_name(const std::string& var)
23{
24 return var + "_diff_term";
25}
26
28AMREX_INLINE std::string src_term_name(const std::string& var)
29{
30 return var + "_src_term";
31}
32
34AMREX_INLINE std::string mueff_name(const std::string& var)
35{
36 return var + "_mueff";
37}
38
39} // namespace pde_impl
40
41namespace pde {
42
51template <typename PDE, typename Scheme>
53 const SimTime& time,
54 FieldRepo& repo,
56{
57 repo.declare_field(
58 PDE::var_name(), PDE::ndim, Scheme::nghost_state, Scheme::num_states);
59 repo.declare_field(pde_impl::mueff_name(PDE::var_name()), 1, 1, 1);
60 repo.declare_field(
61 pde_impl::src_term_name(PDE::var_name()), PDE::ndim, Scheme::nghost_src,
62 1);
63 repo.declare_field(
64 pde_impl::diff_term_name(PDE::var_name()), PDE::ndim, 0,
65 Scheme::num_diff_states);
66 repo.declare_field(
67 pde_impl::conv_term_name(PDE::var_name()), PDE::ndim, 0,
68 Scheme::num_conv_states);
69
70 PDEFields fields(repo, PDE::var_name());
72 repo.mesh(), time, itype);
76
77 fields.field.fillpatch_on_regrid() = true;
78
79 if (PDE::need_nph_state) {
81 }
82
83 return fields;
84}
85
86} // namespace pde
87} // namespace amr_wind
88
89#endif /* PDEHELPERS_H */
Definition FieldFillPatchOps.H:176
void set_default_fillpatch_bc(const SimTime &time, amrex::BCType::mathematicalBndryTypes bctype=amrex::BCType::hoextrap)
Definition Field.cpp:373
bool & fillpatch_on_regrid()
Definition Field.H:163
void register_fill_patch_op(Args &&... args)
Definition Field.H:313
Field & create_state(FieldState fstate)
Create a new time state after the field has been created.
Definition Field.cpp:331
Definition FieldRepo.H:86
Field & declare_field(const std::string &name, int ncomp=1, int ngrow=0, int nstates=1, FieldLoc floc=FieldLoc::CELL)
Definition FieldRepo.cpp:86
const amrex::AmrCore & mesh() const
Return a reference to the underlying AMR mesh instance.
Definition FieldRepo.H:348
Definition SimTime.H:33
FieldInterpolator
Coarse-to-fine field interpolation options.
Definition FieldDescTypes.H:39
@ NPH
State at (n + 1/2) (intermediate) timestep.
Definition FieldDescTypes.H:20
@ PiecewiseConstant
Constant across cell.
Definition FieldDescTypes.H:40
@ CellConsLinear
Linear interpolation.
Definition FieldDescTypes.H:41
Definition PDEHelpers.H:13
AMREX_INLINE std::string diff_term_name(const std::string &var)
Field name that holds the diffusion term (divtau and laplacian for scalars)
Definition PDEHelpers.H:22
AMREX_INLINE std::string conv_term_name(const std::string &var)
Field name that holds the convective term.
Definition PDEHelpers.H:16
AMREX_INLINE std::string src_term_name(const std::string &var)
Field name for all the source terms.
Definition PDEHelpers.H:28
AMREX_INLINE std::string mueff_name(const std::string &var)
Effective viscosity for the transport equation.
Definition PDEHelpers.H:34
PDEFields create_fields_instance(const SimTime &time, FieldRepo &repo, const FieldInterpolator itype=FieldInterpolator::CellConsLinear)
Definition PDEHelpers.H:52
This test case is intended as an evaluation of the momentum advection scheme.
Definition BCInterface.cpp:10
Definition PDEFields.H:27
Field & src_term
Source term for this PDE.
Definition PDEFields.H:39
Field & mueff
Effective visocity field (e.g., velocity_mueff)
Definition PDEFields.H:36
Field & field
Solution variable (e.g., velocity, temperature)
Definition PDEFields.H:34