This boundary condition provides a temperature interface to an external application. Values are transferred as plain text files, where OpenFOAM data is written as: More...


Public Member Functions | |
| TypeName ("externalCoupledTemperature") | |
| Runtime type information. More... | |
| externalCoupledTemperatureMixedFvPatchScalarField (const fvPatch &, const DimensionedField< scalar, fvMesh > &, const dictionary &) | |
| Construct from patch, internal field and dictionary. More... | |
| externalCoupledTemperatureMixedFvPatchScalarField (const externalCoupledTemperatureMixedFvPatchScalarField &, const fvPatch &, const DimensionedField< scalar, fvMesh > &, const fieldMapper &) | |
| Construct by mapping given. More... | |
| externalCoupledTemperatureMixedFvPatchScalarField (const externalCoupledTemperatureMixedFvPatchScalarField &)=delete | |
| Disallow copy without setting internal field reference. More... | |
| externalCoupledTemperatureMixedFvPatchScalarField (const externalCoupledTemperatureMixedFvPatchScalarField &, const DimensionedField< scalar, fvMesh > &) | |
| Copy constructor setting internal field reference. More... | |
| virtual tmp< fvPatchScalarField > | clone (const DimensionedField< scalar, fvMesh > &iF) const |
| Construct and return a clone setting internal field reference. More... | |
| virtual | ~externalCoupledTemperatureMixedFvPatchScalarField () |
| Destructor. More... | |
| virtual void | evaluate (const Pstream::commsTypes commsType=Pstream::commsTypes::blocking) |
| Evaluate the patch field. More... | |
| virtual void | transferData (OFstream &os) const |
| Transfer data for external source. More... | |
| virtual void | write (Ostream &) const |
| Write. More... | |
Protected Member Functions | |
| virtual void | writeHeader (OFstream &os) const |
| Write header to transfer file. More... | |
This boundary condition provides a temperature interface to an external application. Values are transferred as plain text files, where OpenFOAM data is written as:
# Patch: <patch name>
<magSf1> <value1> <qDot1> <htc1>
<magSf2> <value2> <qDot2> <htc2>
<magSf3> <value3> <qDot3> <htc2>
...
<magSfN> <valueN> <qDotN> <htcN>
and received as the constituent pieces of the `mixed' condition, i.e.
# Patch: <patch name>
<value1> <gradient1> <valueFraction1>
<value2> <gradient2> <valueFraction2>
<value3> <gradient3> <valueFraction3>
...
<valueN> <gradientN> <valueFractionN>
Data is sent/received as a single file for all patches from the directory
$FOAM_CASE/<commsDir>
At start-up, the boundary creates a lock file, i.e..
OpenFOAM.lock
... to signal the external source to wait. During the boundary condition update, boundary values are written to file, e.g.
<fileName>.out
The lock file is then removed, instructing the external source to take control of the program execution. When ready, the external program should create the return values, e.g. to file
<fileName>.in
... and then re-instate the lock file. The boundary condition will then read the return values, and pass program execution back to OpenFOAM.
| Property | Description | Required | Default value |
|---|---|---|---|
commsDir | communications directory | yes | |
file | transfer file name | yes | |
waitInterval | interval [s] between file checks | no | 1 |
timeOut | time after which error invoked [s] | no | 100*waitInterval |
calcFrequency | calculation frequency | no | 1 |
log | log program control | no | no |
Example of the boundary condition specification:
<patchName>
{
type externalCoupledTemperature;
commsDir "$FOAM_CASE/comms";
file data;
calcFrequency 1;
}
Definition at line 164 of file externalCoupledTemperatureMixedFvPatchScalarField.H.
| externalCoupledTemperatureMixedFvPatchScalarField | ( | const fvPatch & | p, |
| const DimensionedField< scalar, fvMesh > & | iF, | ||
| const dictionary & | dict | ||
| ) |
Construct from patch, internal field and dictionary.
Definition at line 44 of file externalCoupledTemperatureMixedFvPatchScalarField.C.
| externalCoupledTemperatureMixedFvPatchScalarField | ( | const externalCoupledTemperatureMixedFvPatchScalarField & | ptf, |
| const fvPatch & | p, | ||
| const DimensionedField< scalar, fvMesh > & | iF, | ||
| const fieldMapper & | mapper | ||
| ) |
Construct by mapping given.
externalCoupledTemperatureMixedFvPatchScalarField onto a new patch
Definition at line 56 of file externalCoupledTemperatureMixedFvPatchScalarField.C.
|
delete |
Disallow copy without setting internal field reference.
| externalCoupledTemperatureMixedFvPatchScalarField | ( | const externalCoupledTemperatureMixedFvPatchScalarField & | ecmpf, |
| const DimensionedField< scalar, fvMesh > & | iF | ||
| ) |
Copy constructor setting internal field reference.
Definition at line 69 of file externalCoupledTemperatureMixedFvPatchScalarField.C.
|
virtual |
Destructor.
Definition at line 82 of file externalCoupledTemperatureMixedFvPatchScalarField.C.
|
protectedvirtual |
Write header to transfer file.
Definition at line 33 of file externalCoupledTemperatureMixedFvPatchScalarField.C.
References Foam::endl().

| TypeName | ( | "externalCoupledTemperature" | ) |
Runtime type information.
|
inlinevirtual |
Construct and return a clone setting internal field reference.
Definition at line 217 of file externalCoupledTemperatureMixedFvPatchScalarField.H.
|
virtual |
Evaluate the patch field.
Definition at line 187 of file externalCoupledTemperatureMixedFvPatchScalarField.C.
References Foam::evaluate().

|
virtual |
Transfer data for external source.
Definition at line 89 of file externalCoupledTemperatureMixedFvPatchScalarField.C.
References Foam::endl(), OSstream::flush(), forAll, Pstream::gatherList(), Foam::Info, thermophysicalTransportModel::kappaEff(), Foam::log(), UPstream::master(), UPstream::msgType(), UPstream::myProcNo(), OFstream::name(), Foam::nl, UPstream::nProcs(), UPstream::parRun(), patchi, List< T >::setSize(), Foam::fvc::snGrad(), token::SPACE, and Foam::type().

|
virtual |
Write.
Definition at line 196 of file externalCoupledTemperatureMixedFvPatchScalarField.C.
References Foam::vtkWriteOps::write().
