116 using namespace Foam;
120 void InfoField(
const word& fldName)
122 Info<<
"Writing field: " << fldName <<
nl <<
endl;
127 void correctProcessorPatches
146 bf[patchi].initEvaluate();
154 bf[patchi].evaluate();
195 ).typeHeaderOk<IOdictionary>(
true)
226 #include "createPhi.H" 280 int main(
int argc,
char *argv[])
284 "Sets initial turbulence fields based on" 285 " various empirical equations" 315 const scalar dPlusRef =
324 const bool initEpsilon =
345 tU.cref().boundaryField().size(),
346 fixedValueFvPatchScalarField::typeName
358 createIOobject(
mesh, epsilonName),
369 createIOobject(
mesh, kName),
380 createIOobject(
mesh, omegaName),
391 createIOobject(
mesh, RName),
419 if (isA<wallFvPatch>(pfld.patch()))
468 const scalar
C = 7.8;
469 const scalar B1 = 11;
485 correctProcessorPatches<vector>(
U);
488 if (tepsilon.valid())
491 correctProcessorPatches<scalar>(tepsilon.ref());
497 correctProcessorPatches<scalar>(tk.
ref());
504 correctProcessorPatches<scalar>(tomega.
ref());
515 R[celli] = Rdiag[celli];
517 correctProcessorPatches<symmTensor>(
R);
527 InfoField(tU->name());
531 if (tepsilon.valid())
533 InfoField(tepsilon->name());
539 InfoField(tk->
name());
545 InfoField(tomega->
name());
551 InfoField(tR->
name());
word dictName() const
The local dictionary name (final part of scoped name)
Info<< "Reading thermophysical properties\"<< endl;autoPtr< psiReactionThermo > pThermo(psiReactionThermo::New(mesh))
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
bool valid() const noexcept
Identical to good(), or bool operator.
static void noFunctionObjects(bool addWithOption=false)
Remove '-noFunctionObjects' option and ignore any occurrences.
Graphite solid properties.
static void addNote(const string ¬e)
Add extra notes for the usage information.
static const sphericalTensor twoThirdsI(2.0/3.0)
MinMax< scalar > scalarMinMax
A scalar min/max range.
SolverPerformance< Type > solve(faMatrix< Type > &, const dictionary &)
Solve returning the solution statistics given convergence tolerance.
dimensionedScalar log(const dimensionedScalar &ds)
static autoPtr< fluidThermo > New(const fvMesh &, const word &phaseName=word::null)
Selector.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
const vector L(dict.get< vector >("L"))
const word UName(propsDict.getOrDefault< word >("U", "U"))
const word & name() const noexcept
Return the object name.
T & ref() const
Return non-const reference to the contents of a non-null managed pointer.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
constexpr char nl
The newline '\n' character (0x0a)
T getCheck(const word &keyword, const Predicate &pred, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T with additional checking FatalIOError if not found, or if the number of tokens is...
const word dictName("faMeshDefinition")
static autoPtr< IncompressibleTurbulenceModel > New(const volVectorField &U, const surfaceScalarField &phi, const TransportModel &transportModel, const word &propertiesName=turbulenceModel::propertiesName)
Return a reference to the selected turbulence model.
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
const T & cref() const
Return const reference to the object or to the contents of a (non-null) managed pointer.
static bool & parRun() noexcept
Test if this a parallel run.
static unsigned int defaultPrecision() noexcept
Return the default precision.
Generic GeometricField class.
label k
Boltzmann constant.
Generic dimensioned Type class.
Ignore writing from objectRegistry::writeObject()
const dimensionSet dimless
Dimensionless.
const Time & time() const
Return the top-level database.
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
#define forAll(list, i)
Loop across all elements in list.
singlePhaseTransportModel laminarTransport(U, phi)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
dimensionedScalar exp(const dimensionedScalar &ds)
A class for handling words, derived from Foam::string.
Fundamental fluid thermodynamic properties.
static MinMax< scalar > ge(const scalar &minVal)
A semi-infinite range from minVal to the type max.
T getCheckOrDefault(const word &keyword, const T &deflt, const Predicate &pred, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T, or return the given default value. FatalIOError if it is found and the number of...
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
zeroField Sp(const Foam::zero, const GeometricField< Type, fvPatchField, volMesh > &)
A no-op source.
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
static word timeName(const scalar t, const int precision=precision_)
Return time name of given scalar time formatted with the given precision.
const word & constant() const noexcept
Return constant name.
Info<< "Reading field U\"<< endl;volVectorField U(IOobject("U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);volScalarField rho(IOobject("rho", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), thermo.rho());volVectorField rhoU(IOobject("rhoU", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *U);volScalarField rhoE(IOobject("rhoE", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE), rho *(e+0.5 *magSqr(U)));surfaceScalarField pos(IOobject("pos", runTime.timeName(), mesh), mesh, dimensionedScalar("pos", dimless, 1.0));surfaceScalarField neg(IOobject("neg", runTime.timeName(), mesh), mesh, dimensionedScalar("neg", dimless, -1.0));surfaceScalarField phi("phi", fvc::flux(rhoU));Info<< "Creating turbulence model\"<< endl;autoPtr< compressible::turbulenceModel > turbulence(compressible::turbulenceModel::New(rho, U, phi, thermo))
Ostream & printExecutionTime(OSstream &os) const
Print the elapsed ExecutionTime (cpu-time), ClockTime.
dimensioned< symmTensor > dimensionedSymmTensor
Dimensioned tensor obtained from generic dimensioned type.
static autoPtr< ThermalDiffusivity > New(const alphaField &alpha, const volScalarField &rho, const volVectorField &U, const surfaceScalarField &alphaRhoPhi, const surfaceScalarField &phi, const transportModel &transportModel, const word &propertiesName=turbulenceModel::propertiesName)
Return a reference to the selected turbulence model.
dimensionedScalar pow3(const dimensionedScalar &ds)
#define R(A, B, C, D, E, F, K, M)
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
tmp< fvMatrix< Type > > laplacian(const GeometricField< Type, fvPatchField, volMesh > &vf, const word &name)
Mesh data needed to do the Finite Volume discretisation.
dimensionedScalar pow4(const dimensionedScalar &ds)
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
messageStream Info
Information stream (stdout output on master, null elsewhere)
This boundary condition enables processor communication across patches.
void clear() const noexcept
If object pointer points to valid object: delete object and set pointer to nullptr.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
const Type * isA(const U &obj)
Check if dynamic_cast to Type is possible.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T, or return the given default value. FatalIOError if it is found and the number of...
A class for managing temporary objects.
virtual bool write(const bool valid=true) const
Write using setting from DB.
A simple single-phase transport model based on viscosityModel.
Defines the attributes of an object for which implicit objectRegistry management is supported...
Creates and initialises the face-flux field phi.
static constexpr const zero Zero
Global zero (0)
const dimensionSet dimVelocity
readOption
Enumeration defining read preferences.