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

AMR-Wind API: /home/runner/work/amr-wind/amr-wind/amr-wind/physics/ConvectingTaylorVortex.H Source File
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
ConvectingTaylorVortex.H
Go to the documentation of this file.
1#ifndef ConvectingTaylorVortex_H
2#define ConvectingTaylorVortex_H
3
6#include "amr-wind/CFDSim.H"
7
8namespace amr_wind::ctv {
9
10namespace {
11struct UExact
12{
13 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real operator()(
14 const amrex::Real /*u0*/,
15 const amrex::Real /*v0*/,
16 const amrex::Real /*omega*/,
17 const amrex::Real /*x*/,
18 const amrex::Real /*y*/,
19 const amrex::Real /*t*/) const;
20 const int m_comp{0};
21};
22
23struct VExact
24{
25 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real operator()(
26 const amrex::Real /*u0*/,
27 const amrex::Real /*v0*/,
28 const amrex::Real /*omega*/,
29 const amrex::Real /*x*/,
30 const amrex::Real /*y*/,
31 const amrex::Real /*t*/) const;
32 const int m_comp{1};
33};
34
35struct WExact
36{
37 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real operator()(
38 const amrex::Real /*unused*/,
39 const amrex::Real /*unused*/,
40 const amrex::Real /*unused*/,
41 const amrex::Real /*unused*/,
42 const amrex::Real /*unused*/,
43 const amrex::Real /*unused*/) const;
44 const int m_comp{2};
45};
46
47struct GpxExact
48{
49 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real operator()(
50 const amrex::Real /*u0*/,
51 const amrex::Real /*unused*/,
52 const amrex::Real /*omega*/,
53 const amrex::Real /*x*/,
54 const amrex::Real /*unused*/,
55 const amrex::Real /*t*/) const;
56 const int m_comp{0};
57};
58
59struct GpyExact
60{
61 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real operator()(
62 const amrex::Real /*unused*/,
63 const amrex::Real /*v0*/,
64 const amrex::Real /*omega*/,
65 const amrex::Real /*unused*/,
66 const amrex::Real /*y*/,
67 const amrex::Real /*t*/) const;
68 const int m_comp{1};
69};
70
71struct GpzExact
72{
73 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real operator()(
74 const amrex::Real /*unused*/,
75 const amrex::Real /*unused*/,
76 const amrex::Real /*unused*/,
77 const amrex::Real /*unused*/,
78 const amrex::Real /*unused*/,
79 const amrex::Real /*unused*/) const;
80 const int m_comp{2};
81};
82
83} // namespace
84
88class ConvectingTaylorVortex : public Physics::Register<ConvectingTaylorVortex>
89{
90public:
91 static std::string identifier() { return "ConvectingTaylorVortex"; }
92
93 explicit ConvectingTaylorVortex(const CFDSim& sim);
94
95 ~ConvectingTaylorVortex() override = default;
96
97 void initialize_fields(int level, const amrex::Geometry& geom) override;
98
99 template <typename T>
100 amrex::Real compute_error(const Field& /*field*/);
101
102 void post_init_actions() override;
103
104 void post_regrid_actions() override {}
105
106 void pre_advance_work() override {}
107
108 void post_advance_work() override;
109
110 amrex::Real get_u0() const { return m_u0; }
111
112 amrex::Real get_v0() const { return m_v0; }
113
114 amrex::Real get_omega() const { return m_omega; }
115
116private:
120 const amrex::AmrCore& m_mesh;
121
125
126 void output_error();
127
129 amrex::Real m_rho{1.0};
130
132 amrex::Real m_u0{1.0};
133
135 amrex::Real m_v0{1.0};
136
138 amrex::Real m_omega;
139
141 const int m_w{18};
142
144 std::string m_output_fname{"ctv.log"};
145
147 bool m_mesh_mapping{false};
148};
149} // namespace amr_wind::ctv
150
151#endif /* ConvectingTaylorVortex_H */
const int m_comp
Definition BurggrafFlow.H:16
Definition CFDSim.H:47
Definition Field.H:116
Definition FieldRepo.H:86
Definition SimTime.H:30
Definition ConvectingTaylorVortex.H:89
~ConvectingTaylorVortex() override=default
void initialize_fields(int level, const amrex::Geometry &geom) override
Definition ConvectingTaylorVortex.cpp:127
amrex::Real m_rho
initial density value
Definition ConvectingTaylorVortex.H:129
void pre_advance_work() override
Definition ConvectingTaylorVortex.H:106
const FieldRepo & m_repo
Definition ConvectingTaylorVortex.H:119
void output_error()
Definition ConvectingTaylorVortex.cpp:306
bool m_activate_pressure
Definition ConvectingTaylorVortex.H:146
amrex::Real get_u0() const
Definition ConvectingTaylorVortex.H:110
ConvectingTaylorVortex(const CFDSim &sim)
Definition ConvectingTaylorVortex.cpp:89
amrex::Real get_v0() const
Definition ConvectingTaylorVortex.H:112
Field & m_velocity
Definition ConvectingTaylorVortex.H:122
amrex::Real m_omega
damping
Definition ConvectingTaylorVortex.H:138
void post_advance_work() override
Definition ConvectingTaylorVortex.cpp:330
Field & m_density
Definition ConvectingTaylorVortex.H:124
const int m_w
output precision
Definition ConvectingTaylorVortex.H:141
static std::string identifier()
Definition ConvectingTaylorVortex.H:91
amrex::Real get_omega() const
Definition ConvectingTaylorVortex.H:114
void post_init_actions() override
Definition ConvectingTaylorVortex.cpp:328
amrex::Real compute_error(const Field &)
Definition ConvectingTaylorVortex.cpp:209
const amr_wind::CFDSim & m_sim
Definition ConvectingTaylorVortex.H:118
const amr_wind::SimTime & m_time
Definition ConvectingTaylorVortex.H:117
void post_regrid_actions() override
Definition ConvectingTaylorVortex.H:104
Field & m_gradp
Definition ConvectingTaylorVortex.H:123
amrex::Real m_u0
mean x-velocity value
Definition ConvectingTaylorVortex.H:132
bool m_mesh_mapping
Definition ConvectingTaylorVortex.H:147
const amrex::AmrCore & m_mesh
Definition ConvectingTaylorVortex.H:120
amrex::Real m_v0
mean y-velocity value
Definition ConvectingTaylorVortex.H:135
std::string m_output_fname
error log file
Definition ConvectingTaylorVortex.H:144
Definition ConvectingTaylorVortex.cpp:9