43 namespace functionObjects
66 const string& scopePrefix
71 if (idx < 0 && !scopePrefix.empty())
90 Foam::functionObjects::dsmcFields::dsmcFields
136 string scopePrefix =
".+[_:]";
148 #define doLocalCode(Name, FieldType, Member) \ 150 const FieldType* Member##Ptr = nullptr; \ 152 const word& fldName = \ 153 filteredName(Name, allMeanNames, scopePrefix); \ 155 if (!fldName.empty()) \ 157 Member##Ptr = obr_.cfindObject<FieldType>(fldName); \ 160 if (returnReduceOr(!Member##Ptr)) \ 162 Log << type() << ' ' << name() << " : no " << Name \ 163 << " field found - not calculating\n"; \ 168 const FieldType& Member = *Member##Ptr; 176 const scalar minval =
min(
mag(rhoNMean)).value();
178 if (minval <= VSMALL)
181 <<
" : Small value (" << minval <<
") in rhoNMean field" 182 <<
" - not calculating to avoid division by zero" <<
nl;
203 Log <<
"Calculating dsmcFields." <<
endl;
205 Log <<
" Calculating UMean field." <<
nl;
211 obr_.time().timeName(),
215 momentumMean/rhoMMean
218 Log <<
" Calculating translationalT field." <<
endl;
224 obr_.time().timeName(),
230 *(linearKEMean - 0.5*rhoMMean*(
UMean &
UMean))
233 Log <<
" Calculating internalT field." <<
endl;
239 obr_.time().timeName(),
246 Log <<
" Calculating overallT field." <<
endl;
252 obr_.time().timeName(),
257 *(linearKEMean - 0.5*rhoMMean*(
UMean &
UMean) + internalEMean)
260 Log <<
" Calculating pressure field." <<
endl;
266 obr_.time().timeName(),
275 forAll(mesh_.boundaryMesh(), i)
277 const polyPatch&
patch = mesh_.boundaryMesh()[i];
279 if (isA<wallPolyPatch>(
patch))
282 fDMean.boundaryField()[i]
290 Log <<
" mag(UMean) max/min : " 294 <<
" translationalT max/min : " 296 <<
min(translationalT).value() <<
nl 298 <<
" internalT max/min : " 300 <<
min(internalT).value() <<
nl 302 <<
" overallT max/min : " 304 <<
min(overallT).value() <<
nl 314 translationalT.write();
323 Log <<
"dsmcFields written." <<
nl <<
endl;
Different types of constants.
List< word > names(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
List of names generated by calling name() for each list item and filtered for matches.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label firstMatchingString(const UnaryMatchPredicate &matcher, const UList< StringType > &input, const bool invert=false)
Find first list item that matches, -1 on failure.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
regExpPosix regExp
Selection of preferred regular expression implementation.
volVectorField UMean(UMeanHeader, mesh)
Operations on lists of strings.
GeometricField< vector, fvPatchField, volMesh > volVectorField
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
virtual bool write()
Calculate and write the DSMC fields.
Macros for easy insertion into run-time selection tables.
bool read(const char *buf, int32_t &val)
Same as readInt32.
#define forAll(list, i)
Loop across all elements in list.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
virtual bool execute()
Do nothing.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
A class for handling words, derived from Foam::string.
static const word null
An empty word.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
label find(const T &val) const
Find index of the first occurrence of the value.
defineTypeNameAndDebug(combustionModel, 0)
static char scopeSeparator
Character for scoping object names (':' or '_')
const dimensionedScalar k
Boltzmann constant.
Wrapper around POSIX extended regular expressions with some additional prefix-handling. The prefix-handling is loosely oriented on PCRE regular expressions and provides a simple means of tuning the expressions.
const std::string patch
OpenFOAM patch number as a std::string.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
#define doLocalCode(Name, FieldType, Member)
virtual bool read(const dictionary &)
Read the dsmcFields data.
static const word & filteredName(const word &baseName, const wordList &names, const string &scopePrefix)
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)