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

AMR-Wind API: /home/runner/work/amr-wind/amr-wind/amr-wind/equation_systems/icns/icns_bcop.H Source File
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
icns_bcop.H
Go to the documentation of this file.
1#ifndef ICNS_BCOP_H
2#define ICNS_BCOP_H
3
7
8namespace amr_wind::pde {
9
13template <>
14struct BCOp<ICNS>
15{
16 BCOp(PDEFields& fields, const SimTime& time)
17 : m_fields(fields), m_time(time)
18 {}
19
22 void init_bcs()
23 {
24 BCVelocity bc(m_fields.field);
25 bc();
26 const auto udfs = bc.get_dirichlet_udfs();
28 m_fields.field, m_fields.repo.mesh(), m_time, udfs);
29
30 auto& density = m_fields.repo.get_field("density");
31 const amrex::Real density_default = 1.0;
32 BCScalar bc_den(density);
33 bc_den(density_default);
34
35 auto& pressure = m_fields.repo.get_field("p");
36 BCPressure bc_pres(pressure);
37 bc_pres();
38
39 // Used for fillpatch operation on the source term
40 BCSrcTerm bc_src(m_fields.src_term);
41 bc_src();
42
43 // Used for fillpatch operation during regrid
44 auto& gradp = m_fields.repo.get_field("gp");
45 gradp.set_default_fillpatch_bc(m_time);
46 }
47
50 void apply_bcs(const FieldState rho_state)
51 {
52 amrex::IntVect ng_diff(1);
53 auto& field = m_fields.field;
54 if ((rho_state != FieldState::Old && rho_state != FieldState::New)) {
55 amrex::Abort(
56 "icns_bcop.H apply_bcs(): a state other than New or Old was "
57 "used. The time used for fillphysbc must be evaluated before "
58 "using a different state for this routine.\n");
59 }
60 if (rho_state == FieldState::New) {
61 field.fillphysbc(m_time.new_time(), ng_diff);
62 }
63 field.apply_bc_funcs(rho_state);
64 }
65
68};
69
70} // namespace amr_wind::pde
71
72#endif /* ICNS_BCOP_H */
amrex::Array< const std::string, 3 > get_dirichlet_udfs()
User-defined functions for Dirichlet-type boundaries.
Definition BCInterface.cpp:115
Definition BCInterface.H:126
Definition BCInterface.H:111
Definition BCInterface.H:141
Definition BCInterface.H:98
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_velocity_dirichlet(Field &field, const amrex::AmrCore &mesh, const SimTime &time, const amrex::Array< const std::string, 3 > &udfs)
Definition velocity_bcs.H:53
PDEFields & m_fields
Definition icns_bcop.H:66
const SimTime & m_time
Definition icns_bcop.H:67
void init_bcs()
Definition icns_bcop.H:22
BCOp(PDEFields &fields, const SimTime &time)
Definition icns_bcop.H:16
void apply_bcs(const FieldState rho_state)
Definition icns_bcop.H:50
Definition PDEOps.H:198
Definition icns.H:34
Definition PDEFields.H:27