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

AMR-Wind API: /home/runner/work/amr-wind/amr-wind/amr-wind/physics/VortexRing.H Source File
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
VortexRing.H
Go to the documentation of this file.
1#ifndef VortexRing_H
2#define VortexRing_H
3
6
7namespace amr_wind {
8
12class VortexRing : public Physics::Register<VortexRing>
13{
14public:
15 static std::string identifier() { return "VortexRing"; }
16
17 explicit VortexRing(const CFDSim& sim);
18
19 ~VortexRing() override = default;
20
21 void initialize_fields(int level, const amrex::Geometry& geom) override;
22
23 void post_init_actions() override;
24
25 void post_regrid_actions() override {}
26
27 void pre_advance_work() override {}
28
29 void post_advance_work() override {}
30
31 template <typename VortexRingType>
32 void initialize_velocity(const VortexRingType& vorticity_theta);
33
34private:
35 const CFDSim& m_sim;
39
41 amrex::Real m_rho{1.0};
42
43 amrex::Real m_R{1.0};
44 amrex::Real m_Gamma{1.0};
45 amrex::Real m_delta{0.2};
46 amrex::Real m_dz{2.0};
47 amrex::Vector<int> m_perturbation_modes;
48 amrex::Vector<double> m_perturbation_phases_1;
49 amrex::Vector<double> m_perturbation_phases_2;
50 // amplitude relative to the unperturbed vortex ring diameter
51 amrex::Real m_perturbation_amplitude{1e-4};
52
53 std::string m_vortexringtype{"fatcore"};
54};
55
56struct FatCore
57{
58 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real operator()(
59 const amrex::Real /*r*/,
60 const amrex::Real /*unused*/,
61 const amrex::Real /*z*/,
62 const amrex::Real /*R*/,
63 const amrex::Real /*Gamma*/,
64 const amrex::Real /*unused*/,
65 const amrex::Real /*unused*/,
66 const amrex::Real /*unused*/,
67 const int /*unused*/,
68 const int* /*unused*/,
69 const amrex::Real* /*unused*/,
70 const amrex::Real* /*unused*/) const;
71};
72
74{
75 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real operator()(
76 const amrex::Real /*r*/,
77 const amrex::Real /*theta*/,
78 const amrex::Real /*z*/,
79 const amrex::Real /*R*/,
80 const amrex::Real /*Gamma*/,
81 const amrex::Real /*delta*/,
82 const amrex::Real /*dz*/,
83 const amrex::Real /*perturbation_amplitude*/,
84 const int /*num_modes*/,
85 const int* /*perturbation_modes*/,
86 const amrex::Real* /*perturbation_phases_1*/,
87 const amrex::Real* /*perturbation_phases_2*/) const;
88};
89
90} // namespace amr_wind
91
92#endif /* VortexRing_H */
Definition CFDSim.H:47
Definition Field.H:116
Definition FieldRepo.H:86
Definition VortexRing.H:13
VortexRing(const CFDSim &sim)
Definition VortexRing.cpp:73
const FieldRepo & m_repo
Definition VortexRing.H:36
void initialize_velocity(const VortexRingType &vorticity_theta)
Definition VortexRing.cpp:123
void post_init_actions() override
Definition VortexRing.cpp:107
amrex::Real m_R
Definition VortexRing.H:43
void initialize_fields(int level, const amrex::Geometry &geom) override
Definition VortexRing.cpp:101
void post_advance_work() override
Definition VortexRing.H:29
const CFDSim & m_sim
Definition VortexRing.H:35
void post_regrid_actions() override
Definition VortexRing.H:25
amrex::Real m_dz
Definition VortexRing.H:46
Field & m_velocity
Definition VortexRing.H:37
std::string m_vortexringtype
Definition VortexRing.H:53
amrex::Real m_delta
Definition VortexRing.H:45
amrex::Real m_rho
initial density value
Definition VortexRing.H:41
static std::string identifier()
Definition VortexRing.H:15
Field & m_density
Definition VortexRing.H:38
amrex::Vector< double > m_perturbation_phases_1
Definition VortexRing.H:48
amrex::Vector< int > m_perturbation_modes
Definition VortexRing.H:47
amrex::Vector< double > m_perturbation_phases_2
Definition VortexRing.H:49
amrex::Real m_Gamma
Definition VortexRing.H:44
amrex::Real m_perturbation_amplitude
Definition VortexRing.H:51
void pre_advance_work() override
Definition VortexRing.H:27
~VortexRing() override=default
Definition BCInterface.cpp:7
Definition VortexRing.H:74
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real operator()(const amrex::Real, const amrex::Real, const amrex::Real, const amrex::Real, const amrex::Real, const amrex::Real, const amrex::Real, const amrex::Real, const int, const int *, const amrex::Real *, const amrex::Real *) const
Definition VortexRing.cpp:34
Definition VortexRing.H:57
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real operator()(const amrex::Real, const amrex::Real, const amrex::Real, const amrex::Real, const amrex::Real, const amrex::Real, const amrex::Real, const amrex::Real, const int, const int *, const amrex::Real *, const amrex::Real *) const
Definition VortexRing.cpp:12