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

AMR-Wind API: /home/runner/work/amr-wind/amr-wind/amr-wind/utilities/sampling/Enstrophy.H Source File
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
Enstrophy.H
Go to the documentation of this file.
1#ifndef ENSTROPHY_H
2#define ENSTROPHY_H
3
4#include "amr-wind/CFDSim.H"
6
7namespace amr_wind::enstrophy {
8
16class Enstrophy : public PostProcessBase::Register<Enstrophy>
17{
18public:
19 static std::string identifier() { return "Enstrophy"; }
20
21 Enstrophy(CFDSim& /*sim*/, std::string /*label*/);
22
23 ~Enstrophy() override;
24
26 void pre_init_actions() override {}
27
29 void initialize() override;
30
32 void post_advance_work() override;
33
34 void post_regrid_actions() override {}
35
37 amrex::Real calculate_enstrophy();
38
39private:
41 void prepare_ascii_file();
42
44 void write_ascii();
45
47 amrex::Real m_total_enstrophy{0.0};
48
51
57 const std::string m_label;
58
63
65 std::string m_out_fname;
66
68 int m_out_freq{10};
69
71 int m_width{22};
72
74 int m_precision{12};
75};
76
77} // namespace amr_wind::enstrophy
78
79#endif /* ENSTROPHY_H */
Definition CFDSim.H:47
Definition Field.H:116
Definition Enstrophy.H:17
void write_ascii()
Output sampled data in ASCII format.
Definition Enstrophy.cpp:122
void pre_init_actions() override
Perform actions before mesh is created.
Definition Enstrophy.H:26
const Field & m_density
reference to density
Definition Enstrophy.H:62
const Field & m_velocity
reference to velocity
Definition Enstrophy.H:60
int m_width
width in ASCII output
Definition Enstrophy.H:71
const std::string m_label
Definition Enstrophy.H:57
amrex::Real calculate_enstrophy()
calculate the L2 norm of a given field and component
Definition Enstrophy.cpp:30
void post_regrid_actions() override
Definition Enstrophy.H:34
void prepare_ascii_file()
prepare ASCII file and directory
Definition Enstrophy.cpp:105
Enstrophy(CFDSim &, std::string)
Definition Enstrophy.cpp:12
void post_advance_work() override
Interpolate fields at a given timestep and output to disk.
Definition Enstrophy.cpp:90
static std::string identifier()
Definition Enstrophy.H:19
void initialize() override
Read user inputs and create the different data probe instances.
Definition Enstrophy.cpp:21
int m_precision
precision in ASCII output
Definition Enstrophy.H:74
int m_out_freq
Frequency of data sampling and output.
Definition Enstrophy.H:68
CFDSim & m_sim
Reference to the CFD sim.
Definition Enstrophy.H:50
amrex::Real m_total_enstrophy
store the total enstrophy
Definition Enstrophy.H:47
std::string m_out_fname
filename for ASCII output
Definition Enstrophy.H:65
Definition Enstrophy.cpp:10