/home/runner/work/amr-wind/amr-wind/amr-wind/utilities/DerivedQtyDefs.H Source File

AMR-Wind API: /home/runner/work/amr-wind/amr-wind/amr-wind/utilities/DerivedQtyDefs.H Source File
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
DerivedQtyDefs.H
Go to the documentation of this file.
1#ifndef DERIVEDQTYDEFS_H
2#define DERIVEDQTYDEFS_H
3
5
6namespace amr_wind::derived {
7struct VorticityMag : public DerivedQty::Register<VorticityMag>
8{
9 static constexpr int ncomp = 1;
10 static std::string identifier() { return "mag_vorticity"; }
11
12 VorticityMag(const FieldRepo& repo, const std::vector<std::string>& args);
13
14 std::string name() const override { return identifier(); }
15
16 int num_comp() const override { return ncomp; }
17
18 void operator()(ScratchField& fld, const int scomp = 0) const override;
19
20private:
21 const Field& m_vel;
22};
23
24struct QCriterion : public DerivedQty::Register<QCriterion>
25{
26 static constexpr int ncomp = 1;
27 static std::string identifier() { return "q_criterion"; }
28
29 QCriterion(const FieldRepo& repo, const std::vector<std::string>& args);
30
31 std::string name() const override { return identifier(); }
32
33 int num_comp() const override { return ncomp; }
34
35 void operator()(ScratchField& fld, const int scomp = 0) const override;
36
37private:
38 const Field& m_vel;
39};
40
41struct QCriterionNondim : public DerivedQty::Register<QCriterionNondim>
42{
43 static constexpr int ncomp = 1;
44 static std::string identifier() { return "q_criterion_nondim"; }
45
47 const FieldRepo& repo, const std::vector<std::string>& args);
48
49 std::string name() const override { return identifier(); }
50
51 int num_comp() const override { return ncomp; }
52
53 void operator()(ScratchField& fld, const int scomp = 0) const override;
54
55private:
56 const Field& m_vel;
57};
58
59struct StrainRateMag : public DerivedQty::Register<StrainRateMag>
60{
61 static constexpr int ncomp = 1;
62 static std::string identifier() { return "mag_strainrate"; }
63
64 StrainRateMag(const FieldRepo& repo, const std::vector<std::string>& args);
65
66 std::string name() const override { return identifier(); }
67
68 int num_comp() const override { return ncomp; }
69
70 void operator()(ScratchField& fld, const int scomp = 0) const override;
71
72private:
73 const Field& m_vel;
74};
75
76struct Gradient : public DerivedQty::Register<Gradient>
77{
78 static std::string identifier() { return "grad"; }
79
80 Gradient(const FieldRepo& repo, const std::vector<std::string>& args);
81
82 std::string name() const override { return "grad_" + m_phi->name(); }
83
84 int num_comp() const override { return AMREX_SPACEDIM * m_phi->num_comp(); }
85
86 void operator()(ScratchField& fld, const int scomp = 0) const override;
87
88private:
89 const Field* m_phi;
90};
91
92struct Divergence : public DerivedQty::Register<Divergence>
93{
94 static std::string identifier() { return "div"; }
95
96 Divergence(const FieldRepo& repo, const std::vector<std::string>& args);
97
98 std::string name() const override { return "div_" + m_phi->name(); }
99
100 int num_comp() const override { return 1; }
101
102 void operator()(ScratchField& fld, const int scomp = 0) const override;
103
104private:
105 const Field* m_phi;
106};
107
108struct Laplacian : public DerivedQty::Register<Laplacian>
109{
110 static constexpr int ncomp = 1;
111 static std::string identifier() { return "laplacian"; }
112
113 Laplacian(const FieldRepo& repo, const std::vector<std::string>& args);
114
115 std::string name() const override { return "laplacian_" + m_phi->name(); }
116
117 int num_comp() const override { return ncomp; }
118
119 void operator()(ScratchField& fld, const int scomp = 0) const override;
120
121private:
122 const Field* m_phi;
123};
124
125struct FieldComponents : public DerivedQty::Register<FieldComponents>
126{
127 static std::string identifier() { return "components"; }
128
130 const FieldRepo& repo, const std::vector<std::string>& args);
131
132 std::string name() const override { return m_fld->name(); }
133
134 int num_comp() const override { return m_ncomp; }
135
136 void var_names(amrex::Vector<std::string>& plt_var_names) override;
137
138 void operator()(ScratchField& fld, const int scomp = 0) const override;
139
140private:
141 const Field* m_fld;
142 amrex::Vector<int> m_comp;
143 int m_ncomp{0};
144};
145
146} // namespace amr_wind::derived
147
148#endif /* DERIVEDQTYDEFS_H */
Definition Field.H:116
const std::string & name() const
Name of this field (including state information)
Definition Field.H:125
int num_comp() const
Number of components for this field.
Definition Field.H:134
Definition FieldRepo.H:86
Definition ScratchField.H:30
Definition DerivedQtyDefs.cpp:6
Definition DerivedQtyDefs.H:93
void operator()(ScratchField &fld, const int scomp=0) const override
Definition DerivedQtyDefs.cpp:90
std::string name() const override
Definition DerivedQtyDefs.H:98
static std::string identifier()
Definition DerivedQtyDefs.H:94
Divergence(const FieldRepo &repo, const std::vector< std::string > &args)
Definition DerivedQtyDefs.cpp:82
int num_comp() const override
Definition DerivedQtyDefs.H:100
const Field * m_phi
Definition DerivedQtyDefs.H:105
Definition DerivedQtyDefs.H:126
int num_comp() const override
Definition DerivedQtyDefs.H:134
const Field * m_fld
Definition DerivedQtyDefs.H:141
std::string name() const override
Definition DerivedQtyDefs.H:132
void operator()(ScratchField &fld, const int scomp=0) const override
Definition DerivedQtyDefs.cpp:140
void var_names(amrex::Vector< std::string > &plt_var_names) override
Definition DerivedQtyDefs.cpp:131
int m_ncomp
Definition DerivedQtyDefs.H:143
static std::string identifier()
Definition DerivedQtyDefs.H:127
amrex::Vector< int > m_comp
Definition DerivedQtyDefs.H:142
FieldComponents(const FieldRepo &repo, const std::vector< std::string > &args)
Definition DerivedQtyDefs.cpp:114
Definition DerivedQtyDefs.H:77
const Field * m_phi
Definition DerivedQtyDefs.H:89
int num_comp() const override
Definition DerivedQtyDefs.H:84
static std::string identifier()
Definition DerivedQtyDefs.H:78
void operator()(ScratchField &fld, const int scomp=0) const override
Definition DerivedQtyDefs.cpp:74
Gradient(const FieldRepo &repo, const std::vector< std::string > &args)
Definition DerivedQtyDefs.cpp:68
std::string name() const override
Definition DerivedQtyDefs.H:82
Definition DerivedQtyDefs.H:109
static std::string identifier()
Definition DerivedQtyDefs.H:111
std::string name() const override
Definition DerivedQtyDefs.H:115
void operator()(ScratchField &fld, const int scomp=0) const override
Definition DerivedQtyDefs.cpp:106
const Field * m_phi
Definition DerivedQtyDefs.H:122
Laplacian(const FieldRepo &repo, const std::vector< std::string > &args)
Definition DerivedQtyDefs.cpp:98
int num_comp() const override
Definition DerivedQtyDefs.H:117
static constexpr int ncomp
Definition DerivedQtyDefs.H:110
Definition DerivedQtyDefs.H:25
std::string name() const override
Definition DerivedQtyDefs.H:31
int num_comp() const override
Definition DerivedQtyDefs.H:33
void operator()(ScratchField &fld, const int scomp=0) const override
Definition DerivedQtyDefs.cpp:30
static constexpr int ncomp
Definition DerivedQtyDefs.H:26
QCriterion(const FieldRepo &repo, const std::vector< std::string > &args)
Definition DerivedQtyDefs.cpp:23
static std::string identifier()
Definition DerivedQtyDefs.H:27
const Field & m_vel
Definition DerivedQtyDefs.H:38
Definition DerivedQtyDefs.H:42
static std::string identifier()
Definition DerivedQtyDefs.H:44
static constexpr int ncomp
Definition DerivedQtyDefs.H:43
void operator()(ScratchField &fld, const int scomp=0) const override
Definition DerivedQtyDefs.cpp:45
int num_comp() const override
Definition DerivedQtyDefs.H:51
const Field & m_vel
Definition DerivedQtyDefs.H:56
QCriterionNondim(const FieldRepo &repo, const std::vector< std::string > &args)
Definition DerivedQtyDefs.cpp:38
std::string name() const override
Definition DerivedQtyDefs.H:49
Definition DerivedQtyDefs.H:60
void operator()(ScratchField &fld, const int scomp=0) const override
Definition DerivedQtyDefs.cpp:60
std::string name() const override
Definition DerivedQtyDefs.H:66
static std::string identifier()
Definition DerivedQtyDefs.H:62
static constexpr int ncomp
Definition DerivedQtyDefs.H:61
int num_comp() const override
Definition DerivedQtyDefs.H:68
StrainRateMag(const FieldRepo &repo, const std::vector< std::string > &args)
Definition DerivedQtyDefs.cpp:53
const Field & m_vel
Definition DerivedQtyDefs.H:73
Definition DerivedQtyDefs.H:8
std::string name() const override
Definition DerivedQtyDefs.H:14
void operator()(ScratchField &fld, const int scomp=0) const override
Definition DerivedQtyDefs.cpp:15
static constexpr int ncomp
Definition DerivedQtyDefs.H:9
VorticityMag(const FieldRepo &repo, const std::vector< std::string > &args)
Definition DerivedQtyDefs.cpp:8
static std::string identifier()
Definition DerivedQtyDefs.H:10
const Field & m_vel
Definition DerivedQtyDefs.H:21
int num_comp() const override
Definition DerivedQtyDefs.H:16