Files
CFDEMcoupling-PFM/applications/solvers/testTwoFluidRecurrenceTurbulence/createTransportFields.H
Gerhard Holzinger 82a80e1215 Recurrence-based turbulence: model and test-app
A base class for recurrence-based turbulence models was created. This class
holds a reference to the recurrenceModel in use.
Thus, turbulent fields can be updated from the data base.

The recurrence-based turbulence models are essentially re-implementations
of the respective standard turbulence models. In addition to being derived
from their respective base class, as mandated by OpenFOAM, each recurrence-based
turbulence model is derived from the class recurrenceTurbulenceModel.
This allows for making use of polymorphism on the recurrence-part of the
turbulence model, as after construction, the solver needs to pass the reference
to the recurrenceModel to the recurrence-based turbulence model.
2018-05-17 15:32:30 +02:00

80 lines
1.7 KiB
C

/* --------------------------------------------------------------------------------- */
/* read flotation properties */
/* --------------------------------------------------------------------------------- */
Info<< "Reading scalarTransportProperties\n" << endl;
IOdictionary scalarTransportProperties
(
IOobject
(
"scalarTransportProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
const scalar Sc(scalarTransportProperties.lookupOrDefault<scalar>("Sc",scalar(1.0)));
const word carrierPhaseName(scalarTransportProperties.lookup("carrierPhase"));
if (carrierPhaseName != phase1.name() && carrierPhaseName != phase2.name())
{
FatalError << "No valid carrier phase specified" << nl
<< "Valid phase names are: " << nl
<< phase1.name() << ", " << phase2.name()
<< abort(FatalError);
}
phaseModel& carrierPhase = (carrierPhaseName == phase1.name()) ? phase1 : phase2;
const word dispersePhaseName = (carrierPhaseName == phase1.name()) ? phase2.name() : phase1.name();
volScalarField& rhoCarrier = carrierPhase.thermo().rho();
volScalarField& alphaCarrier = carrierPhase;
surfaceScalarField& alphaRhoPhiCarrier = carrierPhase.alphaRhoPhi();
volScalarField contErrCarrier
(
"contErrCarrier",
fvc::ddt(alphaCarrier, rhoCarrier)
);
Info<< "Reading field C\n" << endl;
volScalarField C
(
IOobject
(
"C",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
volScalarField K
(
IOobject
(
"K",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
);