- directionDirection in which to send data
C++ Type:MooseEnum
Controllable:No
Description:Direction in which to send data
NekPostprocessorValue
Description
The NekPostprocessorValue class sends a postprocessor value between NekRS and MOOSE. This can be used to apply boundary conditions to the NekRS model, as well as the much more general purposes of setting values that appear anywhere in NekRS's .udf or .oudf files. This object will automatically create a Receiver postprocessor with the name of the object; data to read/write will be taken/placed in this postprocessor.
Example Input File Syntax
Below is an example input file that defines two postprocessor transfers that we will use to set two boundary conditions in NekRS. This also creates automatically two Receiver postprocessors, named inlet_V and inlet_T.
[Problem<<<{"href": "../../syntax/Problem/index.html"}>>>]
type = NekRSProblem
casename<<<{"description": "Case name for the NekRS input files; this is <case> in <case>.par, <case>.udf, <case>.oudf, and <case>.re2."}>>> = 'pyramid'
n_usrwrk_slots<<<{"description": "Number of slots to allocate in nrs->usrwrk to hold fields either related to coupling (which will be populated by Cardinal), or other custom usages, such as a distance-to-wall calculation"}>>> = 2
[ScalarTransfers<<<{"href": "../../syntax/Problem/ScalarTransfers/index.html"}>>>]
[inlet_V]
type = NekPostprocessorValue<<<{"description": "Transfers a postprocessor value into NekRS"}>>>
direction<<<{"description": "Direction in which to send data"}>>> = to_nek
usrwrk_slot<<<{"description": "When 'direction = to_nek', the slot in the usrwrk array to write the incoming data"}>>> = 0
[]
[inlet_T]
type = NekPostprocessorValue<<<{"description": "Transfers a postprocessor value into NekRS"}>>>
direction<<<{"description": "Direction in which to send data"}>>> = to_nek
usrwrk_slot<<<{"description": "When 'direction = to_nek', the slot in the usrwrk array to write the incoming data"}>>> = 1
[]
[]
[](test/tests/transfers/nek_postprocessor_value/nek.i)A sub-application sends data into the inlet_V and inlet_T postprocessors. When running the input file, you will then see a table like the following print:
-----------------------------------------------------------------------------------------------------------
| Slot | MOOSE quantity | How to Access (.oudf) | How to Access (.udf) |
-----------------------------------------------------------------------------------------------------------
| 0 | inlet_V | bc->usrwrk[0 * bc->fieldOffset + 0] | nrs->usrwrk[0 * nrs->fieldOffset + 0] |
| 1 | inlet_T | bc->usrwrk[1 * bc->fieldOffset + 0] | nrs->usrwrk[1 * nrs->fieldOffset + 0] |
| 2 | unused | bc->usrwrk[2 * bc->fieldOffset+bc->idM] | nrs->usrwrk[2 * nrs->fieldOffset + n] |
| 3 | unused | bc->usrwrk[3 * bc->fieldOffset+bc->idM] | nrs->usrwrk[3 * nrs->fieldOffset + n] |
| 4 | unused | bc->usrwrk[4 * bc->fieldOffset+bc->idM] | nrs->usrwrk[4 * nrs->fieldOffset + n] |
| 5 | unused | bc->usrwrk[5 * bc->fieldOffset+bc->idM] | nrs->usrwrk[5 * nrs->fieldOffset + n] |
| 6 | unused | bc->usrwrk[6 * bc->fieldOffset+bc->idM] | nrs->usrwrk[6 * nrs->fieldOffset + n] |
-----------------------------------------------------------------------------------------------------------
Suppose we want to use these two scalar values to set a Dirichlet temperature and velocity boundary condition in NekRS. We would simply use those quantities in the .oudf column in the table above.
void velocityDirichletConditions(bcData *bc)
{
// note: when running with Cardinal, Cardinal will allocate the usrwrk
// array. If running with NekRS standalone (e.g. nrsmpi), you need to
// replace the usrwrk with some other value or allocate it youself from
// the udf and populate it with values.
bc->u = bc->usrwrk[0 + 0 * bc->fieldOffset];
bc->v = 0.0;
bc->w = 0.0;
}
void scalarDirichletConditions(bcData *bc)
{
// note: when running with Cardinal, Cardinal will allocate the usrwrk
// array. If running with NekRS standalone (e.g. nrsmpi), you need to
// replace the usrwrk with some other value or allocate it youself from
// the udf and populate it with values.
if (bc->scalarId == 0) bc->s = bc->usrwrk[0 + 1 * bc->fieldOffset];
}
(test/tests/transfers/nek_postprocessor_value/pyramid.oudf)Input Parameters
- scaling1Multiplier on the value passed into NekRS
Default:1
C++ Type:double
Unit:(no unit assumed)
Controllable:No
Description:Multiplier on the value passed into NekRS
- usrwrk_slotWhen 'direction = to_nek', the slot in the usrwrk array to write the incoming data
C++ Type:unsigned int
Controllable:No
Description:When 'direction = to_nek', the slot in the usrwrk array to write the incoming data
Optional Parameters
- control_tagsAdds user-defined labels for accessing object parameters via control logic.
C++ Type:std::vector<std::string>
Controllable:No
Description:Adds user-defined labels for accessing object parameters via control logic.
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:No
Description:Set the enabled status of the MooseObject.