thermoCoupleProbes Class Reference

Sample probe for temperature using a thermocouple. More...

Inheritance diagram for thermoCoupleProbes:
[legend]
Collaboration diagram for thermoCoupleProbes:
[legend]

Public Member Functions

 TypeName ("thermoCoupleProbes")
 Runtime type information. More...
 
 thermoCoupleProbes (const word &name, const Time &runTime, const dictionary &dict, const bool loadFromFiles=false, const bool readFields=true)
 Construct for given objectRegistry and dictionary. More...
 
virtual ~thermoCoupleProbes ()
 Destructor. More...
 
virtual label nEqns () const
 Number of ODE's to solve. More...
 
virtual void derivatives (const scalar x, const scalarField &y, scalarField &dydx) const
 Calculate the derivatives in dydx. More...
 
virtual void jacobian (const scalar t, const scalarField &y, scalarField &dfdt, scalarSquareMatrix &dfdy) const
 Calculate the Jacobian of the system. More...
 
virtual bool write ()
 Sample and write. More...
 
virtual bool execute ()
 Execute, currently does nothing. More...
 
virtual bool read (const dictionary &)
 Read. More...
 
- Public Member Functions inherited from probes
 TypeName ("probes")
 Runtime type information. More...
 
 probes (const word &name, const Time &runTime, const dictionary &dict, const bool loadFromFiles=false, const bool readFields=true)
 Construct from Time and dictionary. More...
 
virtual ~probes ()=default
 Destructor. More...
 
virtual const wordResfieldNames () const
 Return names of fields to probe. More...
 
virtual const pointFieldprobeLocations () const
 Return locations to probe. More...
 
virtual const pointprobe (const label i) const
 Return location for probe i. More...
 
const labelListelements () const
 Cells to be probed (obtained from the locations) More...
 
virtual void updateMesh (const mapPolyMesh &)
 Update for changes of mesh. More...
 
virtual void movePoints (const polyMesh &)
 Update for changes of mesh. More...
 
virtual void readUpdate (const polyMesh::readUpdateState state)
 Update for changes of mesh due to readUpdate. More...
 
template<class Type >
tmp< Field< Type > > sample (const GeometricField< Type, fvPatchField, volMesh > &) const
 Sample a volume field at all locations. More...
 
template<class Type >
tmp< Field< Type > > sample (const word &fieldName) const
 Sample a single vol field on all sample locations. More...
 
template<class Type >
tmp< Field< Type > > sampleSurfaceFields (const word &fieldName) const
 Sample a single scalar field on all sample locations. More...
 
template<class Type >
tmp< Field< Type > > sample (const GeometricField< Type, fvsPatchField, surfaceMesh > &) const
 Sample a surface field at all locations. More...
 
template<class Type >
Foam::tmp< Foam::Field< Type > > sample (const GeometricField< Type, fvPatchField, volMesh > &vField) const
 
template<class Type >
Foam::tmp< Foam::Field< Type > > sample (const word &fieldName) const
 
template<class Type >
Foam::tmp< Foam::Field< Type > > sample (const GeometricField< Type, fvsPatchField, surfaceMesh > &sField) const
 
template<class Type >
Foam::tmp< Foam::Field< Type > > sampleSurfaceFields (const word &fieldName) const
 
- Public Member Functions inherited from stateFunctionObject
 stateFunctionObject (const word &name, const Time &runTime)
 Construct from components. More...
 
virtual ~stateFunctionObject ()=default
 Destructor. More...
 
dictionarypropertyDict ()
 Return access to the property dictionary. More...
 
bool foundProperty (const word &entryName) const
 Return true if the property exists. More...
 
void clearTrigger ()
 Remove the trigger index from the properties. More...
 
label getTrigger () const
 Get the current trigger index. More...
 
bool setTrigger (const label triggeri, bool increaseOnly=true)
 Set the trigger index. Normally only if greater than current. More...
 
bool getDict (const word &entryName, dictionary &dict) const
 Set dictionary, return true if set. More...
 
bool getObjectDict (const word &objectName, const word &entryName, dictionary &dict) const
 Set dictionary from named object, return true if set. More...
 
template<class Type >
Type getProperty (const word &entryName, const Type &defaultValue=Type(Zero)) const
 Retrieve generic property. More...
 
template<class Type >
bool getProperty (const word &entryName, Type &value) const
 Set generic property, return true if set. More...
 
template<class Type >
void setProperty (const word &entryName, const Type &value)
 Add generic property. More...
 
template<class Type >
Type getObjectProperty (const word &objectName, const word &entryName, const Type &defaultValue=Type(Zero)) const
 Retrieve generic property from named object. More...
 
template<class Type >
bool getObjectProperty (const word &objectName, const word &entryName, Type &value) const
 Set generic property from named object, return true if set. More...
 
template<class Type >
void setObjectProperty (const word &objectName, const word &entryName, const Type &value)
 Add generic property from named object. More...
 
template<class Type >
void setResult (const word &entryName, const Type &value)
 Add result. More...
 
template<class Type >
void setObjectResult (const word &objectName, const word &entryName, const Type &value)
 Add result from named object. More...
 
template<class Type >
Type getResult (const word &entryName, const Type &defaultValue=Type(Zero)) const
 Retrieve result. More...
 
template<class Type >
Type getObjectResult (const word &objectName, const word &entryName, const Type &defaultValue=Type(Zero)) const
 Retrieve result from named object. More...
 
template<class Type >
bool getObjectResult (const word &objectName, const word &entryName, Type &value) const
 Set result from named object, return true if set. More...
 
word resultType (const word &entryName) const
 Retrieve the result type. More...
 
word objectResultType (const word &objectName, const word &entryName) const
 Return the type of result. More...
 
wordList objectResultEntries () const
 Retrieve the result entries. More...
 
wordList objectResultEntries (const word &objectName) const
 Return result entries for named object. More...
 
void writeResultEntries (Ostream &os) const
 Write the results entries for all objects to stream. More...
 
void writeResultEntries (const word &objectName, Ostream &os) const
 Write the results entries for named object to stream. More...
 
void writeAllResultEntries (Ostream &os) const
 Write the results entries for all objects to stream. More...
 
- Public Member Functions inherited from timeFunctionObject
 timeFunctionObject (const word &name, const Time &runTime)
 Construct from Time. More...
 
virtual ~timeFunctionObject ()=default
 Destructor. More...
 
const Timetime () const
 Return time database. More...
 
objectRegistrystoredObjects ()
 
const objectRegistrystoredObjects () const
 
- Public Member Functions inherited from functionObject
 declareRunTimeSelectionTable (autoPtr, functionObject, dictionary,(const word &name, const Time &runTime, const dictionary &dict),(name, runTime, dict))
 
 functionObject (const word &name, const bool withNamePrefix=defaultUseNamePrefix)
 Construct from components. More...
 
autoPtr< functionObjectclone () const
 Return clone. More...
 
virtual ~functionObject ()=default
 Destructor. More...
 
virtual const wordtype () const =0
 Runtime type information. More...
 
const wordname () const noexcept
 Return the name of this functionObject. More...
 
bool useNamePrefix () const noexcept
 Return the flag for adding a scoping name prefix. More...
 
bool useNamePrefix (bool on) noexcept
 Modify the flag for adding a scoping name prefix. More...
 
virtual bool execute (const label subIndex)
 Execute using the specified subIndex. More...
 
virtual bool end ()
 Called when Time::run() determines that the time-loop exits. More...
 
virtual bool adjustTimeStep ()
 Called at the end of Time::adjustDeltaT() if adjustTime is true. More...
 
virtual bool filesModified () const
 Did any file get changed during execution? More...
 
- Public Member Functions inherited from Field< vector >
constexpr Field () noexcept
 Default construct. More...
 
 Field (const label len)
 Construct given size. More...
 
 Field (const label len, const vector &val)
 Construct given size and initial value. More...
 
 Field (const label len, const Foam::zero)
 Construct given size and initial values of zero. More...
 
 Field (const Foam::one, const vector &val)
 Construct with length=1, copying the value as the only content. More...
 
 Field (const Foam::one, vector &&val)
 Construct with length=1, moving the value as the only content. More...
 
 Field (const Foam::one, const Foam::zero)
 Construct with length=1, initializing content to zero. More...
 
 Field (const Field< vector > &fld)
 Copy construct. More...
 
 Field (const UList< vector > &list)
 Copy construct from UList<Type> More...
 
 Field (const IndirectListBase< vector, Addr > &list)
 Copy construct from IndirectList. More...
 
 Field (Field< vector > &&fld)
 Move construct from Field. More...
 
 Field (List< vector > &&list)
 Move construct from List. More...
 
 Field (DynamicList< vector, SizeMin > &&list)
 Move construct from DynamicList. More...
 
 Field (const UList< vector > &mapF, const labelUList &mapAddressing)
 Construct by 1 to 1 mapping from the given field. More...
 
 Field (const tmp< Field< vector >> &tmapF, const labelUList &mapAddressing)
 Construct by 1 to 1 mapping from the given tmp field. More...
 
 Field (const UList< vector > &mapF, const labelListList &mapAddressing, const scalarListList &weights)
 Construct by interpolative mapping from the given field. More...
 
 Field (const tmp< Field< vector >> &tmapF, const labelListList &mapAddressing, const scalarListList &weights)
 Construct by interpolative mapping from the given tmp field. More...
 
 Field (const UList< vector > &mapF, const FieldMapper &map, const bool applyFlip=true)
 Construct by mapping from the given field. More...
 
 Field (const UList< vector > &mapF, const FieldMapper &map, const vector &defaultValue, const bool applyFlip=true)
 Construct by mapping from the given field. More...
 
 Field (const UList< vector > &mapF, const FieldMapper &map, const UList< vector > &defaultValues, const bool applyFlip=true)
 Construct by mapping from the given field. More...
 
 Field (const tmp< Field< vector >> &tmapF, const FieldMapper &map, const bool applyFlip=true)
 Construct by mapping from the given tmp field. More...
 
 Field (const tmp< Field< vector >> &tmapF, const FieldMapper &map, const vector &defaultValue, const bool applyFlip=true)
 
 Field (const tmp< Field< vector >> &tmapF, const FieldMapper &map, const UList< vector > &defaultValues, const bool applyFlip=true)
 
 Field (Field< vector > &fld, bool reuse)
 Copy construct or re-use as specified. More...
 
 Field (const tmp< Field< vector >> &tfld)
 Copy or move construct from tmp. More...
 
 Field (Istream &is)
 Construct from Istream. More...
 
 Field (const word &keyword, const dictionary &dict, const label len)
 Construct from a dictionary entry. More...
 
tmp< Field< vector > > clone () const
 Clone. More...
 
void map (const UList< vector > &mapF, const labelUList &mapAddressing)
 1 to 1 map from the given field More...
 
void map (const tmp< Field< vector >> &tmapF, const labelUList &mapAddressing)
 1 to 1 map from the given tmp field More...
 
void map (const UList< vector > &mapF, const labelListList &mapAddressing, const scalarListList &weights)
 Interpolative map from the given field. More...
 
void map (const tmp< Field< vector >> &tmapF, const labelListList &mapAddressing, const scalarListList &weights)
 Interpolative map from the given tmp field. More...
 
void map (const UList< vector > &mapF, const FieldMapper &map, const bool applyFlip=true)
 Map from the given field. More...
 
void map (const tmp< Field< vector >> &tmapF, const FieldMapper &map, const bool applyFlip=true)
 Map from the given tmp field. More...
 
void autoMap (const FieldMapper &map, const bool applyFlip=true)
 Map from self. More...
 
void rmap (const UList< vector > &mapF, const labelUList &mapAddressing)
 1 to 1 reverse-map from the given field More...
 
void rmap (const tmp< Field< vector >> &tmapF, const labelUList &mapAddressing)
 1 to 1 reverse-map from the given tmp field More...
 
void rmap (const UList< vector > &mapF, const labelUList &mapAddressing, const UList< scalar > &weights)
 Interpolative reverse map from the given field. More...
 
void rmap (const tmp< Field< vector >> &tmapF, const labelUList &mapAddressing, const UList< scalar > &weights)
 Interpolative reverse map from the given tmp field. More...
 
void negate ()
 Negate this field (negative). More...
 
tmp< Field< cmptType > > component (const direction) const
 Return a component field of the field. More...
 
void replace (const direction, const UList< cmptType > &)
 Replace a component field of the field. More...
 
void replace (const direction, const tmp< Field< cmptType >> &)
 Replace a component field of the field. More...
 
void replace (const direction, const cmptType &)
 Replace a component field of the field. More...
 
VSForm block (const label start) const
 
tmp< Field< vector > > T () const
 Return the field transpose (only defined for second rank tensors) More...
 
void writeEntry (const word &keyword, Ostream &os) const
 Write the field as a dictionary entry. More...
 
SubField< vectorslice (const label pos, label len=-1)
 Return SubField slice (non-const access) - no range checking. More...
 
const SubField< vectorslice (const label pos, label len=-1) const
 Return SubField slice (const access) - no range checking. More...
 
SubField< vectorslice (const labelRange &range)
 Return SubField slice (non-const access) - with range checking. More...
 
const SubField< vectorslice (const labelRange &range) const
 Return SubField slice (const access) - with range checking. More...
 
void operator= (const Field< vector > &)
 Copy assignment. More...
 
void operator= (const tmp< Field< vector >> &)
 
void operator= (const UList< vector > &rhs)
 
void operator= (const SubField< vector > &rhs)
 
void operator= (const IndirectListBase< vector, Addr > &rhs)
 Copy assign from IndirectList. More...
 
void operator= (Field< vector > &&rhs)
 Move assignment. More...
 
void operator= (List< vector > &&rhs)
 
void operator= (DynamicList< vector, SizeMin > &&rhs)
 
void operator= (const vector &val)
 Value assignment. More...
 
void operator= (const Foam::zero)
 
void operator= (const VectorSpace< Form, Cmpt, nCmpt > &)
 
void operator= (const tmp< Field > &rhs)
 
void operator+= (const UList< vector > &)
 
void operator+= (const tmp< Field< vector >> &)
 
void operator+= (const vector &)
 
void operator-= (const UList< vector > &)
 
void operator-= (const tmp< Field< vector >> &)
 
void operator-= (const vector &)
 
void operator*= (const UList< scalar > &)
 
void operator*= (const tmp< Field< scalar >> &)
 
void operator*= (const scalar &)
 
void operator/= (const UList< scalar > &)
 
void operator/= (const tmp< Field< scalar >> &)
 
void operator/= (const scalar &)
 
- Public Member Functions inherited from ODESystem
 ODESystem ()
 Construct null. More...
 
virtual ~ODESystem ()=default
 Destructor. More...
 

Protected Member Functions

template<class Type >
void sampleAndWrite (const GeometricField< Type, fvPatchField, volMesh > &)
 Sample and write a particular volume field. More...
 
- Protected Member Functions inherited from probes
void clearFieldGroups ()
 Clear old field groups. More...
 
label classifyFields ()
 Classify field types, returns the number of fields. More...
 
virtual void findElements (const fvMesh &mesh)
 Find cells and faces containing probes. More...
 
label prepare ()
 Classify field type and open/close file streams,. More...
 
- Protected Member Functions inherited from stateFunctionObject
const functionObjects::propertiesstateDict () const
 Return a const reference to the state dictionary. More...
 
functionObjects::propertiesstateDict ()
 Return non-const access to the state dictionary. More...
 
 stateFunctionObject (const stateFunctionObject &)=delete
 No copy construct. More...
 
void operator= (const stateFunctionObject &)=delete
 No copy assignment. More...
 
- Protected Member Functions inherited from timeFunctionObject
void clearOutputObjects (const wordList &objNames)
 Remove specified items from "functionObjectObjects". More...
 
 timeFunctionObject (const timeFunctionObject &)=delete
 No copy construct. More...
 
void operator= (const timeFunctionObject &)=delete
 No copy assignment. More...
 
- Protected Member Functions inherited from functionObject
word scopedName (const word &name) const
 Return a scoped (prefixed) name. More...
 

Protected Attributes

scalar rho_
 Thermocouple density. More...
 
scalar Cp_
 Thermocouple heat capacity. More...
 
scalar d_
 Thermocouple diameter. More...
 
scalar epsilon_
 Thermocouple emissivity. More...
 
word UName_
 Name of the velocity field. More...
 
word radiationFieldName_
 Name of the incident radiation field. More...
 
const fluidThermothermo_
 Fluid thermo reference. More...
 
autoPtr< ODESolverodeSolver_
 ODESolver. More...
 
scalarField Ttc_
 Cached thermocouple temperature. More...
 
- Protected Attributes inherited from probes
const fvMeshmesh_
 Const reference to fvMesh. More...
 
bool loadFromFiles_
 Load fields from files (not from objectRegistry) More...
 
wordRes fieldSelection_
 Names of fields to probe. More...
 
bool fixedLocations_
 Fixed locations, default = yes. More...
 
word interpolationScheme_
 Interpolation scheme name. More...
 
bool includeOutOfBounds_
 Include probes that were not found. More...
 
fieldGroup< scalar > scalarFields_
 Categorized scalar/vector/tensor vol fields. More...
 
fieldGroup< vectorvectorFields_
 
fieldGroup< sphericalTensorsphericalTensorFields_
 
fieldGroup< symmTensorsymmTensorFields_
 
fieldGroup< tensortensorFields_
 
fieldGroup< scalar > surfaceScalarFields_
 Categorized scalar/vector/tensor surf fields. More...
 
fieldGroup< vectorsurfaceVectorFields_
 
fieldGroup< sphericalTensorsurfaceSphericalTensorFields_
 
fieldGroup< symmTensorsurfaceSymmTensorFields_
 
fieldGroup< tensorsurfaceTensorFields_
 
labelList elementList_
 Cells to be probed (obtained from the locations) More...
 
labelList faceList_
 Faces to be probed. More...
 
labelList processor_
 Processor holding the cell or face (-1 if point not found. More...
 
HashPtrTable< OFstreamprobeFilePtrs_
 Current open files. More...
 
labelList patchIDList_
 Patch IDs on which the new probes are located. More...
 
pointField oldPoints_
 Original probes location (only used for patchProbes) More...
 
- Protected Attributes inherited from timeFunctionObject
const Timetime_
 Reference to the time database. More...
 

Additional Inherited Members

- Public Types inherited from Field< vector >
typedef pTraits< vector >::cmptType cmptType
 Component type. More...
 
typedef SubField< vectorsubField
 Declare type of subField. More...
 
- Static Public Member Functions inherited from functionObject
static autoPtr< functionObjectNew (const word &name, const Time &runTime, const dictionary &dict)
 Select from dictionary, based on its "type" entry. More...
 
- Static Public Member Functions inherited from Field< vector >
static const Field< vector > & null ()
 Return nullObject reference Field. More...
 
static autoPtr< Field< vector > > New (Istream &is)
 Return a pointer to a new Field created on freestore. More...
 
static tmp< Field< vector > > NewCalculatedType (const Field< Type2 > &f)
 
- Public Attributes inherited from functionObject
bool log
 Flag to write log into Info. More...
 
- Static Public Attributes inherited from functionObject
static int debug
 Flag to execute debug content. More...
 
static bool postProcess
 Global post-processing mode switch. More...
 
static bool defaultUseNamePrefix
 Global default for useNamePrefix. More...
 
static word outputPrefix
 Directory prefix. More...
 

Detailed Description

Sample probe for temperature using a thermocouple.

Uses the correlation:

\[ Nu = 2.0 + \left(0.4 Re^{0.5} + 0.06 Re^{2/3}\right)*Pr^{0.4} \]

Usage
Example of function object specification:
probes
{
    type            thermoCoupleProbes;
    libs            (utilityFunctionObjects);
    writeControl    timeStep;
    writeInterval   1;

    solver          rodas23;
    absTol          1e-12;
    relTol          1e-8;

    interpolationScheme cellPoint;

    // thermocouple properties
    rho             8908;
    Cp              440;
    d               1e-3;
    epsilon         0.85;

    radiationField  G;

    probeLocations
    (
        (0.5 0.5 0.5)
    );
    fields
    (
        T
    );
}
Source files

Definition at line 101 of file thermoCoupleProbes.H.

Constructor & Destructor Documentation

◆ thermoCoupleProbes()

thermoCoupleProbes ( const word name,
const Time runTime,
const dictionary dict,
const bool  loadFromFiles = false,
const bool  readFields = true 
)

Construct for given objectRegistry and dictionary.

Allow the possibility to load fields from files

Definition at line 50 of file thermoCoupleProbes.C.

References dict, ODESolver::New(), Foam::read(), dictionary::readEntry(), and probes::sample().

Here is the call graph for this function:

◆ ~thermoCoupleProbes()

~thermoCoupleProbes ( )
virtual

Destructor.

Definition at line 91 of file thermoCoupleProbes.C.

Member Function Documentation

◆ sampleAndWrite()

void sampleAndWrite ( const GeometricField< Type, fvPatchField, volMesh > &  vField)
protected

Sample and write a particular volume field.

Definition at line 32 of file thermoCoupleProbesTemplates.C.

References Foam::endl(), forAll, and Foam::setw().

Here is the call graph for this function:

◆ TypeName()

TypeName ( "thermoCoupleProbes"  )

Runtime type information.

◆ nEqns()

Foam::label nEqns ( ) const
virtual

Number of ODE's to solve.

Implements ODESystem.

Definition at line 95 of file thermoCoupleProbes.C.

◆ derivatives()

void derivatives ( const scalar  x,
const scalarField y,
scalarField dydx 
) const
virtual

Calculate the derivatives in dydx.

Implements ODESystem.

Definition at line 102 of file thermoCoupleProbes.C.

References Foam::fieldTypes::area, Foam::constant::universal::G, Foam::mag(), Foam::max(), Foam::constant::mathematical::pi(), Foam::pow(), Foam::pow3(), Foam::pow4(), Pr(), Foam::Re(), probes::sample(), sigma(), Foam::constant::physicoChemical::sigma, Foam::sqr(), Foam::sqrt(), dimensioned< Type >::value(), Foam::fieldTypes::volume, y, and Foam::Zero.

Here is the call graph for this function:

◆ jacobian()

void jacobian ( const scalar  x,
const scalarField y,
scalarField dfdx,
scalarSquareMatrix dfdy 
) const
virtual

Calculate the Jacobian of the system.

Need by the stiff-system solvers

Implements ODESystem.

Definition at line 148 of file thermoCoupleProbes.C.

References n, x, and y.

◆ write()

bool write ( )
virtual

Sample and write.

Reimplemented from probes.

Definition at line 169 of file thermoCoupleProbes.C.

References dictionary::add().

Here is the call graph for this function:

◆ execute()

bool execute ( )
virtual

Execute, currently does nothing.

Reimplemented from probes.

Definition at line 185 of file thermoCoupleProbes.C.

◆ read()

bool read ( const dictionary dict)
virtual

Read.

Reimplemented from probes.

Definition at line 199 of file thermoCoupleProbes.C.

References dict, and probes::read().

Here is the call graph for this function:

Member Data Documentation

◆ rho_

scalar rho_
protected

Thermocouple density.

Definition at line 111 of file thermoCoupleProbes.H.

◆ Cp_

scalar Cp_
protected

Thermocouple heat capacity.

Definition at line 114 of file thermoCoupleProbes.H.

◆ d_

scalar d_
protected

Thermocouple diameter.

Definition at line 117 of file thermoCoupleProbes.H.

◆ epsilon_

scalar epsilon_
protected

Thermocouple emissivity.

Definition at line 120 of file thermoCoupleProbes.H.

◆ UName_

word UName_
protected

Name of the velocity field.

Definition at line 123 of file thermoCoupleProbes.H.

◆ radiationFieldName_

word radiationFieldName_
protected

Name of the incident radiation field.

Definition at line 126 of file thermoCoupleProbes.H.

◆ thermo_

const fluidThermo& thermo_
protected

Fluid thermo reference.

Definition at line 129 of file thermoCoupleProbes.H.

◆ odeSolver_

autoPtr<ODESolver> odeSolver_
protected

ODESolver.

Definition at line 132 of file thermoCoupleProbes.H.

◆ Ttc_

scalarField Ttc_
protected

Cached thermocouple temperature.

Definition at line 135 of file thermoCoupleProbes.H.


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