WaveEnergy Class Reference

AMR-Wind API: amr_wind::wave_energy::WaveEnergy Class Reference
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches

#include <WaveEnergy.H>

Inheritance diagram for amr_wind::wave_energy::WaveEnergy:
[legend]
Collaboration diagram for amr_wind::wave_energy::WaveEnergy:
[legend]

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}
 
CFDSimm_sim
 Reference to the CFD sim.
 
const std::string m_label
 
const Fieldm_velocity
 reference to velocity
 
const Fieldm_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()

amr_wind::wave_energy::WaveEnergy::~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()

static std::string amr_wind::wave_energy::WaveEnergy::identifier ( )
inlinestatic

◆ initialize()

void amr_wind::wave_energy::WaveEnergy::initialize ( )
override

Read user inputs and get information needed for calculations.

◆ post_advance_work()

void amr_wind::wave_energy::WaveEnergy::post_advance_work ( )
override

Integrate energy components and output to file.

◆ post_regrid_actions()

void amr_wind::wave_energy::WaveEnergy::post_regrid_actions ( )
inlineoverride

◆ pre_init_actions()

void amr_wind::wave_energy::WaveEnergy::pre_init_actions ( )
inlineoverride

Perform actions before mesh is created.

◆ prepare_ascii_file()

void amr_wind::wave_energy::WaveEnergy::prepare_ascii_file ( )
privatevirtual

prepare ASCII file and directory

◆ wave_energy()

void amr_wind::wave_energy::WaveEnergy::wave_energy ( amrex::Real & ke,
amrex::Real & pe ) const
inline

Output private variables that store energy measurements.

◆ write_ascii()

void amr_wind::wave_energy::WaveEnergy::write_ascii ( )
privatevirtual

Output sampled data in ASCII format.

Member Data Documentation

◆ m_escl

amrex::Real amr_wind::wave_energy::WaveEnergy::m_escl = 1.0
private

volumetric scaling for each energy

◆ m_gravity

amrex::Vector<amrex::Real> amr_wind::wave_energy::WaveEnergy::m_gravity {0.0, 0.0, -9.81}
private

gravity vector

◆ m_label

const std::string amr_wind::wave_energy::WaveEnergy::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

std::string amr_wind::wave_energy::WaveEnergy::m_out_fname
private

filename for ASCII output

◆ m_out_freq

int amr_wind::wave_energy::WaveEnergy::m_out_freq {10}
private

Frequency of data sampling and output.

◆ m_pe_off

amrex::Real amr_wind::wave_energy::WaveEnergy::m_pe_off = 0.0
private

offset for potential energy calculation

◆ m_precision

int amr_wind::wave_energy::WaveEnergy::m_precision {12}
private

precision in ASCII output

◆ m_sim

CFDSim& amr_wind::wave_energy::WaveEnergy::m_sim
private

Reference to the CFD sim.

◆ m_velocity

const Field& amr_wind::wave_energy::WaveEnergy::m_velocity
private

reference to velocity

◆ m_vof

const Field& amr_wind::wave_energy::WaveEnergy::m_vof
private

reference to vof

◆ m_wave_kinetic_energy

amrex::Real amr_wind::wave_energy::WaveEnergy::m_wave_kinetic_energy {0.0}
private

store the total wave energy

◆ m_wave_potential_energy

amrex::Real amr_wind::wave_energy::WaveEnergy::m_wave_potential_energy {0.0}
private

◆ m_width

int amr_wind::wave_energy::WaveEnergy::m_width {22}
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