WaveEnergy Class Reference
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
|
#include <WaveEnergy.H>
Public Member Functions | |
WaveEnergy (CFDSim &, std::string) | |
~WaveEnergy () override | |
void | pre_init_actions () override |
Perform actions before mesh is created. | |
void | initialize () override |
Read user inputs and get information needed for calculations. | |
void | post_advance_work () override |
Integrate energy components and output to file. | |
void | post_regrid_actions () override |
amrex::Real | calculate_kinetic_energy () |
Calculate the sum of stated energy in liquid phase. | |
amrex::Real | calculate_potential_energy () |
void | wave_energy (amrex::Real &ke, amrex::Real &pe) const |
Output private variables that store energy measurements. | |
Static Public Member Functions | |
static std::string | identifier () |
Private Member Functions | |
virtual void | prepare_ascii_file () |
prepare ASCII file and directory | |
virtual void | write_ascii () |
Output sampled data in ASCII format. | |
Private Attributes | |
amrex::Real | m_wave_kinetic_energy {0.0} |
store the total wave energy | |
amrex::Real | m_wave_potential_energy {0.0} |
CFDSim & | m_sim |
Reference to the CFD sim. | |
const std::string | m_label |
const Field & | m_velocity |
reference to velocity | |
const Field & | m_vof |
reference to vof | |
amrex::Vector< amrex::Real > | m_gravity {0.0, 0.0, -9.81} |
gravity vector | |
amrex::Real | m_pe_off = 0.0 |
offset for potential energy calculation | |
amrex::Real | m_escl = 1.0 |
volumetric scaling for each energy | |
std::string | m_out_fname |
filename for ASCII output | |
int | m_out_freq {10} |
Frequency of data sampling and output. | |
int | m_width {22} |
width in ASCII output | |
int | m_precision {12} |
precision in ASCII output | |
Detailed Description
wave energy object
A concrete implementation of the post-processing interface that deals with integrating total wave energy. This routine calculates the kinetic energy (KE) and potential energy (PE) according to the following definitions. It calculates the correct potential energy offset, assuming an equilibrium water level of 0 unless specified otherwise by an input parameter. It also assumes the traditional coordinate system, where interface height/depth is in z.
Integral definitions (not output) KE_i = 0.5 * (Integral over liquid phase) \rho * u^2 dV PE_i = (Integral over liquid phase) \rho * g * z_liq dV (offset for PE would be 1/2 * Lx * Ly * \rho_liq * g * depth^2)
Normalized definitions (which are output) in form of avg kinematic energy KE = KE_i / (d * \rho_liq * Lx * Ly) PE = PE_i / (d * \rho_liq * Lx * Ly) + 1/2 * g * depth
Constructor & Destructor Documentation
◆ WaveEnergy()
amr_wind::wave_energy::WaveEnergy::WaveEnergy | ( | CFDSim & | sim, |
std::string | label ) |
◆ ~WaveEnergy()
|
overridedefault |
Member Function Documentation
◆ calculate_kinetic_energy()
amrex::Real amr_wind::wave_energy::WaveEnergy::calculate_kinetic_energy | ( | ) |
Calculate the sum of stated energy in liquid phase.
◆ calculate_potential_energy()
amrex::Real amr_wind::wave_energy::WaveEnergy::calculate_potential_energy | ( | ) |
◆ identifier()
|
inlinestatic |
◆ initialize()
|
override |
Read user inputs and get information needed for calculations.
◆ post_advance_work()
|
override |
Integrate energy components and output to file.
◆ post_regrid_actions()
|
inlineoverride |
◆ pre_init_actions()
|
inlineoverride |
Perform actions before mesh is created.
◆ prepare_ascii_file()
|
privatevirtual |
prepare ASCII file and directory
◆ wave_energy()
|
inline |
Output private variables that store energy measurements.
◆ write_ascii()
|
privatevirtual |
Output sampled data in ASCII format.
Member Data Documentation
◆ m_escl
|
private |
volumetric scaling for each energy
◆ m_gravity
|
private |
gravity vector
◆ m_label
|
private |
Name of this sampling object.
The label is used to read user inputs from file and is also used for naming files directories depending on the output format.
◆ m_out_fname
|
private |
filename for ASCII output
◆ m_out_freq
|
private |
Frequency of data sampling and output.
◆ m_pe_off
|
private |
offset for potential energy calculation
◆ m_precision
|
private |
precision in ASCII output
◆ m_sim
|
private |
Reference to the CFD sim.
◆ m_velocity
|
private |
reference to velocity
◆ m_vof
|
private |
reference to vof
◆ m_wave_kinetic_energy
|
private |
store the total wave energy
◆ m_wave_potential_energy
|
private |
◆ m_width
|
private |
width in ASCII output
The documentation for this class was generated from the following files:
- /home/runner/work/amr-wind/amr-wind/amr-wind/utilities/sampling/WaveEnergy.H
- /home/runner/work/amr-wind/amr-wind/amr-wind/utilities/sampling/WaveEnergy.cpp
Generated by 1.12.0