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

AMR-Wind API: /home/runner/work/amr-wind/amr-wind/amr-wind/equation_systems/BCOps.H Source File
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
BCOps.H
Go to the documentation of this file.
1#ifndef BCOPS_H
2#define BCOPS_H
3
8
9namespace amr_wind::pde {
10
14template <typename PDE>
15struct BCOp<PDE, std::enable_if_t<std::is_base_of_v<ScalarTransport, PDE>>>
16{
17 BCOp(PDEFields& fields, const SimTime& time)
18 : m_fields(fields), m_time(time)
19 {}
20
23 void init_bcs()
24 {
25 BCScalar bc(m_fields.field);
26 bc(PDE::default_bc_value);
27 const auto udfs = bc.get_dirichlet_udfs();
29 m_fields.field, m_fields.repo.mesh(), m_time, udfs);
30
31 // Used for fillpatch operation on the source term
32 BCSrcTerm bc_src(m_fields.src_term);
33 bc_src();
34 }
35
38 void apply_bcs(const FieldState rho_state)
39 {
40 amrex::IntVect ng_diff(1);
41 auto& field = m_fields.field;
42 if ((rho_state != FieldState::Old && rho_state != FieldState::New)) {
43 amrex::Abort(
44 "BCOps.H apply_bcs(): a state other than New or Old was used. "
45 "The time used for fillphysbc must be evaluated before using "
46 "a different state for this routine.");
47 }
48 if (rho_state == FieldState::New) {
49 field.fillphysbc(m_time.new_time(), ng_diff);
50 }
51 field.apply_bc_funcs(rho_state);
52 }
53
56};
57
58} // namespace amr_wind::pde
59
60#endif /* BCOPS_H */
amrex::Array< const std::string, 3 > get_dirichlet_udfs()
User-defined functions for Dirichlet-type boundaries.
Definition BCInterface.cpp:115
Definition BCInterface.H:111
Definition BCInterface.H:141
Definition SimTime.H:30
FieldState
Definition FieldDescTypes.H:14
@ New
Same as FieldState::NP1.
@ Old
Same as FieldState::N.
Definition AdvOp_Godunov.H:16
void register_scalar_dirichlet(Field &field, const amrex::AmrCore &mesh, const SimTime &time, const amrex::Array< const std::string, 3 > &udfs)
Definition scalar_bcs.cpp:4
BCOp(PDEFields &fields, const SimTime &time)
Definition BCOps.H:17
Definition PDEOps.H:198
Definition PDEFields.H:27