/home/runner/work/kynema-sgf/kynema-sgf/src/boundary_conditions/field_boundary_fill/ModulatedPowerLaw.H Source File

Kynema-SGF API: /home/runner/work/kynema-sgf/kynema-sgf/src/boundary_conditions/field_boundary_fill/ModulatedPowerLaw.H Source File
Kynema-SGF API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
ModulatedPowerLaw.H
Go to the documentation of this file.
1#ifndef MODULATEDPOWERLAW_H
2#define MODULATEDPOWERLAW_H
3
4#include "src/core/Field.H"
5#include "src/CFDSim.H"
7#include "AMReX_Gpu.H"
10#include "AMReX_REAL.H"
11
12using namespace amrex::literals;
13
14namespace kynema_sgf {
15
22class ModulatedPowerLaw : public FieldBoundary::Register<ModulatedPowerLaw>
23{
24
25public:
26 static std::string identifier() { return "ModulatedPowerLaw"; }
27
28 explicit ModulatedPowerLaw(CFDSim& /*sim*/);
29
30 void post_init_actions() override;
31
32 void pre_advance_work() override;
33
34 void post_advance_work() override;
35
36 [[nodiscard]] bool provides_inflow_values(
37 const Field& field, amrex::Orientation ori) const override;
38
39 void set_velocity(
40 int lev,
41 amrex::Real time,
42 const Field& fld,
43 amrex::MultiFab& mfab,
44 int dcomp = 0,
45 int orig_comp = 0) const override;
46
47 void set_temperature(
48 int lev,
49 amrex::Real time,
50 const Field& fld,
51 amrex::MultiFab& mfab) const;
52
53private:
54 const CFDSim& m_sim;
57 const amrex::AmrCore& m_mesh;
60
61 amrex::Real m_zoffset{0.0_rt};
62 amrex::Real m_zref{90};
63 amrex::Real m_shear_exp{0.1_rt};
64 amrex::Real m_umax_factor{1.2_rt};
65 amrex::Real m_bulk_velocity{15.0_rt};
66 amrex::Real m_shearlayer_height{600.0_rt};
67 amrex::Real m_shearlayer_smear_thickness{30.0_rt};
68 amrex::Real m_wind_speed{8.0_rt};
69 amrex::Real m_wind_direction{270.0_rt};
70 amrex::Vector<amrex::Real> m_uvec{8.0_rt, 0.0_rt, 0.0_rt};
71
72 amrex::Real m_start_time{0.0_rt};
73 amrex::Real m_stop_time{std::numeric_limits<amrex::Real>::max()};
74 amrex::Real m_degrees_per_sec{0.02_rt};
75
79 amrex::Vector<amrex::Real> m_theta_heights;
80 amrex::Vector<amrex::Real> m_theta_values;
82
83 // Device copies of the above arrays
84 amrex::Gpu::DeviceVector<amrex::Real> m_thht_d;
85 amrex::Gpu::DeviceVector<amrex::Real> m_thvv_d;
86
87 amrex::Real m_delta_t{0.8_rt};
88 amrex::Real m_theta_cutoff_height{250.0_rt};
89 amrex::Real m_theta_gauss_mean{0.0_rt};
90 amrex::Real m_theta_gauss_var{1.0_rt};
91};
92
93} // namespace kynema_sgf
94
95#endif /* MODULATEDPOWERLAW_H */
Definition CFDSim.H:55
Definition Field.H:115
Definition FieldRepo.H:86
void set_temperature(int lev, amrex::Real time, const Field &fld, amrex::MultiFab &mfab) const
Definition ModulatedPowerLaw.cpp:227
bool provides_inflow_values(const Field &field, amrex::Orientation ori) const override
Definition ModulatedPowerLaw.cpp:114
amrex::Real m_theta_cutoff_height
Definition ModulatedPowerLaw.H:88
void pre_advance_work() override
Definition ModulatedPowerLaw.cpp:82
amrex::Real m_shear_exp
Definition ModulatedPowerLaw.H:63
amrex::Real m_bulk_velocity
Definition ModulatedPowerLaw.H:65
const kynema_sgf::SimTime & m_time
Definition ModulatedPowerLaw.H:55
void post_init_actions() override
Definition ModulatedPowerLaw.cpp:76
amrex::Vector< amrex::Real > m_theta_values
Definition ModulatedPowerLaw.H:80
amrex::Real m_wind_direction
Definition ModulatedPowerLaw.H:69
ModulatedPowerLaw(CFDSim &)
Definition ModulatedPowerLaw.cpp:18
amrex::Real m_zref
Definition ModulatedPowerLaw.H:62
amrex::Real m_zoffset
Definition ModulatedPowerLaw.H:61
void set_velocity(int lev, amrex::Real time, const Field &fld, amrex::MultiFab &mfab, int dcomp=0, int orig_comp=0) const override
Definition ModulatedPowerLaw.cpp:122
amrex::Real m_theta_gauss_var
Definition ModulatedPowerLaw.H:90
amrex::Gpu::DeviceVector< amrex::Real > m_thht_d
Definition ModulatedPowerLaw.H:84
amrex::Real m_degrees_per_sec
Definition ModulatedPowerLaw.H:74
amrex::Real m_umax_factor
Definition ModulatedPowerLaw.H:64
Field & m_velocity
Definition ModulatedPowerLaw.H:58
static std::string identifier()
Definition ModulatedPowerLaw.H:26
Field & m_temperature
Definition ModulatedPowerLaw.H:59
amrex::Vector< amrex::Real > m_uvec
Definition ModulatedPowerLaw.H:70
amrex::Real m_delta_t
Definition ModulatedPowerLaw.H:87
amrex::Real m_stop_time
Definition ModulatedPowerLaw.H:73
amrex::Vector< amrex::Real > m_theta_heights
Definition ModulatedPowerLaw.H:79
amrex::Real m_shearlayer_smear_thickness
Definition ModulatedPowerLaw.H:67
amrex::Real m_wind_speed
Definition ModulatedPowerLaw.H:68
amrex::Gpu::DeviceVector< amrex::Real > m_thvv_d
Definition ModulatedPowerLaw.H:85
void post_advance_work() override
Definition ModulatedPowerLaw.cpp:112
amrex::Real m_start_time
Definition ModulatedPowerLaw.H:72
const CFDSim & m_sim
Definition ModulatedPowerLaw.H:54
const FieldRepo & m_repo
Definition ModulatedPowerLaw.H:56
const amrex::AmrCore & m_mesh
Definition ModulatedPowerLaw.H:57
amrex::Real m_theta_gauss_mean
Definition ModulatedPowerLaw.H:89
amrex::Real m_shearlayer_height
Definition ModulatedPowerLaw.H:66
Definition SimTime.H:34
This test case is intended as an evaluation of the momentum advection scheme.
Definition BCInterface.cpp:12