/home/runner/work/amr-wind/amr-wind/amr-wind/physics/multiphase/MultiPhase.H Source File

AMR-Wind API: /home/runner/work/amr-wind/amr-wind/amr-wind/physics/multiphase/MultiPhase.H Source File
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
MultiPhase.H
Go to the documentation of this file.
1#ifndef MULTIPHASE_H
2#define MULTIPHASE_H
3
8
19namespace amr_wind {
20
22 VOF,
23 LS
24};
25
26class MultiPhase : public Physics::Register<MultiPhase>
27{
28public:
29 static std::string identifier() { return "MultiPhase"; }
30
31 explicit MultiPhase(CFDSim& sim);
32
33 ~MultiPhase() override = default;
34
35 void
36 initialize_fields(int /*level*/, const amrex::Geometry& /*geom*/) override
37 {}
38
39 void post_init_actions() override;
40
41 void post_regrid_actions() override;
42
43 void pre_advance_work() override;
44
45 void post_advance_work() override;
46
48
51
52 void set_nph_density();
53
55
56 void levelset2vof();
57
58 void levelset2vof(const IntField& iblank_cell, ScratchField& vof_scr);
59
60 void favre_filtering();
61
62 amrex::Real volume_fraction_sum();
63
64 amrex::Real momentum_sum(int n);
65
67
68 amrex::Real rho1() const { return m_rho1; }
69
70 amrex::Real rho2() const { return m_rho2; }
71
72 amrex::Vector<amrex::Real> gravity() const { return m_gravity; }
73
74 amrex::Real water_level() const { return m_water_level0; }
75
77
79 {
81 }
82
83private:
84 const CFDSim& m_sim;
85
88
89 // Pointer to the levelset
90 Field* m_levelset{nullptr};
91
92 // Pointer to VOF
93 Field* m_vof{nullptr};
94
95 // Density value for Fluid 1
96 amrex::Real m_rho1{10.0};
97
98 // Density value for Fluid 2
99 amrex::Real m_rho2{1.0};
100
101 // Bools according to ICNS settings
102 // Turning on perturbational density and pressure
104 // Reconstructing true pressure field at end of timestep
106
107 // Info to create rho0
108 amrex::Real m_water_level0{0.0};
109 // Info to reconstruct true pressure
110 amrex::Vector<amrex::Real> m_gravity{0.0, 0.0, -9.81};
111
113
115
116 // Multiphase model enum
117 std::string m_interface_model{"vof"};
120
121 // Verbose flag for multiphase
122 int m_verbose{0};
123
124 // sum of volume fractions (for vof only)
125 amrex::Real m_total_volfrac{0.0};
126
127 amrex::Real m_q0{0.0};
128 amrex::Real m_q1{0.0};
129 amrex::Real m_q2{0.0};
130 amrex::Real m_sumvof0{0.0};
131};
132
133} // namespace amr_wind
134
135#endif /* MULTIPHASE_H */
Definition CFDSim.H:47
Definition Field.H:116
Definition IntField.H:20
Definition MultiPhase.H:27
void levelset2vof()
Definition MultiPhase.cpp:472
bool reconstruct_true_pressure() const
Definition MultiPhase.H:78
amrex::Real m_water_level0
Definition MultiPhase.H:108
void calculate_advected_facedensity()
Definition MultiPhase.cpp:371
static std::string identifier()
Definition MultiPhase.H:29
amrex::Real water_level() const
Definition MultiPhase.H:74
InterfaceCapturingMethod m_interface_capturing_method
Definition MultiPhase.H:118
void set_density_via_levelset()
Definition MultiPhase.cpp:298
void post_init_actions() override
Definition MultiPhase.cpp:85
bool m_interface_smoothing
Definition MultiPhase.H:112
void initialize_fields(int, const amrex::Geometry &) override
Definition MultiPhase.H:36
amrex::Real rho1() const
Definition MultiPhase.H:68
int m_verbose
Definition MultiPhase.H:122
int m_smooth_freq
Definition MultiPhase.H:114
amrex::Real volume_fraction_sum()
Definition MultiPhase.cpp:201
bool m_use_perturb_pressure
Definition MultiPhase.H:103
amrex::Real rho2() const
Definition MultiPhase.H:70
amrex::Real m_rho1
Definition MultiPhase.H:96
MultiPhase(CFDSim &sim)
Definition MultiPhase.cpp:14
void set_nph_density()
Definition MultiPhase.cpp:361
void pre_advance_work() override
Definition MultiPhase.cpp:155
bool perturb_pressure() const
Definition MultiPhase.H:76
amrex::Real momentum_sum(int n)
Definition MultiPhase.cpp:248
amrex::Vector< amrex::Real > gravity() const
Definition MultiPhase.H:72
Field * m_levelset
Definition MultiPhase.H:90
void favre_filtering()
Definition MultiPhase.cpp:415
InterfaceCapturingMethod interface_capturing_method()
Definition MultiPhase.cpp:80
amrex::Real m_rho2
Definition MultiPhase.H:99
const CFDSim & m_sim
Definition MultiPhase.H:84
void set_density_via_vof(amr_wind::FieldState fstate=amr_wind::FieldState::New)
Definition MultiPhase.cpp:337
~MultiPhase() override=default
amrex::Real m_q0
Definition MultiPhase.H:127
amrex::Real m_q1
Definition MultiPhase.H:128
std::string m_interface_model
Definition MultiPhase.H:117
void post_regrid_actions() override
Definition MultiPhase.cpp:136
Field & m_density
Definition MultiPhase.H:87
Field & m_velocity
Definition MultiPhase.H:86
amrex::Real m_q2
Definition MultiPhase.H:129
void post_advance_work() override
Definition MultiPhase.cpp:171
amrex::Real m_total_volfrac
Definition MultiPhase.H:125
bool m_reconstruct_true_pressure
Definition MultiPhase.H:105
amrex::Vector< amrex::Real > m_gravity
Definition MultiPhase.H:110
amrex::Real m_sumvof0
Definition MultiPhase.H:130
Field * m_vof
Definition MultiPhase.H:93
Definition ScratchField.H:30
FieldState
Definition FieldDescTypes.H:14
@ New
Same as FieldState::NP1.
Definition BCInterface.cpp:7
InterfaceCapturingMethod
Definition MultiPhase.H:21