116 using namespace Foam;
120 void InfoField(
const word& fldName)
122 Info<<
"Writing field: " << fldName <<
nl <<
endl;
131 fld.boundaryFieldRef().template evaluateCoupled<processorFvPatch>();
171 ).typeHeaderOk<IOdictionary>(
true)
202 #include "createPhi.H" 244 f.clamp_range(0, scalar(1) -
Foam::exp(-scalar(400)/scalar(50)));
250 int main(
int argc,
char *argv[])
254 "Sets initial turbulence fields based on" 255 " various empirical equations" 285 const scalar dPlusRef =
294 const bool initEpsilon =
315 tU.cref().boundaryField().size(),
316 fixedValueFvPatchScalarField::typeName
328 createIOobject(
mesh, epsilonName),
339 createIOobject(
mesh, kName),
350 createIOobject(
mesh, omegaName),
361 createIOobject(
mesh, RName),
384 fixedValueFvPatchScalarField::typeName
389 if (isA<wallFvPatch>(pfld.patch()))
438 const scalar
C = 7.8;
439 const scalar B1 = 11;
455 correctProcessorPatches(
U);
458 if (tepsilon.valid())
461 correctProcessorPatches(tepsilon.ref());
467 correctProcessorPatches(tk.
ref());
474 correctProcessorPatches(tomega.
ref());
485 R[celli] = Rdiag[celli];
487 correctProcessorPatches(
R);
497 InfoField(tU->name());
501 if (tepsilon.valid())
503 InfoField(tepsilon->name());
509 InfoField(tk->
name());
515 InfoField(tomega->
name());
521 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))
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)
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.
wallPoints::trackData td(isBlockedFace, regionToBlockSize)
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.
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 expressions::valueTypeCode::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...
Reading is optional [identical to LAZY_READ].
virtual bool write(const bool writeOnProc=true) const
Write using setting from DB.
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.
SolverPerformance< Type > solve(faMatrix< Type > &, const dictionary &solverControls)
Solve returning the solution statistics given convergence tolerance.
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 a time name for the given scalar time value 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.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
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)
messageStream Info
Information stream (stdout output on master, null elsewhere)
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...
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.
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.
Do not request registration (bool: false)
static constexpr const zero Zero
Global zero (0)
const dimensionSet dimVelocity
readOption
Enumeration defining read preferences.