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

AMR-Wind API: /home/runner/work/amr-wind/amr-wind/amr-wind/utilities/sampling/KineticEnergy.H Source File
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
KineticEnergy.H
Go to the documentation of this file.
1#ifndef KINETICENERGY_H
2#define KINETICENERGY_H
3
4#include "amr-wind/CFDSim.H"
6
8
16class KineticEnergy : public PostProcessBase::Register<KineticEnergy>
17{
18public:
19 static std::string identifier() { return "KineticEnergy"; }
20
21 KineticEnergy(CFDSim& /*sim*/, std::string /*label*/);
22
23 ~KineticEnergy() 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_kinetic_energy();
38
39private:
41 void prepare_ascii_file();
42
44 void write_ascii();
45
47 amrex::Real m_total_kinetic_energy{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::kinetic_energy
78
79#endif /* KINETICENERGY_H */
Definition CFDSim.H:47
Definition Field.H:116
Definition KineticEnergy.H:17
CFDSim & m_sim
Reference to the CFD sim.
Definition KineticEnergy.H:50
int m_out_freq
Frequency of data sampling and output.
Definition KineticEnergy.H:68
amrex::Real calculate_kinetic_energy()
calculate the L2 norm of a given field and component
Definition KineticEnergy.cpp:29
void write_ascii()
Output sampled data in ASCII format.
Definition KineticEnergy.cpp:121
const Field & m_density
reference to density
Definition KineticEnergy.H:62
KineticEnergy(CFDSim &, std::string)
Definition KineticEnergy.cpp:11
const std::string m_label
Definition KineticEnergy.H:57
std::string m_out_fname
filename for ASCII output
Definition KineticEnergy.H:65
void prepare_ascii_file()
prepare ASCII file and directory
Definition KineticEnergy.cpp:104
void pre_init_actions() override
Perform actions before mesh is created.
Definition KineticEnergy.H:26
static std::string identifier()
Definition KineticEnergy.H:19
int m_width
width in ASCII output
Definition KineticEnergy.H:71
int m_precision
precision in ASCII output
Definition KineticEnergy.H:74
void post_regrid_actions() override
Definition KineticEnergy.H:34
amrex::Real m_total_kinetic_energy
store the total kinetic energy
Definition KineticEnergy.H:47
const Field & m_velocity
reference to velocity
Definition KineticEnergy.H:60
void initialize() override
Read user inputs and create the different data probe instances.
Definition KineticEnergy.cpp:20
void post_advance_work() override
Interpolate fields at a given timestep and output to disk.
Definition KineticEnergy.cpp:89
Definition KineticEnergy.cpp:9