walberla::field::VolumetricFlowRateEvaluation< VelocityField_T, Filter_T > Class Template Reference

Detailed Description

template<typename VelocityField_T, typename Filter_T = DefaultEvaluationFilter>
class walberla::field::VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >

Class for evaluating the volumetric flow rate of a simulation.

Volumetric Flow Rate Evaluation

Class for evaluating the volumetric flow rate of a simulation. The flow rate can either just be evaluated or it can be compared with an exact solution in case an exact solution exists and the exact solution is provided via a callback function.

Do not create objects of class VolumetricFlowRateEvaluation directly, better use one of the various 'makeVolumetricFlowRateEvaluation' functions below!

Template parameters:

  • VelocityField_T: the field storing the simulation velocities (must be a field that stores Vector3 values)
  • Filter_T: the type of the evaluation filter (see Evaluation Filter in 'EvaluationFilter.h')

Parameters for setting up and controlling flow rate evaluation:

  • blocks: the block storage
  • fieldId: block data ID of the velocity field
  • filter: the evaluation filter that indicates which cells are processed
  • plot frequency: the plotting interval - used for saving the data to file. If set to '0', no plotting data is created.
  • log frequency: the logging interval - used for logging the data via the Logging singleton. If set to '0', no logging is performed.
  • solution: the solution callback function - must return the exact solution for the flow rate
  • velocity solution: the velocity solution callback function - must return the exact solution for the velocity when called with a position inside the domain
  • filename: the name of the file that stores the data for plotting
  • normalization factor: an optional factor the simulation values and the solution values are multiplied with
  • domain normalization: By default, the surface area required for the calculation of the volumetric flow rate is calculated using the size of the domain as returned by blocks->getDomain(). However, you can overwrite the size of the domain via the domain normalization parameter: This parameter specifies a new, different size for the domain.
  • axis: boolean Vector3 where only one component must be true -> the flow rate through a surface perpendicular to this axis will be calculated
  • surface point: a point that specifies the position of the surface - this point is always relative to the entire domain with [<0,0,0>,<1,1,1>], i.e., all coordinates of this point (x, y, and z) must be in [0;1]
  • required and incompatible selectors

You do not have to specify an evaluation filter! If you do not specify any filter, all cells are processed and no cell is excluded.

If you want to use a flag field as evaluation filter, fitting 'makeVolumetricFlowRateEvaluation' functions already exist. These functions need an additional template parameter FlagField_T and you have to provide the block data ID of the flag field together with a set of flag UIDs that specify which cells need to be processed.

There also exist 'makeVolumetricFlowRateEvaluation' functions that take configuration file data as an additional parameter in order to parse the configuration file for setting up and controlling flow rate evaluation. The configuration file block looks like as follows:

{
plotFrequency [unsigned integer]; // the plot frequency
logFrequency [unsigned integer]; // the log frequency
filename [string]; // the name of the file that stores the data for plotting
normalization [floating point value]; // normalization factor
domainNormalization [Vector3: <real,real,real>]; // domain normalization
axis [Vector3: <bool,bool,bool>]; // axis perpendicular to the flow rate evaluation surface
point [Vector3: <real,real,real>]; // surface point
}

Example:

{
plotFrequency 10;
logFrequency 1000;
filename FlowRate.txt;
axis <true,false,false>;
point <0.5,0.5,0.5>;
}

Note that the shared pointer returned by all 'makeVolumetricFlowRateEvaluation' functions can be captured by a SharedFunctor for immediate registration at a time loop (see field::makeSharedFunctor).

#include <VolumetricFlowRateEvaluation.h>

Public Types

using Solution_T = internal::FlowRateSolution_T
 
using VelocitySolution_T = internal::FlowRateVelocitySolution_T
 

Public Member Functions

 VolumetricFlowRateEvaluation (const weak_ptr< StructuredBlockStorage > &blocks, const ConstBlockDataID &fieldId, const Filter_T &filter, const uint_t plotFrequency, const uint_t logFrequency, const Solution_T &_solution=Solution_T(), const VelocitySolution_T &velocitySolution=VelocitySolution_T(), const Set< SUID > &requiredSelectors=Set< SUID >::emptySet(), const Set< SUID > &incompatibleSelectors=Set< SUID >::emptySet())
 
 VolumetricFlowRateEvaluation (const weak_ptr< StructuredBlockStorage > &blocks, const ConstBlockDataID &fieldId, const uint_t plotFrequency, const uint_t logFrequency, const Solution_T &_solution=Solution_T(), const VelocitySolution_T &velocitySolution=VelocitySolution_T(), const Set< SUID > &requiredSelectors=Set< SUID >::emptySet(), const Set< SUID > &incompatibleSelectors=Set< SUID >::emptySet())
 
void setFilename (const std::string &filename)
 
void setNormalizationFactor (const real_t f)
 
void setDomainNormalization (const Vector3< real_t > &d)
 
void setAxis (const Vector3< bool > &axis)
 
void setSurfacePoint (const Vector3< real_t > &p)
 
real_t flowRate () const
 
real_t velocitySolutionFlowRate () const
 
real_t solution () const
 
void operator() ()
 

Private Attributes

weak_ptr< StructuredBlockStorageblocks_
 
ConstBlockDataID fieldId_
 
Filter_T filter_
 
Solution_T solution_
 
VelocitySolution_T velocitySolution_
 
uint_t executionCounter_
 
uint_t plotFrequency_
 
uint_t logFrequency_
 
std::string filename_
 
real_t normalizationFactor_
 
Vector3< real_tdomainNormalization_
 
Vector3< bool > axis_
 
Vector3< real_tsurfacePoint_
 
real_t flowRate_
 
real_t velocitySolutionFlowRate_
 
Set< SUID > requiredSelectors_
 
Set< SUID > incompatibleSelectors_
 

Member Typedef Documentation

◆ Solution_T

template<typename VelocityField_T , typename Filter_T = DefaultEvaluationFilter>
using walberla::field::VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::Solution_T = internal::FlowRateSolution_T

◆ VelocitySolution_T

template<typename VelocityField_T , typename Filter_T = DefaultEvaluationFilter>
using walberla::field::VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::VelocitySolution_T = internal::FlowRateVelocitySolution_T

Constructor & Destructor Documentation

◆ VolumetricFlowRateEvaluation() [1/2]

template<typename VelocityField_T , typename Filter_T = DefaultEvaluationFilter>
walberla::field::VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::VolumetricFlowRateEvaluation ( const weak_ptr< StructuredBlockStorage > &  blocks,
const ConstBlockDataID fieldId,
const Filter_T &  filter,
const uint_t  plotFrequency,
const uint_t  logFrequency,
const Solution_T _solution = Solution_T(),
const VelocitySolution_T velocitySolution = VelocitySolution_T(),
const Set< SUID > &  requiredSelectors = Set<SUID>::emptySet(),
const Set< SUID > &  incompatibleSelectors = Set<SUID>::emptySet() 
)
inline

◆ VolumetricFlowRateEvaluation() [2/2]

template<typename VelocityField_T , typename Filter_T = DefaultEvaluationFilter>
walberla::field::VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::VolumetricFlowRateEvaluation ( const weak_ptr< StructuredBlockStorage > &  blocks,
const ConstBlockDataID fieldId,
const uint_t  plotFrequency,
const uint_t  logFrequency,
const Solution_T _solution = Solution_T(),
const VelocitySolution_T velocitySolution = VelocitySolution_T(),
const Set< SUID > &  requiredSelectors = Set<SUID>::emptySet(),
const Set< SUID > &  incompatibleSelectors = Set<SUID>::emptySet() 
)
inline

Member Function Documentation

◆ flowRate()

template<typename VelocityField_T , typename Filter_T = DefaultEvaluationFilter>
real_t walberla::field::VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::flowRate ( ) const
inline

◆ operator()()

template<typename VelocityField_T , typename Filter_T >
void walberla::field::VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::operator()

◆ setAxis()

template<typename VelocityField_T , typename Filter_T = DefaultEvaluationFilter>
void walberla::field::VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::setAxis ( const Vector3< bool > &  axis)
inline

◆ setDomainNormalization()

template<typename VelocityField_T , typename Filter_T = DefaultEvaluationFilter>
void walberla::field::VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::setDomainNormalization ( const Vector3< real_t > &  d)
inline

◆ setFilename()

template<typename VelocityField_T , typename Filter_T = DefaultEvaluationFilter>
void walberla::field::VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::setFilename ( const std::string &  filename)
inline

◆ setNormalizationFactor()

template<typename VelocityField_T , typename Filter_T = DefaultEvaluationFilter>
void walberla::field::VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::setNormalizationFactor ( const real_t  f)
inline

◆ setSurfacePoint()

template<typename VelocityField_T , typename Filter_T = DefaultEvaluationFilter>
void walberla::field::VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::setSurfacePoint ( const Vector3< real_t > &  p)
inline

◆ solution()

template<typename VelocityField_T , typename Filter_T = DefaultEvaluationFilter>
real_t walberla::field::VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::solution ( ) const
inline

◆ velocitySolutionFlowRate()

template<typename VelocityField_T , typename Filter_T = DefaultEvaluationFilter>
real_t walberla::field::VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::velocitySolutionFlowRate ( ) const
inline

Member Data Documentation

◆ axis_

template<typename VelocityField_T , typename Filter_T = DefaultEvaluationFilter>
Vector3< bool > walberla::field::VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::axis_
private

◆ blocks_

template<typename VelocityField_T , typename Filter_T = DefaultEvaluationFilter>
weak_ptr< StructuredBlockStorage > walberla::field::VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::blocks_
private

◆ domainNormalization_

template<typename VelocityField_T , typename Filter_T = DefaultEvaluationFilter>
Vector3<real_t> walberla::field::VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::domainNormalization_
private

◆ executionCounter_

template<typename VelocityField_T , typename Filter_T = DefaultEvaluationFilter>
uint_t walberla::field::VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::executionCounter_
private

◆ fieldId_

template<typename VelocityField_T , typename Filter_T = DefaultEvaluationFilter>
ConstBlockDataID walberla::field::VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::fieldId_
private

◆ filename_

template<typename VelocityField_T , typename Filter_T = DefaultEvaluationFilter>
std::string walberla::field::VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::filename_
private

◆ filter_

template<typename VelocityField_T , typename Filter_T = DefaultEvaluationFilter>
Filter_T walberla::field::VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::filter_
private

◆ flowRate_

template<typename VelocityField_T , typename Filter_T = DefaultEvaluationFilter>
real_t walberla::field::VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::flowRate_
private

◆ incompatibleSelectors_

template<typename VelocityField_T , typename Filter_T = DefaultEvaluationFilter>
Set<SUID> walberla::field::VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::incompatibleSelectors_
private

◆ logFrequency_

template<typename VelocityField_T , typename Filter_T = DefaultEvaluationFilter>
uint_t walberla::field::VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::logFrequency_
private

◆ normalizationFactor_

template<typename VelocityField_T , typename Filter_T = DefaultEvaluationFilter>
real_t walberla::field::VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::normalizationFactor_
private

◆ plotFrequency_

template<typename VelocityField_T , typename Filter_T = DefaultEvaluationFilter>
uint_t walberla::field::VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::plotFrequency_
private

◆ requiredSelectors_

template<typename VelocityField_T , typename Filter_T = DefaultEvaluationFilter>
Set<SUID> walberla::field::VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::requiredSelectors_
private

◆ solution_

template<typename VelocityField_T , typename Filter_T = DefaultEvaluationFilter>
Solution_T walberla::field::VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::solution_
private

◆ surfacePoint_

template<typename VelocityField_T , typename Filter_T = DefaultEvaluationFilter>
Vector3<real_t> walberla::field::VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::surfacePoint_
private

◆ velocitySolution_

template<typename VelocityField_T , typename Filter_T = DefaultEvaluationFilter>
VelocitySolution_T walberla::field::VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::velocitySolution_
private

◆ velocitySolutionFlowRate_

template<typename VelocityField_T , typename Filter_T = DefaultEvaluationFilter>
real_t walberla::field::VolumetricFlowRateEvaluation< VelocityField_T, Filter_T >::velocitySolutionFlowRate_
private

The documentation for this class was generated from the following file:
VolumetricFlowRateEvaluation(const weak_ptr< StructuredBlockStorage > &blocks, const ConstBlockDataID &fieldId, const Filter_T &filter, const uint_t plotFrequency, const uint_t logFrequency, const Solution_T &_solution=Solution_T(), const VelocitySolution_T &velocitySolution=VelocitySolution_T(), const Set< SUID > &requiredSelectors=Set< SUID >::emptySet(), const Set< SUID > &incompatibleSelectors=Set< SUID >::emptySet())
Definition: VolumetricFlowRateEvaluation.h:156