SecondMomentAveraging Class Reference

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

#include <SecondMomentAveraging.H>

Collaboration diagram for amr_wind::SecondMomentAveraging:
[legend]

Public Member Functions

 SecondMomentAveraging (FieldPlaneAveraging &pa1, FieldPlaneAveraging &pa2)
 
 ~SecondMomentAveraging ()=default
 
void operator() ()
 
amrex::Real line_average_interpolated (amrex::Real x, int comp1, int comp2) const
 
amrex::Real line_average_interpolated (amrex::Real x, int comp) const
 
amrex::Real line_average_cell (int ind, int comp1, int comp2) const
 
amrex::Real line_average_cell (int ind, int comp) const
 
const amrex::Vector< amrex::Real > & line_moment ()
 
void line_moment (int comp, amrex::Vector< amrex::Real > &l_vec)
 
void output_line_average_ascii (const std::string &filename, int step, amrex::Real time)
 
void output_line_average_ascii (int step, amrex::Real time)
 
void set_precision (int p)
 
template<typename IndexSelector >
void compute_average (const IndexSelector &idxOp, const amrex::MultiFab &mfab1, const amrex::MultiFab &mfab2)
 

Private Attributes

int m_num_moments
 
amrex::Vector< amrex::Real > m_second_moments_line
 
int m_precision = 4
 
int m_last_updated_index = -1
 
FieldPlaneAveragingm_plane_average1
 
FieldPlaneAveragingm_plane_average2
 

Detailed Description

Compute second moments for two variables

Computes second-moment statistics for any two variables. For example, if the velocity field is provided, then it computes the following quantities:

\(\langle u'u'\rangle, \langle u'v'\rangle, \langle u'w'\rangle, \ldots\)

Alternately, using velocity (vector) and a scalar (e.g., temperature \(\theta\)), would compute:

\(\langle u'\theta ' \rangle, \langle v' \theta ' \rangle, \langle w' \theta ' \rangle\)

Constructor & Destructor Documentation

◆ SecondMomentAveraging()

amr_wind::SecondMomentAveraging::SecondMomentAveraging ( FieldPlaneAveraging & pa1,
FieldPlaneAveraging & pa2 )

◆ ~SecondMomentAveraging()

amr_wind::SecondMomentAveraging::~SecondMomentAveraging ( )
default

Member Function Documentation

◆ compute_average()

template<typename IndexSelector >
void amr_wind::SecondMomentAveraging::compute_average ( const IndexSelector & idxOp,
const amrex::MultiFab & mfab1,
const amrex::MultiFab & mfab2 )

fill line storage with averages

◆ line_average_cell() [1/2]

amrex::Real amr_wind::SecondMomentAveraging::line_average_cell ( int ind,
int comp ) const

evaluate second moment at specific cell for each component

◆ line_average_cell() [2/2]

amrex::Real amr_wind::SecondMomentAveraging::line_average_cell ( int ind,
int comp1,
int comp2 ) const

evaluate second moment at specific cell for both components

◆ line_average_interpolated() [1/2]

amrex::Real amr_wind::SecondMomentAveraging::line_average_interpolated ( amrex::Real x,
int comp ) const

evaluate second moment at specific location for each component

◆ line_average_interpolated() [2/2]

amrex::Real amr_wind::SecondMomentAveraging::line_average_interpolated ( amrex::Real x,
int comp1,
int comp2 ) const

evaluate second moment at specific location for both components

◆ line_moment() [1/2]

const amrex::Vector< amrex::Real > & amr_wind::SecondMomentAveraging::line_moment ( )
inline

◆ line_moment() [2/2]

void amr_wind::SecondMomentAveraging::line_moment ( int comp,
amrex::Vector< amrex::Real > & l_vec )

◆ operator()()

void amr_wind::SecondMomentAveraging::operator() ( )

◆ output_line_average_ascii() [1/2]

void amr_wind::SecondMomentAveraging::output_line_average_ascii ( const std::string & filename,
int step,
amrex::Real time )

◆ output_line_average_ascii() [2/2]

void amr_wind::SecondMomentAveraging::output_line_average_ascii ( int step,
amrex::Real time )

◆ set_precision()

void amr_wind::SecondMomentAveraging::set_precision ( int p)
inline

change precision of text file output

Member Data Documentation

◆ m_last_updated_index

int amr_wind::SecondMomentAveraging::m_last_updated_index = -1
private

precision for line plot text file

◆ m_num_moments

int amr_wind::SecondMomentAveraging::m_num_moments
private

◆ m_plane_average1

FieldPlaneAveraging& amr_wind::SecondMomentAveraging::m_plane_average1
private

keep track of the last time index that the operator was called

◆ m_plane_average2

FieldPlaneAveraging& amr_wind::SecondMomentAveraging::m_plane_average2
private

◆ m_precision

int amr_wind::SecondMomentAveraging::m_precision = 4
private

line storage for fluctuations

◆ m_second_moments_line

amrex::Vector<amrex::Real> amr_wind::SecondMomentAveraging::m_second_moments_line
private

outer product of components


The documentation for this class was generated from the following files: