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

AMR-Wind API: /home/runner/work/amr-wind/amr-wind/amr-wind/equation_systems/vof/vof_ops.H Source File
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
vof_ops.H
Go to the documentation of this file.
1#ifndef VOF_OPS_H
2#define VOF_OPS_H
3
6
7namespace amr_wind::pde {
8
12template <typename Scheme>
13struct FieldRegOp<VOF, Scheme>
14{
15 explicit FieldRegOp(CFDSim& sim_in) : sim(sim_in) {}
16
18 {
19 auto& repo = sim.repo();
20 auto fields = create_fields_instance<VOF, Scheme>(time, repo);
21
22 auto& levelset = repo.declare_cc_field("levelset", 1, 3, 1);
23 auto& curvature = repo.declare_cc_field("interface_curvature", 1, 1, 1);
24
25 levelset.set_default_fillpatch_bc(sim.time());
26 curvature.set_default_fillpatch_bc(sim.time());
27
28 // Register fields for output/restart
29 auto& iomgr = sim.io_manager();
30 iomgr.register_io_var(fields.field.name());
31
32 return fields;
33 }
34
36};
37
40template <typename Scheme>
41struct ComputeRHSOp<VOF, Scheme>
42{
43 explicit ComputeRHSOp(PDEFields& fields_in) : fields(fields_in) {}
44
46 const DiffusionType /*unused*/,
47 const amrex::Real /*unused*/,
48 bool /*unused*/)
49 {}
50
52 const DiffusionType /*unused*/,
53 const amrex::Real /*unused*/,
54 bool /*unused*/)
55 {}
56
57 // data members
59};
60
65template <>
67{
68 PostSolveOp(CFDSim& sim, PDEFields& fields) : m_sim(sim), m_fields(fields)
69 {}
70
71 void operator()(const amrex::Real /*unused*/)
72 {
74 auto& multiphase = m_sim.physics_manager().get<MultiPhase>();
75 multiphase.set_density_via_vof();
76 // Do this for old state too if modified by vof sharpening
77 if (m_sim.repo().int_field_exists("iblank_cell")) {
78 multiphase.set_density_via_vof(amr_wind::FieldState::Old);
79 }
80
81 // Calculate n+1/2 density
82 multiphase.set_nph_density();
83 // Convert advalpha to advrho
84 multiphase.calculate_advected_facedensity();
85 }
86
89};
90
91} // namespace amr_wind::pde
92
93#endif /* VOF_OPS_H */
Definition CFDSim.H:47
FieldRepo & repo()
Return the field repository.
Definition CFDSim.H:62
PhysicsMgr & physics_manager()
Definition CFDSim.H:68
SimTime & time()
Return simulation time control.
Definition CFDSim.H:58
IOManager & io_manager()
Definition CFDSim.H:83
void fillpatch(const amrex::Real time) noexcept
Definition Field.cpp:206
bool int_field_exists(const std::string &name, const FieldState fstate=FieldState::New) const
Query if an integer field exists.
Definition FieldRepo.cpp:293
void register_io_var(const std::string &fname)
Convenience function to register a variable for both output and restart.
Definition IOManager.H:76
Definition MultiPhase.H:27
void set_density_via_vof(amr_wind::FieldState fstate=amr_wind::FieldState::New)
Definition MultiPhase.cpp:337
T & get()
Return a concrete physics instance.
Definition Physics.H:104
Definition SimTime.H:30
AMREX_FORCE_INLINE amrex::Real current_time() const
Definition SimTime.H:102
@ Old
Same as FieldState::N.
DiffusionType
Definition incflo_enums.H:4
Definition AdvOp_Godunov.H:16
PDEFields create_fields_instance(const SimTime &time, FieldRepo &repo, const FieldInterpolator itype=FieldInterpolator::CellConsLinear)
Definition PDEHelpers.H:49
void corrector_rhs(const DiffusionType, const amrex::Real, bool)
Definition vof_ops.H:51
void predictor_rhs(const DiffusionType, const amrex::Real, bool)
Definition vof_ops.H:45
ComputeRHSOp(PDEFields &fields_in)
Definition vof_ops.H:43
PDEFields & fields
Definition vof_ops.H:58
Definition CompRHSOps.H:18
PDEFields & fields
Definition CompRHSOps.H:270
PDEFields operator()(const SimTime &time)
Definition vof_ops.H:17
CFDSim & sim
Definition vof_ops.H:35
FieldRegOp(CFDSim &sim_in)
Definition vof_ops.H:15
Definition PDEOps.H:35
CFDSim & sim
Definition PDEOps.H:53
Definition PDEFields.H:27
Field & field
Solution variable (e.g., velocity, temperature)
Definition PDEFields.H:34
void operator()(const amrex::Real)
Definition vof_ops.H:71
PDEFields & m_fields
Definition vof_ops.H:88
CFDSim & m_sim
Definition vof_ops.H:87
PostSolveOp(CFDSim &sim, PDEFields &fields)
Definition vof_ops.H:68
Definition PDEOps.H:205
CFDSim & m_sim
Definition PDEOps.H:212
PDEFields & m_fields
Definition PDEOps.H:213
Definition vof.H:17