Cardinal
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
NekVolumetricSource Class Reference

#include <NekVolumetricSource.h>

Inheritance diagram for NekVolumetricSource:
[legend]

Public Member Functions

 NekVolumetricSource (const InputParameters &parameters)
 
virtual void sendDataToNek () override
 Send data to Nek. More...
 
virtual void readDataFromNek ()
 Read data from Nek. More...
 
const MooseEnum & direction () const
 Get the direction of the transfer. More...
 

Static Public Member Functions

static InputParameters validParams ()
 
static std::map< unsigned int, std::string > usrwrkMap ()
 

Protected Member Functions

bool normalizeVolumetricSource (const double moose_integral, const double nek_integral, double &normalized_nek_integral)
 
std::string normalizationHint () const
 
void fillAuxVariable (const unsigned int var_number, const double *value)
 
void addExternalVariable (const std::string name)
 
void addExternalVariable (const unsigned int slot, const std::string name)
 
void addExternalPostprocessor (const std::string name, const Real initial)
 
void checkAllocatedUsrwrkSlot (const unsigned int &u) const
 

Protected Attributes

const Real & _initial_source_integral
 Initial value to use for the total volumetric source for ensuring conservation. More...
 
const PostprocessorValue * _source_integral = nullptr
 Total volume-integrated volumetric source coming from the coupled MOOSE app. More...
 
const Real & _abs_tol
 Absolute tolerance for checking conservation. More...
 
const Real & _rel_tol
 Relative tolerance for checking conservation. More...
 
std::string _postprocessor_name
 Name of the postprocessor/vectorpostprocessor used to apply conservation. More...
 
std::string _variable
 Variable name (or prefix of names) to create in MOOSE to facilitate data passing. More...
 
std::vector< unsigned int > _usrwrk_slot
 Slot in usrwrk array to use for writing data, if 'direction = to_nek'. More...
 
std::map< std::string, unsigned int > _variable_number
 Internal number for the variable(s) created in MOOSE (name, number) More...
 
int _n_per_surf
 Number of points on the MOOSE mesh to write per element surface. More...
 
int _n_per_vol
 Number of points on the MOOSE mesh to write per element volume. More...
 
double * _v_face = nullptr
 MOOSE data interpolated onto the (boundary) data transfer mesh. More...
 
double * _v_elem = nullptr
 MOOSE data interpolated onto the (volume) data transfer mesh. More...
 
double * _external_data = nullptr
 Scratch space to place external NekRS fields before writing into auxiliary variables. More...
 
NekRSProblem_nek_problem
 The NekRSProblem using the field transfer interface. More...
 
NekRSMesh_nek_mesh
 The underlying NekRSMesh mirror. More...
 
const MooseEnum & _direction
 Direction of the transfer. More...
 

Static Protected Attributes

static std::map< unsigned int, std::string > _field_usrwrk_map
 

Detailed Description

Performs a transfer of a volumetric source between NekRS and MOOSE. The mesh used for the MOOSE app may be very different from the mesh used by nekRS. Elements may be much finer/coarser, and one element on the MOOSE app may not be a clear subset/superset of the elements on the nekRS mesh. Therefore, to ensure conservation, we send the source integral to nekRS for internval normalization of the source applied on the nekRS mesh.

Constructor & Destructor Documentation

◆ NekVolumetricSource()

NekVolumetricSource::NekVolumetricSource ( const InputParameters &  parameters)

Member Function Documentation

◆ addExternalPostprocessor()

void NekTransferBase::addExternalPostprocessor ( const std::string  name,
const Real  initial 
)
protectedinherited

Add a postprocessor to facilitate coupling

Parameters
[in]namepostprocessor name
[in]initialinitial value to use for the postprocessor

◆ addExternalVariable() [1/2]

void FieldTransferBase::addExternalVariable ( const std::string  name)
protectedinherited

Add a MOOSE variable to facilitate coupling

Parameters
[in]namevariable name

◆ addExternalVariable() [2/2]

void FieldTransferBase::addExternalVariable ( const unsigned int  slot,
const std::string  name 
)
protectedinherited

Add a MOOSE variable to facilitate coupling

Parameters
[in]slotslot in usrwrk array holding this field
[in]namevariable name

◆ checkAllocatedUsrwrkSlot()

void NekTransferBase::checkAllocatedUsrwrkSlot ( const unsigned int &  u) const
protectedinherited

Check if a specified slot in the usrwrk array has been allocated

Parameters
[in]uslice in usrwrk array

◆ direction()

const MooseEnum& NekTransferBase::direction ( ) const
inlineinherited

Get the direction of the transfer.

◆ fillAuxVariable()

void FieldTransferBase::fillAuxVariable ( const unsigned int  var_number,
const double *  value 
)
protectedinherited

Fill an outgoing auxiliary variable field with nekRS solution data

Parameters
[in]var_numberauxiliary variable number
[in]valuenekRS solution data to fill the variable with

◆ normalizationHint()

std::string ConservativeFieldTransfer::normalizationHint ( ) const
protectedinherited

Return a string to print in error messages upon failed normalizations

Returns
debugging hint

◆ normalizeVolumetricSource()

bool NekVolumetricSource::normalizeVolumetricSource ( const double  moose_integral,
const double  nek_integral,
double &  normalized_nek_integral 
)
protected

Normalize the volumetric source sent to NekRS

Parameters
[in]moose_integraltotal integrated value from MOOSE to conserve
[in]nek_integraltotal integrated value in nekRS to adjust
[out]normalized_nek_integralfinal normalized value
Returns
whether normalization was successful, i.e. normalized_nek_integral equals moose_integral

◆ readDataFromNek()

virtual void NekTransferBase::readDataFromNek ( )
inlinevirtualinherited

Read data from Nek.

Reimplemented in NekBoundaryFlux, and NekFieldVariable.

◆ sendDataToNek()

virtual void NekVolumetricSource::sendDataToNek ( )
overridevirtual

Send data to Nek.

Reimplemented from NekTransferBase.

◆ usrwrkMap()

static std::map<unsigned int, std::string> FieldTransferBase::usrwrkMap ( )
inlinestaticinherited

Get the mapping of usrwrk slots to variable names for all field transfers

Returns
map ordered as (slot number, name)

◆ validParams()

static InputParameters NekVolumetricSource::validParams ( )
static

Member Data Documentation

◆ _abs_tol

const Real& ConservativeFieldTransfer::_abs_tol
protectedinherited

Absolute tolerance for checking conservation.

◆ _direction

const MooseEnum& NekTransferBase::_direction
protectedinherited

Direction of the transfer.

◆ _external_data

double* FieldTransferBase::_external_data = nullptr
protectedinherited

Scratch space to place external NekRS fields before writing into auxiliary variables.

◆ _field_usrwrk_map

std::map<unsigned int, std::string> FieldTransferBase::_field_usrwrk_map
staticprotectedinherited

Information about data stored in the usrwrk array for error checking and diagnostics; stored as (slot, variable name in MOOSE)

◆ _initial_source_integral

const Real& NekVolumetricSource::_initial_source_integral
protected

Initial value to use for the total volumetric source for ensuring conservation.

◆ _n_per_surf

int FieldTransferBase::_n_per_surf
protectedinherited

Number of points on the MOOSE mesh to write per element surface.

◆ _n_per_vol

int FieldTransferBase::_n_per_vol
protectedinherited

Number of points on the MOOSE mesh to write per element volume.

◆ _nek_mesh

NekRSMesh* NekTransferBase::_nek_mesh
protectedinherited

The underlying NekRSMesh mirror.

◆ _nek_problem

NekRSProblem& NekTransferBase::_nek_problem
protectedinherited

The NekRSProblem using the field transfer interface.

◆ _postprocessor_name

std::string ConservativeFieldTransfer::_postprocessor_name
protectedinherited

Name of the postprocessor/vectorpostprocessor used to apply conservation.

◆ _rel_tol

const Real& ConservativeFieldTransfer::_rel_tol
protectedinherited

Relative tolerance for checking conservation.

◆ _source_integral

const PostprocessorValue* NekVolumetricSource::_source_integral = nullptr
protected

Total volume-integrated volumetric source coming from the coupled MOOSE app.

◆ _usrwrk_slot

std::vector<unsigned int> FieldTransferBase::_usrwrk_slot
protectedinherited

Slot in usrwrk array to use for writing data, if 'direction = to_nek'.

◆ _v_elem

double* FieldTransferBase::_v_elem = nullptr
protectedinherited

MOOSE data interpolated onto the (volume) data transfer mesh.

◆ _v_face

double* FieldTransferBase::_v_face = nullptr
protectedinherited

MOOSE data interpolated onto the (boundary) data transfer mesh.

◆ _variable

std::string FieldTransferBase::_variable
protectedinherited

Variable name (or prefix of names) to create in MOOSE to facilitate data passing.

◆ _variable_number

std::map<std::string, unsigned int> FieldTransferBase::_variable_number
protectedinherited

Internal number for the variable(s) created in MOOSE (name, number)


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