COMP: Multiple changes - first clean build after latest merge - UNTESTED

This commit is contained in:
Andrew Heather
2016-09-23 15:36:53 +01:00
parent 9fbd612672
commit b9940cbbb1
311 changed files with 4119 additions and 6540 deletions

View File

@ -28,9 +28,9 @@ Group
grpBasicSolvers grpBasicSolvers
Description Description
Potential flow solver which solves for the velocity potential Potential flow solver which solves for the velocity potential, to
from which the flux-field is obtained and velocity field by reconstructing calculate the flux-field, from which the velocity field is obtained by
the flux. reconstructing the flux.
\heading Solver details \heading Solver details
The potential flow solution is typically employed to generate initial fields The potential flow solution is typically employed to generate initial fields

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -67,25 +67,26 @@ Description
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
#include "setRootCase.H" #include "postProcess.H"
#include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
#include "createDynamicFvMesh.H" #include "createDynamicFvMesh.H"
#include "initContinuityErrs.H" #include "createControl.H"
pimpleControl pimple(mesh);
#include "readCombustionProperties.H" #include "readCombustionProperties.H"
#include "readGravitationalAcceleration.H" #include "readGravitationalAcceleration.H"
#include "createFields.H" #include "createFields.H"
#include "createMRF.H" #include "createFieldRefs.H"
#include "createFvOptions.H" #include "createFvOptions.H"
#include "initContinuityErrs.H"
#include "createRhoUf.H" #include "createRhoUf.H"
#include "createControls.H" #include "createControls.H"
#include "initContinuityErrs.H" #include "initContinuityErrs.H"
#include "compressibleCourantNo.H" #include "compressibleCourantNo.H"
#include "setInitialDeltaT.H" #include "setInitialDeltaT.H"
turbulence->validate();
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl; Info<< "\nStarting time loop\n" << endl;

View File

@ -1,7 +1,6 @@
#include "readTimeControls.H" #include "readTimeControls.H"
bool correctPhi = correctPhi = pimple.dict().lookupOrDefault<Switch>("correctPhi", true);
pimple.dict().lookupOrDefault<Switch>("correctPhi", true);
bool checkMeshCourantNo = checkMeshCourantNo =
pimple.dict().lookupOrDefault<Switch>("checkMeshCourantNo", false); pimple.dict().lookupOrDefault<Switch>("checkMeshCourantNo", false);

View File

@ -18,8 +18,6 @@ volScalarField rho
); );
volScalarField& p = thermo.p(); volScalarField& p = thermo.p();
const volScalarField& psi = thermo.psi();
Info<< "Reading field U\n" << endl; Info<< "Reading field U\n" << endl;
volVectorField U volVectorField U

View File

@ -41,8 +41,6 @@
p_rghDDtEqn = p_rghDDtEqn =
( (
fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh)) fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh))
==
fvOptions(psi, p_rgh, rho.name())
); );
} }
@ -53,6 +51,8 @@
p_rghDDtEqn() p_rghDDtEqn()
+ fvc::div(phiHbyA) + fvc::div(phiHbyA)
- fvm::laplacian(rhorAUf, p_rgh) - fvm::laplacian(rhorAUf, p_rgh)
==
fvOptions(psi, p_rgh, rho.name())
); );
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter()))); p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));

View File

@ -11,7 +11,7 @@ IOobject turbulencePropertiesHeader
false false
); );
if (turbulencePropertiesHeader.headerOk()) if (turbulencePropertiesHeader.typeHeaderOk<IOdictionary>(false))
{ {
autoPtr<compressible::turbulenceModel> turbulence autoPtr<compressible::turbulenceModel> turbulence
( (

View File

@ -0,0 +1,33 @@
{
volScalarField& he = thermo.he();
fvScalarMatrix EEqn
(
mvConvection->fvmDiv(phi, he)
+ (
he.name() == "e"
? fvc::div(phi, volScalarField("Ekp", 0.5*magSqr(U) + p/rho))
: fvc::div(phi, volScalarField("K", 0.5*magSqr(U)))
)
- fvm::laplacian(turbulence->alphaEff(), he)
==
rho*(U&g)
+ parcels.Sh(he)
+ radiation->Sh(thermo)
+ combustion->Sh()
+ fvOptions(rho, he)
);
EEqn.relax();
fvOptions.constrain(EEqn);
EEqn.solve();
fvOptions.correct(he);
thermo.correct();
radiation->correct();
Info<< "T gas min/max = " << min(T).value() << ", "
<< max(T).value() << endl;
}

View File

@ -24,8 +24,7 @@ EXE_INC = \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
-I$(LIB_SRC)/combustionModels/lnInclude \ -I$(LIB_SRC)/combustionModels/lnInclude \
-I$(LIB_SRC)/fvOptions/lnInclude \ -I$(LIB_SRC)/fvOptions/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude
-I$(FOAM_SOLVERS)/lagrangian/reactingParcelFoam/simpleReactingParcelFoam
EXE_LIBS = \ EXE_LIBS = \

View File

@ -0,0 +1,21 @@
MRF.correctBoundaryVelocity(U);
tmp<fvVectorMatrix> tUEqn
(
fvm::div(phi, U)
+ MRF.DDt(rho, U)
+ turbulence->divDevRhoReff(U)
==
rho()*g
+ parcels.SU(U)
+ fvOptions(rho, U)
);
fvVectorMatrix& UEqn = tUEqn.ref();
UEqn.relax();
fvOptions.constrain(UEqn);
solve(UEqn == -fvc::grad(p));
fvOptions.correct(U);

View File

@ -0,0 +1,48 @@
tmp<fv::convectionScheme<scalar>> mvConvection
(
fv::convectionScheme<scalar>::New
(
mesh,
fields,
phi,
mesh.divScheme("div(phi,Yi_h)")
)
);
{
combustion->correct();
dQ = combustion->dQ();
volScalarField Yt(0.0*Y[0]);
forAll(Y, i)
{
if (i != inertIndex && composition.active(i))
{
volScalarField& Yi = Y[i];
fvScalarMatrix YEqn
(
mvConvection->fvmDiv(phi, Yi)
- fvm::laplacian(turbulence->muEff(), Yi)
==
parcels.SYi(i, Yi)
+ combustion->R(Yi)
+ fvOptions(rho, Yi)
);
YEqn.relax();
fvOptions.constrain(YEqn);
YEqn.solve(mesh.solver("Yi"));
fvOptions.correct(Yi);
Yi.max(0.0);
Yt += Yi;
}
}
Y[inertIndex] = scalar(1) - Yt;
Y[inertIndex].max(0.0);
}

View File

@ -0,0 +1,3 @@
const volScalarField& psi = thermo.psi();
const volScalarField& T = thermo.T();
const label inertIndex(composition.species()[inertSpecie]);

View File

@ -0,0 +1,122 @@
#include "readGravitationalAcceleration.H"
Info<< "Creating combustion model\n" << endl;
autoPtr<combustionModels::rhoCombustionModel> combustion
(
combustionModels::rhoCombustionModel::New(mesh)
);
rhoReactionThermo& thermo = combustion->thermo();
thermo.validate(args.executable(), "h", "e");
SLGThermo slgThermo(mesh, thermo);
basicSpecieMixture& composition = thermo.composition();
PtrList<volScalarField>& Y = composition.Y();
const word inertSpecie(thermo.lookup("inertSpecie"));
if (!composition.species().found(inertSpecie))
{
FatalIOErrorIn(args.executable().c_str(), thermo)
<< "Inert specie " << inertSpecie << " not found in available species "
<< composition.species()
<< exit(FatalIOError);
}
volScalarField& p = thermo.p();
volScalarField rho
(
IOobject
(
"rho",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
thermo.rho()
);
Info<< "\nReading field U\n" << endl;
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
#include "compressibleCreatePhi.H"
mesh.setFluxRequired(p.name());
dimensionedScalar rhoMax
(
dimensionedScalar::lookupOrDefault
(
"rhoMax",
simple.dict(),
dimDensity,
GREAT
)
);
dimensionedScalar rhoMin
(
dimensionedScalar::lookupOrDefault
(
"rhoMin",
simple.dict(),
dimDensity,
0
)
);
Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::turbulenceModel> turbulence
(
compressible::turbulenceModel::New
(
rho,
U,
phi,
thermo
)
);
// Set the turbulence into the combustion model
combustion->setTurbulence(turbulence());
Info<< "Creating multi-variate interpolation scheme\n" << endl;
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
forAll(Y, i)
{
fields.add(Y[i]);
}
fields.add(thermo.he());
volScalarField dQ
(
IOobject
(
"dQ",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
);
#include "createMRF.H"
#include "createRadiationModel.H"
#include "createClouds.H"

View File

@ -0,0 +1,57 @@
{
// Thermodynamic density needs to be updated by psi*d(p) after the
// pressure solution - done in 2 parts. Part 1:
thermo.rho() -= psi*p;
volScalarField rAU(1.0/UEqn.A());
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
tUEqn.clear();
surfaceScalarField phiHbyA
(
"phiHbyA",
fvc::interpolate(rho)*fvc::flux(HbyA)
);
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
// Update the pressure BCs to ensure flux consistency
constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF);
while (simple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
fvc::div(phiHbyA)
- fvm::laplacian(rhorAUf, p)
==
parcels.Srho()
+ fvOptions(psi, p, rho.name())
);
pEqn.solve();
if (simple.finalNonOrthogonalIter())
{
phi = phiHbyA + pEqn.flux();
}
}
p.relax();
// Second part of thermodynamic density update
thermo.rho() += psi*p;
#include "compressibleContinuityErrs.H"
U = HbyA - rAU*fvc::grad(p);
U.correctBoundaryConditions();
fvOptions.correct(U);
rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.relax();
Info<< "p min/max = " << min(p).value() << ", " << max(p).value() << endl;
}

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenCFD Ltd. \\ / A nd | Copyright (C) 2015-2016 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -24,13 +24,12 @@ License
Application Application
simpleReactingParcelFoam simpleReactingParcelFoam
Description Group
Steady state SIMPLE solver for laminar or turbulent flow with coal grpLagrangianSolvers
Lagrangian parcels.
Note: Description
- including run-time selectable finite volume options,e.g. sources, Steady state solver for compressible, turbulent flow with coal particle
constraints clouds and optional sources/constraints.
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -49,21 +48,19 @@ Description
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
#include "setRootCase.H" #include "postProcess.H"
#include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
#include "createMesh.H" #include "createMesh.H"
#include "readGravitationalAcceleration.H" #include "createControl.H"
simpleControl simple(mesh);
#include "createFields.H" #include "createFields.H"
#include "createRadiationModel.H" #include "createFieldRefs.H"
#include "createClouds.H"
#include "createMRF.H"
#include "createFvOptions.H" #include "createFvOptions.H"
#include "initContinuityErrs.H" #include "initContinuityErrs.H"
turbulence->validate();
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl; Info<< "\nStarting time loop\n" << endl;

View File

@ -32,6 +32,15 @@ License
#include "turbulentTransportModel.H" #include "turbulentTransportModel.H"
#include "LESModel.H" #include "LESModel.H"
makeTurbulenceModelTypes
(
volScalarField,
geometricOneField,
incompressibleTurbulenceModel,
PhaseCompressibleTurbulenceModel,
immiscibleIncompressibleTwoPhaseMixture
);
makeBaseTurbulenceModel makeBaseTurbulenceModel
( (
volScalarField, volScalarField,

View File

@ -30,7 +30,7 @@ Description
The momentum and other fluid properties are of the "mixture" and a single The momentum and other fluid properties are of the "mixture" and a single
momentum equation is solved. momentum equation is solved.
It includes MRF and MPPIC clouds It includes MRF and an MPPIC cloud.
Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected. Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
@ -53,26 +53,22 @@ Description
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
#include "postProcess.H"
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
#include "createMesh.H" #include "createMesh.H"
#include "createControl.H"
pimpleControl pimple(mesh);
#include "createTimeControls.H"
#include "initContinuityErrs.H" #include "initContinuityErrs.H"
#include "createFields.H" #include "createFields.H"
#include "createMRF.H"
#include "createFvOptions.H" #include "createFvOptions.H"
#include "createTimeControls.H"
#include "correctPhi.H" #include "correctPhi.H"
turbulence->validate();
#include "readTimeControls.H"
#include "CourantNo.H" #include "CourantNo.H"
#include "setInitialDeltaT.H" #include "setInitialDeltaT.H"
turbulence->validate();
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl; Info<< "\nStarting time loop\n" << endl;
@ -126,7 +122,7 @@ int main(int argc, char *argv[])
zeroGradientFvPatchVectorField::typeName zeroGradientFvPatchVectorField::typeName
); );
cloudVolSUSu.internalField() = -cloudSU.source()/mesh.V(); cloudVolSUSu.primitiveFieldRef() = -cloudSU.source()/mesh.V();
cloudVolSUSu.correctBoundaryConditions(); cloudVolSUSu.correctBoundaryConditions();
cloudSU.source() = vector::zero; cloudSU.source() = vector::zero;

View File

@ -1,6 +1,7 @@
interFoamPath = $(FOAM_SOLVERS)/multiphase/interFoam interFoamPath = $(FOAM_SOLVERS)/multiphase/interFoam
EXE_INC = \ EXE_INC = \
-I. \
-I./IncompressibleTwoPhaseMixtureTurbulenceModels/lnInclude \ -I./IncompressibleTwoPhaseMixtureTurbulenceModels/lnInclude \
-I$(interFoamPath) \ -I$(interFoamPath) \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \

View File

@ -17,9 +17,10 @@
// Do not compress interface at non-coupled boundary faces // Do not compress interface at non-coupled boundary faces
// (inlets, outlets etc.) // (inlets, outlets etc.)
surfaceScalarField::Boundary& phicBf = phic.boundaryFieldRef();
forAll(phic.boundaryField(), patchi) forAll(phic.boundaryField(), patchi)
{ {
fvsPatchScalarField& phicp = phic.boundaryField()[patchi]; fvsPatchScalarField& phicp = phicBf[patchi];
if (!phicp.coupled()) if (!phicp.coupled())
{ {

View File

@ -217,3 +217,5 @@
mixture mixture
) )
); );
#include "createMRF.H"

View File

@ -42,7 +42,7 @@ namespace Foam
void Foam::twoPhaseMixtureEThermo::eBoundaryCorrection(volScalarField& h) void Foam::twoPhaseMixtureEThermo::eBoundaryCorrection(volScalarField& h)
{ {
volScalarField::GeometricBoundaryField& hbf = h.boundaryField(); volScalarField::Boundary& hbf = h.boundaryFieldRef();
forAll(hbf, patchi) forAll(hbf, patchi)
{ {
@ -59,6 +59,7 @@ void Foam::twoPhaseMixtureEThermo::eBoundaryCorrection(volScalarField& h)
} }
} }
void Foam::twoPhaseMixtureEThermo::init() void Foam::twoPhaseMixtureEThermo::init()
{ {
const volScalarField alpha1Rho1(alpha1()*rho1()); const volScalarField alpha1Rho1(alpha1()*rho1());
@ -74,6 +75,7 @@ void Foam::twoPhaseMixtureEThermo::init()
e_.correctBoundaryConditions(); e_.correctBoundaryConditions();
} }
// * * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * //
Foam::twoPhaseMixtureEThermo::twoPhaseMixtureEThermo Foam::twoPhaseMixtureEThermo::twoPhaseMixtureEThermo
@ -117,11 +119,13 @@ Foam::twoPhaseMixtureEThermo::twoPhaseMixtureEThermo
init(); init();
} }
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::twoPhaseMixtureEThermo::~twoPhaseMixtureEThermo() Foam::twoPhaseMixtureEThermo::~twoPhaseMixtureEThermo()
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::twoPhaseMixtureEThermo::correct() void Foam::twoPhaseMixtureEThermo::correct()
@ -226,10 +230,8 @@ Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureEThermo::he
} }
Foam::tmp<Foam::volScalarField> Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureEThermo::hc() const
Foam::twoPhaseMixtureEThermo::hc() const
{ {
const fvMesh& mesh = this->T_.mesh(); const fvMesh& mesh = this->T_.mesh();
return tmp<volScalarField> return tmp<volScalarField>
@ -277,8 +279,7 @@ Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureEThermo::THE
} }
Foam::tmp<Foam::volScalarField> Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureEThermo::Cp() const
Foam::twoPhaseMixtureEThermo::Cp() const
{ {
const volScalarField limitedAlpha1 const volScalarField limitedAlpha1
( (
@ -317,8 +318,7 @@ Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureEThermo::Cp
} }
Foam::tmp<Foam::volScalarField> Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureEThermo::rho() const
Foam::twoPhaseMixtureEThermo::rho() const
{ {
const volScalarField limitedAlpha1 const volScalarField limitedAlpha1
( (
@ -337,8 +337,7 @@ Foam::twoPhaseMixtureEThermo::rho() const
} }
Foam::tmp<Foam::scalarField> Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureEThermo::rho
Foam::twoPhaseMixtureEThermo::rho
( (
const label patchi const label patchi
) const ) const
@ -357,8 +356,7 @@ Foam::twoPhaseMixtureEThermo::rho
} }
Foam::tmp<Foam::volScalarField> Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureEThermo::Cv() const
Foam::twoPhaseMixtureEThermo::Cv() const
{ {
const volScalarField limitedAlpha1 const volScalarField limitedAlpha1
( (
@ -376,8 +374,7 @@ Foam::twoPhaseMixtureEThermo::Cv() const
} }
Foam::tmp<Foam::scalarField> Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureEThermo::Cv
Foam::twoPhaseMixtureEThermo::Cv
( (
const scalarField& p, const scalarField& p,
const scalarField& T, const scalarField& T,
@ -398,8 +395,7 @@ Foam::twoPhaseMixtureEThermo::Cv
} }
Foam::tmp<Foam::volScalarField> Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureEThermo::gamma() const
Foam::twoPhaseMixtureEThermo::gamma() const
{ {
return tmp<volScalarField> return tmp<volScalarField>
( (
@ -422,8 +418,7 @@ Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureEThermo::gamma
} }
Foam::tmp<Foam::volScalarField> Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureEThermo::Cpv() const
Foam::twoPhaseMixtureEThermo::Cpv() const
{ {
// This is an e thermo (Cpv = Cv) // This is an e thermo (Cpv = Cv)
return Cv(); return Cv();
@ -442,16 +437,14 @@ Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureEThermo::Cpv
} }
Foam::tmp<Foam::volScalarField> Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureEThermo::CpByCpv() const
Foam::twoPhaseMixtureEThermo::CpByCpv() const
{ {
NotImplemented; NotImplemented;
return tmp<Foam::volScalarField>(); return tmp<Foam::volScalarField>();
} }
Foam::tmp<Foam::scalarField> Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureEThermo::CpByCpv
Foam::twoPhaseMixtureEThermo::CpByCpv
( (
const scalarField& p, const scalarField& p,
const scalarField& T, const scalarField& T,
@ -463,8 +456,7 @@ Foam::twoPhaseMixtureEThermo::CpByCpv
} }
Foam::tmp<Foam::volScalarField> Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureEThermo::kappa() const
Foam::twoPhaseMixtureEThermo::kappa() const
{ {
const volScalarField limitedAlpha1 const volScalarField limitedAlpha1
( (
@ -482,8 +474,10 @@ Foam::twoPhaseMixtureEThermo::kappa() const
} }
Foam::tmp<Foam::scalarField> Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureEThermo::kappa
Foam::twoPhaseMixtureEThermo::kappa(const label patchi) const (
const label patchi
) const
{ {
const volScalarField limitedAlpha1 const volScalarField limitedAlpha1
( (
@ -496,8 +490,7 @@ Foam::twoPhaseMixtureEThermo::kappa(const label patchi) const
} }
Foam::tmp<Foam::volScalarField> Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureEThermo::kappaEff
Foam::twoPhaseMixtureEThermo::kappaEff
( (
const volScalarField& kappat const volScalarField& kappat
) const ) const
@ -508,8 +501,7 @@ Foam::twoPhaseMixtureEThermo::kappaEff
} }
Foam::tmp<Foam::scalarField> Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureEThermo::kappaEff
Foam::twoPhaseMixtureEThermo::kappaEff
( (
const scalarField& kappat, const scalarField& kappat,
const label patchi const label patchi
@ -528,8 +520,7 @@ Foam::twoPhaseMixtureEThermo::kappaEff
} }
Foam::tmp<Foam::volScalarField> Foam::tmp<Foam::volScalarField> Foam::twoPhaseMixtureEThermo::alphaEff
Foam::twoPhaseMixtureEThermo::alphaEff
( (
const volScalarField& alphat const volScalarField& alphat
) const ) const
@ -539,12 +530,11 @@ Foam::twoPhaseMixtureEThermo::alphaEff
alpha1_*rho1() + (1.0 - alpha1_)*rho2() alpha1_*rho1() + (1.0 - alpha1_)*rho2()
); );
return (kappa()/Cp()/rho + alphat); return (kappa()/Cp()/rho + alphat);
} }
Foam::tmp<Foam::scalarField>
Foam::twoPhaseMixtureEThermo::alphaEff Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureEThermo::alphaEff
( (
const scalarField& alphat, const scalarField& alphat,
const label patchi const label patchi
@ -575,6 +565,7 @@ Foam::twoPhaseMixtureEThermo::alphaEff
return kappa/Cp/rho + alphat; return kappa/Cp/rho + alphat;
} }
bool Foam::twoPhaseMixtureEThermo::read() bool Foam::twoPhaseMixtureEThermo::read()
{ {
if (basicThermo::read() && thermoIncompressibleTwoPhaseMixture::read()) if (basicThermo::read() && thermoIncompressibleTwoPhaseMixture::read())
@ -589,4 +580,5 @@ bool Foam::twoPhaseMixtureEThermo::read()
} }
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -12,7 +12,7 @@ EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude -I$(LIB_SRC)/meshTools/lnInclude
LIB_LIBS = \ LIB_LIBS = \
-lcompressibleTurbulenceModels -lcompressibleTurbulenceModels \
-lreactingPhaseSystem \ -lreactingPhaseSystem \
-lreactingMultiphaseSystem \ -lreactingMultiphaseSystem \
-lreactingEulerianInterfacialModels \ -lreactingEulerianInterfacialModels \

View File

@ -1,4 +1,4 @@
autoRefineMesh.C snappyRefineMesh.C
EXE = $(FOAM_APPBIN)/autoRefineMesh EXE = $(FOAM_APPBIN)/snappyRefineMesh

View File

@ -1316,14 +1316,14 @@ int main(int argc, char *argv[])
Info<< surfaces.names()[surfi] << ':' << nl << nl; Info<< surfaces.names()[surfi] << ':' << nl << nl;
const word& fzName = surfaces.surfZones()[surfI].faceZoneName(); const word& fzName = surfaces.surfZones()[surfi].faceZoneName();
if (fzName.empty()) if (fzName.empty())
{ {
// 'Normal' surface // 'Normal' surface
forAll(regNames, i) forAll(regNames, i)
{ {
label globalRegioni = surfaces.globalRegion(surfI, i); label globalRegioni = surfaces.globalRegion(surfi, i);
label patchi; label patchi;

View File

@ -392,7 +392,7 @@ Foam::label Foam::checkTopology
// Already marked // Already marked
regionDisconnected[regioni] = false; regionDisconnected[regioni] = false;
} }
else if (pRegion != regionI) else if (pRegion != regioni)
{ {
// Multiple regions // Multiple regions
regionDisconnected[regioni] = false; regionDisconnected[regioni] = false;

View File

@ -326,7 +326,7 @@ int main(int argc, char *argv[])
// Create mesh subsetting engine // Create mesh subsetting engine
fvMeshSubset subsetter(mesh); fvMeshSubset subsetter(mesh);
label patchi = -1; labelList exposedPatchIDs;
if (args.optionFound("patch")) if (args.optionFound("patch"))
{ {

View File

@ -1,11 +0,0 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
if [ -f "$FFTW_ARCH_PATH/include/fftw3.h" ] || \
[ "${FFTW_ARCH_PATH##*-}" = system -a -f "/usr/include/fftw3.h" ]
then
export LINK_FLAGS="-lrandomProcesses"
fi
wmake
#------------------------------------------------------------------------------

View File

@ -1151,10 +1151,6 @@ int main(int argc, char *argv[])
// For the first region of a multi-region case additionally // For the first region of a multi-region case additionally
// decompose the "uniform" directory in the time directory // decompose the "uniform" directory in the time directory
if (regionNames.size() > 1 && regioni == 0) if (regionNames.size() > 1 && regioni == 0)
// If no fields have been decomposed the destination
// directory will not have been created so make sure.
mkDir(timePath);
{ {
decomposeUniform(copyUniform, mesh, processorDb); decomposeUniform(copyUniform, mesh, processorDb);
} }

View File

@ -615,7 +615,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
label zonei = faceToZone[curF]; label zonei = faceToZone[curF];
if (zoneI >= 0) if (zonei >= 0)
{ {
// Single zone. Add the face // Single zone. Add the face
zoneFaces[zonei].append(facei); zoneFaces[zonei].append(facei);

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -125,12 +125,8 @@ Foam::parFvFieldReconstructor::reconstructFvVolumeField
PtrList<fvPatchField<Type>> patchFields(fld.mesh().boundary().size()); PtrList<fvPatchField<Type>> patchFields(fld.mesh().boundary().size());
const typename GeometricField const typename GeometricField<Type, fvPatchField, volMesh>::Boundary&
< bfld = fld.boundaryField();
Type,
fvPatchField,
volMesh
>::GeometricBoundaryField& bfld = fld.boundaryField();
forAll(bfld, patchI) forAll(bfld, patchI)
{ {
@ -292,12 +288,8 @@ Foam::parFvFieldReconstructor::reconstructFvSurfaceField
PtrList<fvsPatchField<Type>> patchFields(fld.mesh().boundary().size()); PtrList<fvsPatchField<Type>> patchFields(fld.mesh().boundary().size());
const typename GeometricField const typename GeometricField<Type, fvsPatchField, surfaceMesh>::Boundary&
< bfld = fld.boundaryField();
Type,
fvsPatchField,
surfaceMesh
>::GeometricBoundaryField& bfld = fld.boundaryField();
forAll(bfld, patchI) forAll(bfld, patchI)
{ {

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -716,8 +716,7 @@ void correctCoupledBoundaryConditions(fvMesh& mesh)
{ {
GeoField& fld = *iter(); GeoField& fld = *iter();
typename GeoField::GeometricBoundaryField& bfld = typename GeoField::Boundary& bfld = fld.boundaryFieldRef();
fld.boundaryField();
if if
( (
Pstream::defaultCommsType == Pstream::blocking Pstream::defaultCommsType == Pstream::blocking
@ -728,7 +727,7 @@ void correctCoupledBoundaryConditions(fvMesh& mesh)
forAll(bfld, patchi) forAll(bfld, patchi)
{ {
typename GeoField::PatchFieldType& pfld = bfld[patchi]; typename GeoField::Patch& pfld = bfld[patchi];
//if (pfld.coupled()) //if (pfld.coupled())
//if (isA<CoupledPatchType>(pfld)) //if (isA<CoupledPatchType>(pfld))
@ -750,7 +749,7 @@ void correctCoupledBoundaryConditions(fvMesh& mesh)
forAll(bfld, patchi) forAll(bfld, patchi)
{ {
typename GeoField::PatchFieldType& pfld = bfld[patchi]; typename GeoField::Patch& pfld = bfld[patchi];
//if (pfld.coupled()) //if (pfld.coupled())
//if (isA<CoupledPatchType>(pfld)) //if (isA<CoupledPatchType>(pfld))
@ -768,7 +767,7 @@ void correctCoupledBoundaryConditions(fvMesh& mesh)
forAll(patchSchedule, patchEvali) forAll(patchSchedule, patchEvali)
{ {
label patchi = patchSchedule[patchEvali].patch; label patchi = patchSchedule[patchEvali].patch;
typename GeoField::PatchFieldType& pfld = bfld[patchi]; typename GeoField::Patch& pfld = bfld[patchi];
//if (pfld.coupled()) //if (pfld.coupled())
//if (isA<CoupledPatchType>(pfld)) //if (isA<CoupledPatchType>(pfld))

View File

@ -70,12 +70,7 @@ tmp<GeometricField<Type, fvPatchField, volMesh>>
volField volField
( (
const fvMeshSubset& meshSubsetter, const fvMeshSubset& meshSubsetter,
const typename GeometricField const typename GeometricField<Type, fvPatchField, volMesh>::Internal& df
<
Type,
fvPatchField,
volMesh
>::DimensionedInternalField& df
) )
{ {
// Construct volField (with zeroGradient) from dimensioned field // Construct volField (with zeroGradient) from dimensioned field
@ -93,7 +88,7 @@ volField
zeroGradientFvPatchField<scalar>::typeName zeroGradientFvPatchField<scalar>::typeName
) )
); );
tvf.ref().internalField() = df; tvf.ref().primitiveFieldRef() = df;
tvf.ref().correctBoundaryConditions(); tvf.ref().correctBoundaryConditions();
const GeometricField<Type, fvPatchField, volMesh>& vf = tvf(); const GeometricField<Type, fvPatchField, volMesh>& vf = tvf();

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -60,7 +60,7 @@ volField
Type, Type,
Foam::fvPatchField, Foam::fvPatchField,
Foam::volMesh Foam::volMesh
>::DimensionedInternalField& df >::Internal& df
); );

View File

@ -186,11 +186,11 @@ int main(int argc, char *argv[])
volSymmTensorField::typeName, volSymmTensorField::typeName,
volTensorField::typeName, volTensorField::typeName,
volScalarField::DimensionedInternalField::typeName, volScalarField::Internal::typeName,
volVectorField::DimensionedInternalField::typeName, volVectorField::Internal::typeName,
volSphericalTensorField::DimensionedInternalField::typeName, volSphericalTensorField::Internal::typeName,
volSymmTensorField::DimensionedInternalField::typeName, volSymmTensorField::Internal::typeName,
volTensorField::DimensionedInternalField::typeName volTensorField::Internal::typeName
}; };
// Path to EnSight directory at case level only // Path to EnSight directory at case level only
@ -562,15 +562,10 @@ int main(int argc, char *argv[])
// DimensionedFields // DimensionedFields
else if else if
( (
volFieldTypes[i] volFieldTypes[i] == volScalarField::Internal::typeName
== volScalarField::DimensionedInternalField::typeName
) )
{ {
volScalarField::DimensionedInternalField df volScalarField::Internal df(fieldObject, mesh);
(
fieldObject,
mesh
);
ensightField<scalar> ensightField<scalar>
( (
volField<scalar>(meshSubsetter, df), volField<scalar>(meshSubsetter, df),
@ -585,15 +580,10 @@ int main(int argc, char *argv[])
} }
else if else if
( (
volFieldTypes[i] volFieldTypes[i] == volVectorField::Internal::typeName
== volVectorField::DimensionedInternalField::typeName
) )
{ {
volVectorField::DimensionedInternalField df volVectorField::Internal df(fieldObject, mesh);
(
fieldObject,
mesh
);
ensightField<vector> ensightField<vector>
( (
volField<vector>(meshSubsetter, df), volField<vector>(meshSubsetter, df),
@ -609,14 +599,10 @@ int main(int argc, char *argv[])
else if else if
( (
volFieldTypes[i] volFieldTypes[i]
== volSphericalTensorField::DimensionedInternalField::typeName == volSphericalTensorField::Internal::typeName
) )
{ {
volSphericalTensorField::DimensionedInternalField df volSphericalTensorField::Internal df(fieldObject, mesh);
(
fieldObject,
mesh
);
ensightField<sphericalTensor> ensightField<sphericalTensor>
( (
volField<sphericalTensor>(meshSubsetter, df), volField<sphericalTensor>(meshSubsetter, df),
@ -631,15 +617,10 @@ int main(int argc, char *argv[])
} }
else if else if
( (
volFieldTypes[i] volFieldTypes[i] == volSymmTensorField::Internal::typeName
== volSymmTensorField::DimensionedInternalField::typeName
) )
{ {
volSymmTensorField::DimensionedInternalField df volSymmTensorField::Internal df(fieldObject, mesh);
(
fieldObject,
mesh
);
ensightField<symmTensor> ensightField<symmTensor>
( (
volField<symmTensor>(meshSubsetter, df), volField<symmTensor>(meshSubsetter, df),
@ -654,15 +635,10 @@ int main(int argc, char *argv[])
} }
else if else if
( (
volFieldTypes[i] volFieldTypes[i] == volTensorField::Internal::typeName
== volTensorField::DimensionedInternalField::typeName
) )
{ {
volTensorField::DimensionedInternalField df volTensorField::Internal df(fieldObject, mesh);
(
fieldObject,
mesh
);
ensightField<tensor> ensightField<tensor>
( (
volField<tensor>(meshSubsetter, df), volField<tensor>(meshSubsetter, df),

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -618,11 +618,11 @@ int main(int argc, char *argv[])
// Construct dimensioned fields // Construct dimensioned fields
PtrList<volScalarField::DimensionedInternalField> dsf; PtrList<const volScalarField::Internal> dsf;
PtrList<volVectorField::DimensionedInternalField> dvf; PtrList<const volVectorField::Internal> dvf;
PtrList<volSphericalTensorField::DimensionedInternalField> dSpheretf; PtrList<const volSphericalTensorField::Internal> dSpheretf;
PtrList<volSymmTensorField::DimensionedInternalField> dSymmtf; PtrList<const volSymmTensorField::Internal> dSymmtf;
PtrList<volTensorField::DimensionedInternalField> dtf; PtrList<const volTensorField::Internal> dtf;
if (!specifiedFields || selectedFields.size()) if (!specifiedFields || selectedFields.size())
{ {

View File

@ -98,7 +98,7 @@ public:
template<class Type, class GeoMesh> template<class Type, class GeoMesh>
void write void write
( (
const PtrList<DimensionedField<Type, volMesh>>& flds const PtrList<const DimensionedField<Type, volMesh>>& flds
); );
//- Interpolate and write volFields //- Interpolate and write volFields
@ -114,7 +114,7 @@ public:
void write void write
( (
const volPointInterpolation&, const volPointInterpolation&,
const PtrList<DimensionedField<Type, volMesh>>& const PtrList<const DimensionedField<Type, volMesh>>&
); );
}; };

View File

@ -44,7 +44,7 @@ void Foam::internalWriter::write
template<class Type, class GeoMesh> template<class Type, class GeoMesh>
void Foam::internalWriter::write void Foam::internalWriter::write
( (
const PtrList<DimensionedField<Type, volMesh>>& flds const PtrList<const DimensionedField<Type, volMesh>>& flds
) )
{ {
forAll(flds, i) forAll(flds, i)
@ -79,7 +79,7 @@ template<class Type, class GeoMesh>
void Foam::internalWriter::write void Foam::internalWriter::write
( (
const volPointInterpolation& pInterp, const volPointInterpolation& pInterp,
const PtrList<DimensionedField<Type, volMesh>>& flds const PtrList<const DimensionedField<Type, volMesh>>& flds
) )
{ {
forAll(flds, i) forAll(flds, i)

View File

@ -64,7 +64,7 @@ void Foam::writeFuns::write
( (
std::ostream& os, std::ostream& os,
const bool binary, const bool binary,
const DimensionedField<Type, volMesh>& vvf, const DimensionedField<Type, volMesh>& df,
const vtkMesh& vMesh const vtkMesh& vMesh
) )
{ {
@ -74,19 +74,19 @@ void Foam::writeFuns::write
label nValues = mesh.nCells() + superCells.size(); label nValues = mesh.nCells() + superCells.size();
os << vvf.name() << ' ' os << df.name() << ' '
<< int(pTraits<Type>::nComponents) << ' ' << int(pTraits<Type>::nComponents) << ' '
<< nValues << " float" << std::endl; << nValues << " float" << std::endl;
DynamicList<floatScalar> fField(pTraits<Type>::nComponents*nValues); DynamicList<floatScalar> fField(pTraits<Type>::nComponents*nValues);
insert(vvf.primitiveField(), fField); insert(df.field(), fField);
forAll(superCells, superCelli) forAll(superCells, superCelli)
{ {
label origCelli = superCells[superCelli]; label origCelli = superCells[superCelli];
insert(vvf[origCelli], fField); insert(df[origCelli], fField);
} }
write(os, binary, fField); write(os, binary, fField);
} }

View File

@ -116,11 +116,11 @@ void Foam::writeVTKFields
Info<< " writing field " << fieldNames[fieldi] << endl; Info<< " writing field " << fieldNames[fieldi] << endl;
os << nl << fieldNames[fieldi] << ' ' os << nl << fieldNames[fieldi] << ' '
<< int(pTraits<Type>::nComponents) << ' ' << int(pTraits<Type>::nComponents) << ' '
<< values[fieldI].size() << " float" << nl; << values[fieldi].size() << " float" << nl;
label offset = 0; label offset = 0;
forAll(addr, trackI) forAll(addr, tracki)
{ {
const List<label> ids(addr[trackI]); const List<label> ids(addr[tracki]);
List<Type> data(UIndirectList<Type>(values[fieldi], ids)); List<Type> data(UIndirectList<Type>(values[fieldi], ids));
label nData = data.size() - 1; label nData = data.size() - 1;

View File

@ -93,7 +93,7 @@ void correctProcessorPatches(volScalarField& vf)
// Not possible to use correctBoundaryConditions on fields as they may // Not possible to use correctBoundaryConditions on fields as they may
// use local info as opposed to the constraint values employed here, // use local info as opposed to the constraint values employed here,
// but still need to update processor patches // but still need to update processor patches
volScalarField::GeometricBoundaryField& bf = vf.boundaryField(); volScalarField::Boundary& bf = vf.boundaryFieldRef();
forAll(bf, patchI) forAll(bf, patchI)
{ {
@ -134,8 +134,8 @@ void blendField
if (fieldHeader.typeHeaderOk<volScalarField>(true)) if (fieldHeader.typeHeaderOk<volScalarField>(true))
{ {
volScalarField fld(fieldHeader, mesh); volScalarField fld(fieldHeader, mesh);
scalarField& internalField = fld.internalField(); scalarField& pf = fld.primitiveFieldRef();
internalField = (1 - mask)*internalField + mask*boundaryLayerField; pf = (1 - mask)*pf + mask*boundaryLayerField;
fld.max(SMALL); fld.max(SMALL);
// Do not correct BC // Do not correct BC
@ -172,10 +172,9 @@ void calcOmegaField
if (omegaHeader.typeHeaderOk<volScalarField>(true)) if (omegaHeader.typeHeaderOk<volScalarField>(true))
{ {
volScalarField omega(omegaHeader, mesh); volScalarField omega(omegaHeader, mesh);
scalarField& internalField = omega.internalField(); scalarField& pf = omega.primitiveFieldRef();
internalField = pf = (1 - mask)*pf + mask*epsilonBL/(Cmu*kBL + SMALL);
(1 - mask)*internalField + mask*epsilonBL/(Cmu*kBL + SMALL);
omega.max(SMALL); omega.max(SMALL);
// Do not correct BC // Do not correct BC

View File

@ -52,7 +52,7 @@ volScalarField y
dimensionedScalar("zero", dimLength, 0.0), dimensionedScalar("zero", dimLength, 0.0),
zeroGradientFvPatchScalarField::typeName zeroGradientFvPatchScalarField::typeName
); );
y.internalField() = wallDist::New(mesh).y().internalField(); y.primitiveFieldRef() = wallDist::New(mesh).y().primitiveField();
y.correctBoundaryConditions(); y.correctBoundaryConditions();

View File

@ -1,8 +1,8 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/postProcessing/functionObjects/jobControl/lnInclude -I$(LIB_SRC)/functionObjects/field/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-ljobControl -lfieldFunctionObjects

View File

@ -56,12 +56,12 @@ Note:
used for face addressing starts at index 0. used for face addressing starts at index 0.
See also See also
externalCoupledFunctionObject functionObjects::externalCoupled
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "fvCFD.H" #include "fvCFD.H"
#include "externalCoupledFunctionObject.H" #include "externalCoupled.H"
#include "IOobjectList.H" #include "IOobjectList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -119,7 +119,7 @@ int main(int argc, char *argv[])
} }
externalCoupledFunctionObject::writeGeometry functionObjects::externalCoupled::writeGeometry
( (
UPtrList<const fvMesh>(meshes), UPtrList<const fvMesh>(meshes),
commsDir, commsDir,

View File

@ -786,6 +786,8 @@ int main(int argc, char *argv[])
); );
label compactI = 0; label compactI = 0;
volScalarField::Boundary& vfbf = viewFactorField.boundaryFieldRef();
forAll(viewFactorsPatches, i) forAll(viewFactorsPatches, i)
{ {
label patchID = viewFactorsPatches[i]; label patchID = viewFactorsPatches[i];
@ -805,7 +807,7 @@ int main(int argc, char *argv[])
forAll(fineFaces, fineId) forAll(fineFaces, fineId)
{ {
const label faceID = fineFaces[fineId]; const label faceID = fineFaces[fineId];
viewFactorField.boundaryField()[patchID][faceID] = Fij; vfbf[patchID][faceID] = Fij;
} }
compactI++; compactI++;
} }

View File

@ -230,7 +230,7 @@ void writeParts
{ {
boolList includeMap(surf.size(), false); boolList includeMap(surf.size(), false);
forAll(faceZone, faceI) forAll(faceZone, facei)
{ {
if (faceZone[facei] == zone) if (faceZone[facei] == zone)
{ {
@ -651,7 +651,7 @@ int main(int argc, char *argv[])
{ {
Info<< " close unconnected points " Info<< " close unconnected points "
<< pti << ' ' << localPoints[pti] << pti << ' ' << localPoints[pti]
<< " and " << prevPtI << ' ' << " and " << prevPti << ' '
<< localPoints[prevPti] << localPoints[prevPti]
<< " distance:" << " distance:"
<< mag(localPoints[pti] - localPoints[prevPti]) << mag(localPoints[pti] - localPoints[prevPti])
@ -660,8 +660,8 @@ int main(int argc, char *argv[])
else else
{ {
Info<< " small edge between points " Info<< " small edge between points "
<< ptI << ' ' << localPoints[pti] << pti << ' ' << localPoints[pti]
<< " and " << prevPtI << ' ' << " and " << prevPti << ' '
<< localPoints[prevPti] << localPoints[prevPti]
<< " distance:" << " distance:"
<< mag(localPoints[pti] - localPoints[prevPti]) << mag(localPoints[pti] - localPoints[prevPti])
@ -837,7 +837,7 @@ int main(int argc, char *argv[])
label nInt = 0; label nInt = 0;
forAll(surf.edges(), edgeI) forAll(surf.edges(), edgei)
{ {
const edge& e = surf.edges()[edgei]; const edge& e = surf.edges()[edgei];

View File

@ -44,14 +44,14 @@ PROJECT_NUMBER = $(WM_PROJECT_VERSION)
# for a project that appears at the top of each page and should give viewer a # for a project that appears at the top of each page and should give viewer a
# quick idea about the purpose of the project. Keep the description short. # quick idea about the purpose of the project. Keep the description short.
PROJECT_BRIEF = "The OpenFOAM Foundation" PROJECT_BRIEF = "The open source CFD toolbox"
# With the PROJECT_LOGO tag one can specify a logo or an icon that is included # With the PROJECT_LOGO tag one can specify a logo or an icon that is included
# in the documentation. The maximum height of the logo should not exceed 55 # in the documentation. The maximum height of the logo should not exceed 55
# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
# the logo to the output directory. # the logo to the output directory.
PROJECT_LOGO = CFDFoundation55x55.png PROJECT_LOGO = OpenFOAM-logo2-55x55.png
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
# into which the generated documentation will be written. If a relative path is # into which the generated documentation will be written. If a relative path is
@ -168,7 +168,8 @@ STRIP_FROM_INC_PATH =
# support long names like on DOS, Mac, or CD-ROM. # support long names like on DOS, Mac, or CD-ROM.
# The default value is: NO. # The default value is: NO.
SHORT_NAMES = YES #SHORT_NAMES = YES
SHORT_NAMES = NO
# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the # If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
# first line (until the first dot) of a Javadoc-style comment as the brief # first line (until the first dot) of a Javadoc-style comment as the brief
@ -1128,7 +1129,7 @@ HTML_EXTRA_FILES =
# Minimum value: 0, maximum value: 359, default value: 220. # Minimum value: 0, maximum value: 359, default value: 220.
# This tag requires that the tag GENERATE_HTML is set to YES. # This tag requires that the tag GENERATE_HTML is set to YES.
HTML_COLORSTYLE_HUE = 120 HTML_COLORSTYLE_HUE = 220
# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors # The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
# in the HTML output. For a value of 0 the output will use grayscales only. A # in the HTML output. For a value of 0 the output will use grayscales only. A
@ -1426,7 +1427,7 @@ EXT_LINKS_IN_WINDOW = NO
# Minimum value: 8, maximum value: 50, default value: 10. # Minimum value: 8, maximum value: 50, default value: 10.
# This tag requires that the tag GENERATE_HTML is set to YES. # This tag requires that the tag GENERATE_HTML is set to YES.
FORMULA_FONTSIZE = 12 FORMULA_FONTSIZE = 14
# Use the FORMULA_TRANPARENT tag to determine whether or not the images # Use the FORMULA_TRANPARENT tag to determine whether or not the images
# generated for formulas are transparent PNGs. Transparent PNGs are not # generated for formulas are transparent PNGs. Transparent PNGs are not

View File

@ -11,11 +11,27 @@
</div> </div>
<!--END GENERATE_TREEVIEW--> <!--END GENERATE_TREEVIEW-->
<!--BEGIN !GENERATE_TREEVIEW--> <!--BEGIN !GENERATE_TREEVIEW-->
<hr class="footer"/><address class="footer"><small> <hr class="footer"/>
$generatedby &#160;<a href="http://www.doxygen.org/index.html"> <address class="footer">
<img class="footer" src="$relpath^doxygen.png" alt="doxygen"/> <small>
</a> $doxygenversion <p>
</small></address> Copyright&nbsp;&copy;&nbsp;2011-2016&nbsp;
<a href="http://www.openfoam.com">OpenFOAM</a>
|
OPENFOAM&reg; is a registered
<a href="http://www.openfoam.com/legal/trademark-policy.php">trademark
</a> of OpenCFD Ltd.
</p>
<p>
$generatedby &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="$relpath^doxygen.png" alt="doxygen"/>
</a> $doxygenversion
</p>
</small>
</address>
<!--END !GENERATE_TREEVIEW--> <!--END !GENERATE_TREEVIEW-->
<!-- BEGIN MATHJAX-->
$mathjax
<!-- END MATHJAX-->
</body> </body>
</html> </html>

View File

@ -32,7 +32,7 @@ $extrastylesheet
<div id="projectname"><a href="http://openfoam.com">$projectname</a> <div id="projectname"><a href="http://openfoam.com">$projectname</a>
<!--BEGIN PROJECT_NUMBER-->&#160;<span id="projectnumber"><a href="http://openfoam.com/download/source">$projectnumber</a></span><!--END PROJECT_NUMBER--> <!--BEGIN PROJECT_NUMBER-->&#160;<span id="projectnumber"><a href="http://openfoam.com/download/source">$projectnumber</a></span><!--END PROJECT_NUMBER-->
</div> </div>
<!--BEGIN PROJECT_BRIEF--><div id="projectbrief"><a href="http://openfoam.com/dev">$projectbrief</a></div><!--END PROJECT_BRIEF--> <!--BEGIN PROJECT_BRIEF--><div id="projectbrief"><a href="https://develop.openfoam.com">$projectbrief</a></div><!--END PROJECT_BRIEF-->
</td> </td>
<!--END PROJECT_NAME--> <!--END PROJECT_NAME-->
<!--BEGIN !PROJECT_NAME--> <!--BEGIN !PROJECT_NAME-->

View File

@ -47,11 +47,7 @@ wmake $targetType lagrangian/basic
wmake $targetType lagrangian/distributionModels wmake $targetType lagrangian/distributionModels
wmake $targetType genericPatchFields wmake $targetType genericPatchFields
<<<<<<< HEAD
conversion/Allwmake $targetType $* conversion/Allwmake $targetType $*
=======
wmake $targetType conversion
>>>>>>> foundation-github
wmake $targetType mesh/extrudeModel wmake $targetType mesh/extrudeModel
wmake $targetType dynamicMesh wmake $targetType dynamicMesh
wmake $targetType sampling wmake $targetType sampling

View File

@ -1316,8 +1316,6 @@ Foam::Time& Foam::Time::operator++()
} }
} }
} }
functionObjects_.timeSet();
} }
return *this; return *this;

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -281,6 +281,15 @@ extern messageStream Info;
// for FUNCTION_NAME in file __FILE__ at line __LINE__ // for FUNCTION_NAME in file __FILE__ at line __LINE__
#define InfoInFunction InfoIn(FUNCTION_NAME) #define InfoInFunction InfoIn(FUNCTION_NAME)
//- Report an information message using Foam::Pout
// for functionName in file __FILE__ at line __LINE__
#define PoutIn(functionName) \
::Foam::Pout((functionName), __FILE__, __LINE__)
//- Report an information message using Foam::Pout
// for FUNCTION_NAME in file __FILE__ at line __LINE__
#define PoutInFunction PoutIn(FUNCTION_NAME)
//- Report write to Foam::Info if the local log switch is true //- Report write to Foam::Info if the local log switch is true
#define Log \ #define Log \
if (log) Info if (log) Info
@ -309,6 +318,17 @@ extern messageStream Info;
#define DebugInFunction \ #define DebugInFunction \
if (debug) InfoInFunction if (debug) InfoInFunction
//- Report an information message using Foam::Pout
// if the local debug switch is true
#define DebugPout \
if (debug) Pout
//- Report an information message using Foam::Pout
// for FUNCTION_NAME in file __FILE__ at line __LINE__
// if the local debug switch is true
#define DebugPoutInFunction \
if (debug) PoutInFunction
//- Report a variable name and value //- Report a variable name and value
// using Foam::Pout in file __FILE__ at line __LINE__ // using Foam::Pout in file __FILE__ at line __LINE__
#define DebugVar(var) \ #define DebugVar(var) \

View File

@ -1,147 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "IOOutputFilter.H"
#include "Time.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class OutputFilter>
Foam::IOOutputFilter<OutputFilter>::IOOutputFilter
(
const word& outputFilterName,
const IOobject& ioDict,
const bool readFromFiles
)
:
IOdictionary(ioDict),
OutputFilter(outputFilterName, ioDict.db(), *this, readFromFiles)
{}
template<class OutputFilter>
Foam::IOOutputFilter<OutputFilter>::IOOutputFilter
(
const word& outputFilterName,
const objectRegistry& obr,
const word& dictName,
const IOobject::readOption rOpt,
const bool readFromFiles
)
:
IOdictionary
(
IOobject
(
dictName,
obr.time().system(),
obr,
rOpt,
IOobject::NO_WRITE
)
),
OutputFilter(outputFilterName, obr, *this, readFromFiles)
{}
template<class OutputFilter>
Foam::IOOutputFilter<OutputFilter>::IOOutputFilter
(
const word& outputFilterName,
const objectRegistry& obr,
const fileName& dictName,
const IOobject::readOption rOpt,
const bool readFromFiles
)
:
IOdictionary
(
IOobject
(
dictName,
obr,
rOpt,
IOobject::NO_WRITE
)
),
OutputFilter(outputFilterName, obr, *this, readFromFiles)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class OutputFilter>
Foam::IOOutputFilter<OutputFilter>::~IOOutputFilter()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class OutputFilter>
const Foam::word& Foam::IOOutputFilter<OutputFilter>::name() const
{
return IOdictionary::name();
}
template<class OutputFilter>
bool Foam::IOOutputFilter<OutputFilter>::read()
{
if (regIOobject::read())
{
OutputFilter::read(*this);
return true;
}
else
{
return false;
}
}
template<class OutputFilter>
bool Foam::IOOutputFilter<OutputFilter>::write()
{
return OutputFilter::write();
}
template<class OutputFilter>
void Foam::IOOutputFilter<OutputFilter>::updateMesh(const mapPolyMesh& mpm)
{
read();
OutputFilter::updateMesh(mpm);
}
template<class OutputFilter>
void Foam::IOOutputFilter<OutputFilter>::movePoints(const polyMesh& mesh)
{
read();
OutputFilter::movePoints(mesh);
}
// ************************************************************************* //

View File

@ -1,153 +0,0 @@
/*---------------------------------------------------------------------------* \
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::IOOutputFilter
Description
IOdictionary wrapper around OutputFilter to allow them to read from
their associated dictionaries.
Note
The IOobject or the objectRegistry will normally have to be
derived from a fvMesh for a subsequent cast (within OutputFilter)
to work correctly.
SourceFiles
IOOutputFilter.C
\*---------------------------------------------------------------------------*/
#ifndef IOOutputFilter_H
#define IOOutputFilter_H
#include "IOdictionary.H"
#include "pointFieldFwd.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of classes
class mapPolyMesh;
/*---------------------------------------------------------------------------*\
Class IOOutputFilter Declaration
\*---------------------------------------------------------------------------*/
template<class OutputFilter>
class IOOutputFilter
:
public IOdictionary,
public OutputFilter
{
// Private Member Functions
// Disallow default bitwise copy construct and assignment
IOOutputFilter(const IOOutputFilter&);
void operator=(const IOOutputFilter&);
public:
// Constructors
//- Construct from an IOobject for IOdictionary
// Allow the possibility to load fields from files
IOOutputFilter
(
const word& outputFilterName,
const IOobject& ioDict,
const bool loadFromFile = false
);
//- Construct for given objectRegistry and dictionary
// Allow dictionary to be optional
// Allow the possibility to load fields from files
IOOutputFilter
(
const word& outputFilterName,
const objectRegistry&,
const word& dictName = OutputFilter::typeName() + "Dict",
const IOobject::readOption rOpt = IOobject::MUST_READ_IF_MODIFIED,
const bool loadFromFile = false
);
//- Construct for given objectRegistry and dictionary
// Dictionary read from full path.
// Allow the possibility to load fields from files
IOOutputFilter
(
const word& outputFilterName,
const objectRegistry&,
const fileName& dictName,
const IOobject::readOption rOpt = IOobject::MUST_READ_IF_MODIFIED,
const bool loadFromFile = false
);
//- Destructor
virtual ~IOOutputFilter();
// Member Functions
//- Return name
virtual const word& name() const;
//- Inherit read from OutputFilter
using OutputFilter::read;
//- Read output filter properties
virtual bool read();
//- Inherit write from regIOobject
using regIOobject::write;
//- Sample and write
virtual bool write();
//- Update for changes of mesh
virtual void updateMesh(const mapPolyMesh& mpm);
//- Update for changes of mesh
virtual void movePoints(const polyMesh& mesh);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "IOOutputFilter.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -520,11 +520,6 @@ bool Foam::functionObjectList::execute()
if (execution_) if (execution_)
{ {
if (forceWrite)
{
resetState();
}
if (!updated_) if (!updated_)
{ {
read(); read();
@ -532,21 +527,18 @@ bool Foam::functionObjectList::execute()
forAll(*this, objectI) forAll(*this, objectI)
{ {
addProfiling const word& objName = operator[](objectI).name();
( {
fo, addProfiling(fo, "functionObject::" + objName + "::execute");
"functionObject::" + operator[](objectI).name() + "::execute"
);
ok = operator[](objectI).execute() && ok; ok = operator[](objectI).execute() && ok;
}
addProfiling {
( addProfiling(fo, "functionObject::" + objName + "::write");
fo,
"functionObject::" + operator[](objectI).name() + "::write"
);
ok = operator[](objectI).write() && ok; ok = operator[](objectI).write() && ok;
}
} }
} }
@ -583,11 +575,9 @@ bool Foam::functionObjectList::end()
forAll(*this, objectI) forAll(*this, objectI)
{ {
addProfiling const word& objName = operator[](objectI).name();
(
fo, addProfiling(fo, "functionObject::" + objName + "::end");
"functionObject::" + operator[](objectI).name() + "::end"
);
ok = operator[](objectI).end() && ok; ok = operator[](objectI).end() && ok;
} }
@ -610,12 +600,9 @@ bool Foam::functionObjectList::adjustTimeStep()
forAll(*this, objectI) forAll(*this, objectI)
{ {
addProfiling const word& objName = operator[](objectI).name();
(
fo, addProfiling(fo, "functionObject::" + objName + "::adjustTimeStep");
"functionObject::" + operator[](objectI).name()
+ "::adjustTimeStep"
);
ok = operator[](objectI).adjustTimeStep() && ok; ok = operator[](objectI).adjustTimeStep() && ok;
} }

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -40,7 +40,7 @@ void Foam::functionObjects::logFiles::createFiles()
{ {
if (!filePtrs_.set(i)) if (!filePtrs_.set(i))
{ {
filePtrs_.set(i, createFile(names_[i]); filePtrs_.set(i, createFile(names_[i]));
initStream(filePtrs_[i]); initStream(filePtrs_[i]);
} }
@ -67,7 +67,7 @@ void Foam::functionObjects::logFiles::resetName(const word& name)
names_.clear(); names_.clear();
names_.append(name); names_.append(name);
resetFile(name); writeFile::resetFile(name);
} }
@ -85,6 +85,21 @@ Foam::functionObjects::logFiles::logFiles
{} {}
Foam::functionObjects::logFiles::logFiles
(
const objectRegistry& obr,
const word& prefix,
const dictionary& dict
)
:
writeFile(obr, prefix),
names_(),
filePtrs_()
{
writeFile::read(dict);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::logFiles::~logFiles() Foam::functionObjects::logFiles::~logFiles()

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -41,7 +41,6 @@ SourceFiles
#define functionObjects_logFiles_H #define functionObjects_logFiles_H
#include "writeFile.H" #include "writeFile.H"
#include "OFstream.H"
#include "PtrList.H" #include "PtrList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -82,9 +81,6 @@ protected:
//- Reset the list of names to a single name entry //- Reset the list of names to a single name entry
virtual void resetName(const word& name); virtual void resetName(const word& name);
//- File header information
virtual void writeFileHeader(const label i = 0) = 0;
private: private:
@ -109,6 +105,16 @@ public:
); );
//- Construct from objectRegistry and prefix, and read options
// from dictionary
logFiles
(
const objectRegistry& obr,
const word& prefix,
const dictionary& dict
);
//- Destructor //- Destructor
virtual ~logFiles(); virtual ~logFiles();

View File

@ -97,8 +97,7 @@ Foam::functionObjects::regionFunctionObject::regionFunctionObject
const dictionary& dict const dictionary& dict
) )
: :
functionObject(name), stateFunctionObject(name, runTime),
time_(runTime),
obr_ obr_
( (
runTime.lookupObject<objectRegistry> runTime.lookupObject<objectRegistry>
@ -116,8 +115,7 @@ Foam::functionObjects::regionFunctionObject::regionFunctionObject
const dictionary& dict const dictionary& dict
) )
: :
functionObject(name), stateFunctionObject(name, obr.time()),
time_(obr.time()),
obr_(obr) obr_(obr)
{} {}

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -29,7 +29,7 @@ Description
reference to the region Foam::objectRegistry. reference to the region Foam::objectRegistry.
See also See also
Foam::functionObject Foam::functionObjects::stateFunctionObject
SourceFiles SourceFiles
regionFunctionObject.C regionFunctionObject.C
@ -39,7 +39,7 @@ SourceFiles
#ifndef functionObjects_regionFunctionObject_H #ifndef functionObjects_regionFunctionObject_H
#define functionObjects_regionFunctionObject_H #define functionObjects_regionFunctionObject_H
#include "functionObject.H" #include "stateFunctionObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -53,21 +53,18 @@ namespace functionObjects
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class regionFunctionObject Declaration Class regionFunctionObject Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class regionFunctionObject class regionFunctionObject
: :
public functionObject public stateFunctionObject
{ {
protected: protected:
// Protected member data // Protected member data
//- Reference to the Time
const Time& time_;
//- Reference to the region objectRegistry //- Reference to the region objectRegistry
const objectRegistry& obr_; const objectRegistry& obr_;
@ -86,7 +83,7 @@ protected:
template<class ObjectType> template<class ObjectType>
bool store bool store
( (
word& fieldName, const word& fieldName,
const tmp<ObjectType>& tfield, const tmp<ObjectType>& tfield,
bool cacheable = false bool cacheable = false
); );

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -51,7 +51,7 @@ const ObjectType& Foam::functionObjects::regionFunctionObject::lookupObject
template<class ObjectType> template<class ObjectType>
bool Foam::functionObjects::regionFunctionObject::store bool Foam::functionObjects::regionFunctionObject::store
( (
word& fieldName, const word& fieldName,
const tmp<ObjectType>& tfield, const tmp<ObjectType>& tfield,
bool cacheable bool cacheable
) )
@ -68,16 +68,9 @@ bool Foam::functionObjects::regionFunctionObject::store
return false; return false;
} }
if if (fieldName.size() && foundObject<ObjectType>(fieldName))
(
fieldName.size()
&& obr_.foundObject<ObjectType>(fieldName)
)
{ {
const ObjectType& field = const ObjectType& field = lookupObject<ObjectType>(fieldName);
(
obr_.lookupObject<ObjectType>(fieldName)
);
// If there is a result field already registered assign to the new // If there is a result field already registered assign to the new
// result field otherwise transfer ownership of the new result field to // result field otherwise transfer ownership of the new result field to
@ -97,10 +90,6 @@ bool Foam::functionObjects::regionFunctionObject::store
{ {
tfield.ref().rename(fieldName); tfield.ref().rename(fieldName);
} }
else
{
fieldName = tfield().name();
}
obr_.objectRegistry::store(tfield.ptr()); obr_.objectRegistry::store(tfield.ptr());
} }

View File

@ -23,79 +23,71 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "functionObjectState.H" #include "stateFunctionObject.H"
#include "Time.H" #include "Time.H"
const Foam::word Foam::functionObjectState::resultsName_ = "results"; const Foam::word Foam::functionObjects::stateFunctionObject::resultsName_ =
"results";
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
const Foam::IOdictionary& Foam::functionObjectState::stateDict() const const Foam::IOdictionary&
Foam::functionObjects::stateFunctionObject::stateDict() const
{ {
return obr_.time().functionObjects().stateDict(); return time_.functionObjects().stateDict();
} }
Foam::IOdictionary& Foam::functionObjectState::stateDict() Foam::IOdictionary& Foam::functionObjects::stateFunctionObject::stateDict()
{ {
return const_cast<IOdictionary&>(obr_.time().functionObjects().stateDict()); return const_cast<IOdictionary&>(time_.functionObjects().stateDict());
} }
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::functionObjectState::functionObjectState Foam::functionObjects::stateFunctionObject::stateFunctionObject
( (
const objectRegistry& obr, const word& name,
const word& name const Time& runTime
) )
: :
obr_(obr), functionObject(name),
name_(name), time_(runTime)
active_(true)
{} {}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjectState::~functionObjectState() Foam::functionObjects::stateFunctionObject::~stateFunctionObject()
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::word& Foam::functionObjectState::name() const Foam::dictionary& Foam::functionObjects::stateFunctionObject::propertyDict()
{
return name_;
}
bool Foam::functionObjectState::active() const
{
return active_;
}
Foam::dictionary& Foam::functionObjectState::propertyDict()
{ {
IOdictionary& stateDict = this->stateDict(); IOdictionary& stateDict = this->stateDict();
if (!stateDict.found(name_)) if (!stateDict.found(name()))
{ {
stateDict.add(name_, dictionary()); stateDict.add(name(), dictionary());
} }
return stateDict.subDict(name_); return stateDict.subDict(name());
} }
bool Foam::functionObjectState::foundProperty(const word& entryName) const bool Foam::functionObjects::stateFunctionObject::foundProperty
(
const word& entryName
) const
{ {
const IOdictionary& stateDict = this->stateDict(); const IOdictionary& stateDict = this->stateDict();
if (stateDict.found(name_)) if (stateDict.found(name()))
{ {
const dictionary& baseDict = stateDict.subDict(name_); const dictionary& baseDict = stateDict.subDict(name());
return baseDict.found(entryName); return baseDict.found(entryName);
} }
@ -103,13 +95,16 @@ bool Foam::functionObjectState::foundProperty(const word& entryName) const
} }
Foam::word Foam::functionObjectState::resultType(const word& entryName) const Foam::word Foam::functionObjects::stateFunctionObject::resultType
(
const word& entryName
) const
{ {
return objectResultType(name_, entryName); return objectResultType(name(), entryName);
} }
Foam::word Foam::functionObjectState::objectResultType Foam::word Foam::functionObjects::stateFunctionObject::objectResultType
( (
const word& objectName, const word& objectName,
const word& entryName const word& entryName
@ -142,13 +137,15 @@ Foam::word Foam::functionObjectState::objectResultType
} }
Foam::List<Foam::word> Foam::functionObjectState::objectResultEntries() const Foam::List<Foam::word>
Foam::functionObjects::stateFunctionObject::objectResultEntries() const
{ {
return objectResultEntries(name_); return objectResultEntries(name());
} }
Foam::List<Foam::word> Foam::functionObjectState::objectResultEntries Foam::List<Foam::word> Foam::functionObjects::stateFunctionObject::
objectResultEntries
( (
const word& objectName const word& objectName
) const ) const

View File

@ -29,60 +29,67 @@ Description
information (data required for smooth restart behaviour) and results information (data required for smooth restart behaviour) and results
to/from the state dictionary to/from the state dictionary
See Also Note: cannot access the state dictionary until after construction of the
function objects, since the owner container functionObjectList is owned
by time, and time owns the state dictionary. I.e. need to wait for time
to be fully consttucted.
See also
Foam::functionObject Foam::functionObject
SourceFiles SourceFiles
functionObjectState.C stateFunctionObject.C
stateFunctionObjectTemplates.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef functionObjectState_H #ifndef functionObjects_stateFunctionObject_H
#define functionObjectState_H #define functionObjects_stateFunctionObject_H
#include "objectRegistry.H" #include "functionObject.H"
#include "IOdictionary.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
class IOdictionary;
namespace functionObjects
{
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class functionObjectState Declaration Class stateFunctionObject Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class functionObjectState class stateFunctionObject
:
public functionObject
{ {
private: private:
// Private data // Private member data
//- Name of the results dictionary //- Name of the results dictionary
static const word resultsName_; static const word resultsName_;
//- Reference to the database
const objectRegistry& obr_;
// Private Member Functions // Private Member Functions
//- Disallow default bitwise copy construct //- Disallow default bitwise copy construct
functionObjectState(const functionObjectState&); stateFunctionObject(const stateFunctionObject&) = delete;
//- Disallow default bitwise assignment //- Disallow default bitwise assignment
void operator=(const functionObjectState&); void operator=(const stateFunctionObject&) = delete;
protected: protected:
// Protected data // Protected Member Data
//- Name of model //- Reference to the time database
const word name_; const Time& time_;
//- Flag to indicate whether the object is active
bool active_;
// Protacted Member Functions // Protacted Member Functions
@ -100,29 +107,18 @@ public:
// Constructors // Constructors
//- Construct from components //- Construct from components
functionObjectState(const objectRegistry& obr, const word& name); stateFunctionObject(const word& name, const Time& runTime);
//- Destructor //- Destructor
virtual ~functionObjectState(); ~stateFunctionObject();
// Member Functions // Member Functions
//- Return the name
const word& name() const;
//- Return the active flag
bool active() const;
//- Return access to the property dictionary //- Return access to the property dictionary
dictionary& propertyDict(); dictionary& propertyDict();
//- Set the active status by querying objectRegistry type
// returns new active status
template<class Type>
bool setActive();
// Properties // Properties
@ -238,12 +234,13 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace functionObjects
} // End namespace Foam } // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository #ifdef NoRepository
#include "functionObjectStateTemplates.C" #include "stateFunctionObjectTemplates.C"
#endif #endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -23,28 +23,12 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "IOdictionary.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> template<class Type>
bool Foam::functionObjectState::setActive() Type Foam::functionObjects::stateFunctionObject::getProperty
{
active_ = true;
if (!isA<Type>(obr_))
{
WarningInFunction
<< "No " << Type::typeName << " available, deactivating " << name_
<< endl;
active_ = false;
}
return active_;
}
template<class Type>
Type Foam::functionObjectState::getProperty
( (
const word& entryName, const word& entryName,
const Type& defaultValue const Type& defaultValue
@ -57,29 +41,29 @@ Type Foam::functionObjectState::getProperty
template<class Type> template<class Type>
void Foam::functionObjectState::getProperty void Foam::functionObjects::stateFunctionObject::getProperty
( (
const word& entryName, const word& entryName,
Type& value Type& value
) const ) const
{ {
getObjectProperty(name_, entryName, value); getObjectProperty(name(), entryName, value);
} }
template<class Type> template<class Type>
void Foam::functionObjectState::setProperty void Foam::functionObjects::stateFunctionObject::setProperty
( (
const word& entryName, const word& entryName,
const Type& value const Type& value
) )
{ {
setObjectProperty(name_, entryName, value); setObjectProperty(name(), entryName, value);
} }
template<class Type> template<class Type>
Type Foam::functionObjectState::getObjectProperty Type Foam::functionObjects::stateFunctionObject::getObjectProperty
( (
const word& objectName, const word& objectName,
const word& entryName, const word& entryName,
@ -93,7 +77,7 @@ Type Foam::functionObjectState::getObjectProperty
template<class Type> template<class Type>
void Foam::functionObjectState::getObjectProperty void Foam::functionObjects::stateFunctionObject::getObjectProperty
( (
const word& objectName, const word& objectName,
const word& entryName, const word& entryName,
@ -121,7 +105,7 @@ void Foam::functionObjectState::getObjectProperty
template<class Type> template<class Type>
void Foam::functionObjectState::setObjectProperty void Foam::functionObjects::stateFunctionObject::setObjectProperty
( (
const word& objectName, const word& objectName,
const word& entryName, const word& entryName,
@ -141,18 +125,18 @@ void Foam::functionObjectState::setObjectProperty
template<class Type> template<class Type>
void Foam::functionObjectState::setResult void Foam::functionObjects::stateFunctionObject::setResult
( (
const word& entryName, const word& entryName,
const Type& value const Type& value
) )
{ {
setObjectResult(name_, entryName, value); setObjectResult(name(), entryName, value);
} }
template<class Type> template<class Type>
void Foam::functionObjectState::setObjectResult void Foam::functionObjects::stateFunctionObject::setObjectResult
( (
const word& objectName, const word& objectName,
const word& entryName, const word& entryName,
@ -170,7 +154,7 @@ void Foam::functionObjectState::setObjectResult
if (!resultsDict.found(objectName)) if (!resultsDict.found(objectName))
{ {
resultsDict.add(name_, dictionary()); resultsDict.add(name(), dictionary());
} }
dictionary& objectDict = resultsDict.subDict(objectName); dictionary& objectDict = resultsDict.subDict(objectName);
@ -189,18 +173,18 @@ void Foam::functionObjectState::setObjectResult
template<class Type> template<class Type>
Type Foam::functionObjectState::getResult Type Foam::functionObjects::stateFunctionObject::getResult
( (
const word& entryName, const word& entryName,
const Type& defaultValue const Type& defaultValue
) const ) const
{ {
return getObjectResult(name_, entryName, defaultValue); return getObjectResult(name(), entryName, defaultValue);
} }
template<class Type> template<class Type>
Type Foam::functionObjectState::getObjectResult Type Foam::functionObjects::stateFunctionObject::getObjectResult
( (
const word& objectName, const word& objectName,
const word& entryName, const word& entryName,
@ -214,7 +198,7 @@ Type Foam::functionObjectState::getObjectResult
template<class Type> template<class Type>
void Foam::functionObjectState::getObjectResult void Foam::functionObjects::stateFunctionObject::getObjectResult
( (
const word& objectName, const word& objectName,
const word& entryName, const word& entryName,

View File

@ -60,6 +60,7 @@ public:
ocAdjustableRunTime, //!< Adjust time step for execution ocAdjustableRunTime, //!< Adjust time step for execution
ocRunTime, //!< run time for execution ocRunTime, //!< run time for execution
ocClockTime, //!< clock time for execution ocClockTime, //!< clock time for execution
ocCpuTime, //!< CPU time for execution
ocOnEnd, //!< on end of run ocOnEnd, //!< on end of run
ocNone //!< no execution ocNone //!< no execution
}; };

View File

@ -93,7 +93,7 @@ Foam::autoPtr<Foam::OFstream> Foam::functionObjects::writeFile::createFile
if (Pstream::master() && writeToFile_) if (Pstream::master() && writeToFile_)
{ {
const word startTimeName = const word startTimeName =
obr_.time().timeName(obr_.time().startTime().value()); fileObr_.time().timeName(fileObr_.time().startTime().value());
fileName outputDir(baseFileDir()/prefix_/startTimeName); fileName outputDir(baseFileDir()/prefix_/startTimeName);
@ -105,7 +105,7 @@ Foam::autoPtr<Foam::OFstream> Foam::functionObjects::writeFile::createFile
IFstream is(outputDir/(fName + ".dat")); IFstream is(outputDir/(fName + ".dat"));
if (is.good()) if (is.good())
{ {
fName = fName + "_" + obr_.time().timeName(); fName = fName + "_" + fileObr_.time().timeName();
} }
osPtr.set(new OFstream(outputDir/(fName + ".dat"))); osPtr.set(new OFstream(outputDir/(fName + ".dat")));

View File

@ -40,6 +40,7 @@ SourceFiles
#define functionObjects_writeFile_H #define functionObjects_writeFile_H
#include "objectRegistry.H" #include "objectRegistry.H"
#include "OFstream.H"
#include "IOmanip.H" #include "IOmanip.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -129,7 +130,8 @@ public:
const word& prefix const word& prefix
); );
//- Construct from components and read options from dictionary //- Construct from objectRegistry and prefix, and read options
// from dictionary
writeFile writeFile
( (
const objectRegistry& obr, const objectRegistry& obr,
@ -151,6 +153,12 @@ public:
//- Return access to the file (if only 1) //- Return access to the file (if only 1)
OFstream& file(); OFstream& file();
//- Flag to allow writing to file
bool writeToFile() const;
//- Return width of character stream output
label charWidth() const;
//- Write a commented string to stream //- Write a commented string to stream
void writeCommented(Ostream& os, const string& str) const; void writeCommented(Ostream& os, const string& str) const;
@ -171,9 +179,6 @@ public:
const string& property, const string& property,
const Type& value const Type& value
) const; ) const;
//- Return width of character stream output
label charWidth() const;
}; };

View File

@ -84,149 +84,4 @@ Foam::wordList Foam::fieldNames
} }
}
template<class GeoFieldType>
void Foam::readFields
(
const typename GeoFieldType::Mesh& mesh,
const IOobjectList& objects,
const HashSet<word>& selectedFields,
LIFOStack<regIOobject*>& storedObjects
)
{
IOobjectList fields(objects.lookupClass(GeoFieldType::typeName));
if (!fields.size()) return;
bool firstField = true;
forAllConstIter(IOobjectList, fields, fieldIter)
{
const IOobject& io = *fieldIter();
const word& fieldName = io.name();
if (selectedFields.found(fieldName))
{
if (firstField)
{
Info<< " " << GeoFieldType::typeName << "s:";
firstField = false;
}
Info<< " " << fieldName;
GeoFieldType* fieldPtr = new GeoFieldType
(
IOobject
(
fieldName,
io.instance(),
io.local(),
io.db(),
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
);
fieldPtr->store();
storedObjects.push(fieldPtr);
}
}
if (!firstField)
{
Info<< endl;
}
}
template<class UniformFieldType>
void Foam::readUniformFields
(
const IOobjectList& objects,
const HashSet<word>& selectedFields,
LIFOStack<regIOobject*>& storedObjects,
const bool syncPar
)
{
// Search list of objects for wanted type
IOobjectList fields(objects.lookupClass(UniformFieldType::typeName));
if (!fields.size()) return;
wordList masterNames(fields.names());
if (syncPar && Pstream::parRun())
{
// Check that I have the same fields as the master
const wordList localNames(masterNames);
Pstream::scatter(masterNames);
HashSet<word> localNamesSet(localNames);
forAll(masterNames, i)
{
const word& masterFld = masterNames[i];
HashSet<word>::iterator iter = localNamesSet.find(masterFld);
if (iter == localNamesSet.end())
{
FatalErrorInFunction
<< "Fields not synchronised across processors." << endl
<< "Master has fields " << masterNames
<< " processor " << Pstream::myProcNo()
<< " has fields " << localNames << exit(FatalError);
}
else
{
localNamesSet.erase(iter);
}
}
forAllConstIter(HashSet<word>, localNamesSet, iter)
{
FatalErrorInFunction
<< "Fields not synchronised across processors." << endl
<< "Master has fields " << masterNames
<< " processor " << Pstream::myProcNo()
<< " has fields " << localNames << exit(FatalError);
}
}
bool firstField = true;
forAll(masterNames, i)
{
const IOobject& io = *fields[masterNames[i]];
const word& fieldName = io.name();
if (selectedFields.found(fieldName))
{
if (firstField)
{
Info<< " " << UniformFieldType::typeName << "s:";
firstField = false;
}
Info<< " " << fieldName;
UniformFieldType* fieldPtr = new UniformFieldType
(
IOobject
(
fieldName,
io.instance(),
io.local(),
io.db(),
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
fieldPtr->store();
storedObjects.push(fieldPtr);
}
}
Info<< endl;
// ************************************************************************* // // ************************************************************************* //

View File

@ -311,4 +311,149 @@ void Foam::ReadFields
} }
template<class GeoFieldType>
void Foam::readFields
(
const typename GeoFieldType::Mesh& mesh,
const IOobjectList& objects,
const HashSet<word>& selectedFields,
LIFOStack<regIOobject*>& storedObjects
)
{
IOobjectList fields(objects.lookupClass(GeoFieldType::typeName));
if (!fields.size()) return;
bool firstField = true;
forAllConstIter(IOobjectList, fields, fieldIter)
{
const IOobject& io = *fieldIter();
const word& fieldName = io.name();
if (selectedFields.found(fieldName))
{
if (firstField)
{
Info<< " " << GeoFieldType::typeName << "s:";
firstField = false;
}
Info<< " " << fieldName;
GeoFieldType* fieldPtr = new GeoFieldType
(
IOobject
(
fieldName,
io.instance(),
io.local(),
io.db(),
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
);
fieldPtr->store();
storedObjects.push(fieldPtr);
}
}
if (!firstField)
{
Info<< endl;
}
}
template<class UniformFieldType>
void Foam::readUniformFields
(
const IOobjectList& objects,
const HashSet<word>& selectedFields,
LIFOStack<regIOobject*>& storedObjects,
const bool syncPar
)
{
// Search list of objects for wanted type
IOobjectList fields(objects.lookupClass(UniformFieldType::typeName));
if (!fields.size()) return;
wordList masterNames(fields.names());
if (syncPar && Pstream::parRun())
{
// Check that I have the same fields as the master
const wordList localNames(masterNames);
Pstream::scatter(masterNames);
HashSet<word> localNamesSet(localNames);
forAll(masterNames, i)
{
const word& masterFld = masterNames[i];
HashSet<word>::iterator iter = localNamesSet.find(masterFld);
if (iter == localNamesSet.end())
{
FatalErrorInFunction
<< "Fields not synchronised across processors." << endl
<< "Master has fields " << masterNames
<< " processor " << Pstream::myProcNo()
<< " has fields " << localNames << exit(FatalError);
}
else
{
localNamesSet.erase(iter);
}
}
forAllConstIter(HashSet<word>, localNamesSet, iter)
{
FatalErrorInFunction
<< "Fields not synchronised across processors." << endl
<< "Master has fields " << masterNames
<< " processor " << Pstream::myProcNo()
<< " has fields " << localNames << exit(FatalError);
}
}
bool firstField = true;
forAll(masterNames, i)
{
const IOobject& io = *fields[masterNames[i]];
const word& fieldName = io.name();
if (selectedFields.found(fieldName))
{
if (firstField)
{
Info<< " " << UniformFieldType::typeName << "s:";
firstField = false;
}
Info<< " " << fieldName;
UniformFieldType* fieldPtr = new UniformFieldType
(
IOobject
(
fieldName,
io.instance(),
io.local(),
io.db(),
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
fieldPtr->store();
storedObjects.push(fieldPtr);
}
}
Info<< endl;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -32,7 +32,7 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// In case of no transform: copy elements template<class T>
void Foam::mapDistribute::applyDummyTransforms(List<T>& field) const void Foam::mapDistribute::applyDummyTransforms(List<T>& field) const
{ {
forAll(transformElements_, trafoI) forAll(transformElements_, trafoI)

View File

@ -1120,9 +1120,9 @@ bool Foam::polyBoundaryMesh::writeData(Ostream& os) const
forAll(patches, patchi) forAll(patches, patchi)
{ {
os << indent << patches[patchi].name() << nl os.beginBlock(patches[patchi].name()) << nl;
os << patches[patchi]; os << patches[patchi];
<< incrIndent << patches[patchi] << decrIndent os.endBlock() << endl;
} }
os << decrIndent << token::END_LIST; os << decrIndent << token::END_LIST;

View File

@ -91,6 +91,7 @@ void Foam::polyMesh::updateMesh(const mapPolyMesh& mpm)
newMotionPoints[newPointi] = points_[newPointi]; newMotionPoints[newPointi] = points_[newPointi];
} }
} }
}
else else
{ {
const labelList& pointMap = mpm.pointMap(); const labelList& pointMap = mpm.pointMap();
@ -103,7 +104,7 @@ void Foam::polyMesh::updateMesh(const mapPolyMesh& mpm)
{ {
if (revPointMap[oldPointi] == newPointi) // master point if (revPointMap[oldPointi] == newPointi) // master point
{ {
newMotionPoints[newPoint] = oldMotionPoints[oldPointi]; newMotionPoints[newPointi] = oldMotionPoints[oldPointi];
} }
else else
{ {

View File

@ -126,8 +126,8 @@ Foam::polyPatch::polyPatch
), ),
start_(start), start_(start),
boundaryMesh_(bm), boundaryMesh_(bm),
faceCellsPtr_(NULL), faceCellsPtr_(nullptr),
mePtr_(NULL) mePtr_(nullptr)
{} {}

View File

@ -45,7 +45,7 @@ namespace Foam
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class CompressibleTurbulenceModel Declaration Class CompressibleTurbulenceModel Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
template<class TransportModel> template<class TransportModel>

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -147,8 +147,8 @@ externalWallHeatFluxTemperatureFvPatchScalarField
<< "\n number of layers for thicknessLayers and " << "\n number of layers for thicknessLayers and "
<< "kappaLayers must be the same" << "kappaLayers must be the same"
<< "\n for patch " << p.name() << "\n for patch " << p.name()
<< " of field " << dimensionedInternalField().name() << " of field " << internalField().name()
<< " in file " << dimensionedInternalField().objectPath() << " in file " << internalField().objectPath()
<< exit(FatalIOError); << exit(FatalIOError);
} }
} }
@ -331,7 +331,7 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
Info<< patch().boundaryMesh().mesh().name() << ':' Info<< patch().boundaryMesh().mesh().name() << ':'
<< patch().name() << ':' << patch().name() << ':'
<< this->internalField().name() << " :" << internalField().name() << " :"
<< " heat transfer rate:" << Q << " heat transfer rate:" << Q
<< " wall temperature " << " wall temperature "
<< " min:" << gMin(*this) << " min:" << gMin(*this)

View File

@ -117,8 +117,8 @@ public:
//- Operation mode enumeration //- Operation mode enumeration
enum operationMode enum operationMode
{ {
fixedHeatFlux, fixedHeatFlux, //< Fixed heat flux
fixedHeatTransferCoeff, fixedHeatTransferCoeff, //< Fixed heat transfer coefficient
unknown unknown
}; };

View File

@ -114,8 +114,8 @@ fixedIncidentRadiationFvPatchScalarField
QrIncident_(ptf.QrIncident_) QrIncident_(ptf.QrIncident_)
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::radiation::fixedIncidentRadiationFvPatchScalarField::autoMap void Foam::radiation::fixedIncidentRadiationFvPatchScalarField::autoMap
( (
@ -159,15 +159,12 @@ void Foam::radiation::fixedIncidentRadiationFvPatchScalarField::updateCoeffs()
scalarField emissivity scalarField emissivity
( (
radiation.absorptionEmission().e()().boundaryField() radiation.absorptionEmission().e()().boundaryField()[patch().index()]
[
patch().index()
]
); );
gradient() = gradient() =
emissivity* emissivity
( *(
QrIncident_ QrIncident_
- physicoChemical::sigma.value()*pow4(*this) - physicoChemical::sigma.value()*pow4(*this)
)/kappa(*this); )/kappa(*this);
@ -179,7 +176,7 @@ void Foam::radiation::fixedIncidentRadiationFvPatchScalarField::updateCoeffs()
scalar Qr = gSum(kappa(*this)*gradient()*patch().magSf()); scalar Qr = gSum(kappa(*this)*gradient()*patch().magSf());
Info<< patch().boundaryMesh().mesh().name() << ':' Info<< patch().boundaryMesh().mesh().name() << ':'
<< patch().name() << ':' << patch().name() << ':'
<< this->dimensionedInternalField().name() << " -> " << this->internalField().name() << " -> "
<< " radiativeFlux:" << Qr << " radiativeFlux:" << Qr
<< " walltemperature " << " walltemperature "
<< " min:" << gMin(*this) << " min:" << gMin(*this)

View File

@ -135,7 +135,7 @@ Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::kappa
const basicThermo& thermo = const basicThermo& thermo =
mesh.lookupObject<basicThermo>(basicThermo::dictName); mesh.lookupObject<basicThermo>(basicThermo::dictName);
return thermo.kappa(patchI); return thermo.kappa(patchi);
} }
else else
{ {

View File

@ -100,9 +100,6 @@ makeLESModel(dynamicKEqn);
#include "dynamicLagrangian.H" #include "dynamicLagrangian.H"
makeLESModel(dynamicLagrangian); makeLESModel(dynamicLagrangian);
#include "kOmegaSSTDES.H"
makeLESModel(kOmegaSSTDES);
#include "SpalartAllmarasDES.H" #include "SpalartAllmarasDES.H"
makeLESModel(SpalartAllmarasDES); makeLESModel(SpalartAllmarasDES);

View File

@ -96,9 +96,6 @@ makeLESModel(dynamicKEqn);
#include "dynamicLagrangian.H" #include "dynamicLagrangian.H"
makeLESModel(dynamicLagrangian); makeLESModel(dynamicLagrangian);
#include "kOmegaSSTDES.H"
makeLESModel(kOmegaSSTDES);
#include "SpalartAllmarasDES.H" #include "SpalartAllmarasDES.H"
makeLESModel(SpalartAllmarasDES); makeLESModel(SpalartAllmarasDES);

View File

@ -128,6 +128,28 @@ void kOmegaSSTBase<BasicEddyViscosityModel>::correctNut()
} }
template<class BasicEddyViscosityModel>
tmp<volScalarField::Internal> kOmegaSSTBase<BasicEddyViscosityModel>::Pk
(
const volScalarField::Internal& G
) const
{
return min(G, (c1_*betaStar_)*this->k_()*this->omega_());
}
template<class BasicEddyViscosityModel>
tmp<volScalarField::Internal>
kOmegaSSTBase<BasicEddyViscosityModel>::epsilonByk
(
const volScalarField::Internal& F1,
const volScalarField::Internal& F2
) const
{
return betaStar_*omega_();
}
template<class BasicEddyViscosityModel> template<class BasicEddyViscosityModel>
tmp<fvScalarMatrix> kOmegaSSTBase<BasicEddyViscosityModel>::kSource() const tmp<fvScalarMatrix> kOmegaSSTBase<BasicEddyViscosityModel>::kSource() const
{ {
@ -409,7 +431,7 @@ void kOmegaSSTBase<BasicEddyViscosityModel>::correct()
tgradU.clear(); tgradU.clear();
// Update omega and G at the wall // Update omega and G at the wall
omega_.boundaryField().updateCoeffs(); omega_.boundaryFieldRef().updateCoeffs();
volScalarField CDkOmega volScalarField CDkOmega
( (
@ -449,7 +471,7 @@ void kOmegaSSTBase<BasicEddyViscosityModel>::correct()
omegaEqn.ref().relax(); omegaEqn.ref().relax();
fvOptions.constrain(omegaEqn.ref()); fvOptions.constrain(omegaEqn.ref());
omegaEqn.ref().boundaryManipulate(omega_.boundaryField()); omegaEqn.ref().boundaryManipulate(omega_.boundaryFieldRef());
solve(omegaEqn); solve(omegaEqn);
fvOptions.correct(omega_); fvOptions.correct(omega_);
bound(omega_, this->omegaMin_); bound(omega_, this->omegaMin_);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -52,7 +52,7 @@ Description
and the addition of the optional F3 term for rough walls from and the addition of the optional F3 term for rough walls from
\verbatim \verbatim
Hellsten, A. (1998). Hellsten, A. (1998).
"Some Improvements in Menters k-omega-SST turbulence model" "Some Improvements in Menter's k-omega-SST turbulence model"
29th AIAA Fluid Dynamics Conference, AIAA-98-2554. 29th AIAA Fluid Dynamics Conference, AIAA-98-2554.
\endverbatim \endverbatim
@ -202,8 +202,24 @@ protected:
virtual void correctNut(const volScalarField& S2); virtual void correctNut(const volScalarField& S2);
virtual void correctNut(); virtual void correctNut();
//- Return k production rate
virtual tmp<volScalarField::Internal> Pk
(
const volScalarField::Internal& G
) const;
//- Return epsilon/k which for standard RAS is betaStar*omega
virtual tmp<volScalarField::Internal> epsilonByk
(
const volScalarField::Internal& F1,
const volScalarField::Internal& F2
) const;
virtual tmp<fvScalarMatrix> kSource() const; virtual tmp<fvScalarMatrix> kSource() const;
virtual tmp<fvScalarMatrix> omegaSource() const; virtual tmp<fvScalarMatrix> omegaSource() const;
virtual tmp<fvScalarMatrix> Qsas virtual tmp<fvScalarMatrix> Qsas
( (
const volScalarField& S2, const volScalarField& S2,

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -98,7 +98,7 @@ tmp<volScalarField> SpalartAllmarasIDDES<BasicTurbulenceModel>::rd
scalar(10) scalar(10)
) )
); );
tr.ref().boundaryField() == 0.0; tr.ref().boundaryFieldRef() == 0.0;
return tr; return tr;
} }

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -56,7 +56,7 @@ tmp<volScalarField> kOmegaSSTDDES<BasicTurbulenceModel>::rd
scalar(10) scalar(10)
) )
); );
tr.ref().boundaryField() == 0.0; tr.ref().boundaryFieldRef() == 0.0;
return tr; return tr;
} }

View File

@ -179,7 +179,7 @@ void kOmegaSSTDES<BasicTurbulenceModel>::correct()
tgradU.clear(); tgradU.clear();
// Update omega and G at the wall // Update omega and G at the wall
omega.boundaryField().updateCoeffs(); omega.boundaryFieldRef().updateCoeffs();
volScalarField CDkOmega volScalarField CDkOmega
( (
@ -208,7 +208,7 @@ void kOmegaSSTDES<BasicTurbulenceModel>::correct()
omegaEqn.ref().relax(); omegaEqn.ref().relax();
omegaEqn.ref().boundaryManipulate(omega.boundaryField()); omegaEqn.ref().boundaryManipulate(omega.boundaryFieldRef());
solve(omegaEqn); solve(omegaEqn);
bound(omega, this->omegaMin_); bound(omega, this->omegaMin_);

View File

@ -98,7 +98,7 @@ tmp<volScalarField> kOmegaSSTIDDES<BasicTurbulenceModel>::rd
scalar(10) scalar(10)
) )
); );
tr.ref().boundaryField() == 0.0; tr.ref().boundaryFieldRef() == 0.0;
return tr; return tr;
} }

View File

@ -1,156 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "kOmegaSSTDES.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace LESModels
{
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
template<class BasicTurbulenceModel>
tmp<volScalarField::Internal> kOmegaSSTDES<BasicTurbulenceModel>::Lt() const
{
return sqrt(this->k_())/(this->betaStar_*this->omega_());
}
template<class BasicTurbulenceModel>
tmp<volScalarField::Internal> kOmegaSSTDES<BasicTurbulenceModel>::FDES
(
const volScalarField::Internal& F1,
const volScalarField::Internal& F2
) const
{
switch (FSST_)
{
case 0:
return max(Lt()/(CDES_*this->delta()()), scalar(1));
case 1:
return max(Lt()*(1 - F1)/(CDES_*this->delta()()), scalar(1));
case 2:
return max(Lt()*(1 - F2)/(CDES_*this->delta()()), scalar(1));
default:
FatalErrorInFunction
<< "Incorrect FSST = " << FSST_ << ", should be 0, 1 or 2"
<< exit(FatalError);
return F1;
}
}
template<class BasicTurbulenceModel>
tmp<volScalarField::Internal> kOmegaSSTDES<BasicTurbulenceModel>::epsilonByk
(
const volScalarField::Internal& F1,
const volScalarField::Internal& F2
) const
{
return this->betaStar_*this->omega_()*FDES(F1, F2);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class BasicTurbulenceModel>
kOmegaSSTDES<BasicTurbulenceModel>::kOmegaSSTDES
(
const alphaField& alpha,
const rhoField& rho,
const volVectorField& U,
const surfaceScalarField& alphaRhoPhi,
const surfaceScalarField& phi,
const transportModel& transport,
const word& propertiesName,
const word& type
)
:
kOmegaSST
<
LESeddyViscosity<BasicTurbulenceModel>,
BasicTurbulenceModel
>
(
type,
alpha,
rho,
U,
alphaRhoPhi,
phi,
transport,
propertiesName
),
CDES_
(
dimensioned<scalar>::lookupOrAddToDict
(
"CDES",
this->coeffDict_,
0.61
)
),
FSST_(this->coeffDict_.lookupOrDefault("FSST", 2))
{
if (type == typeName)
{
this->printCoeffs(type);
}
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class BasicTurbulenceModel>
bool kOmegaSSTDES<BasicTurbulenceModel>::read()
{
if
(
kOmegaSST<LESeddyViscosity<BasicTurbulenceModel>, BasicTurbulenceModel>
::read()
)
{
CDES_.readIfPresent(this->coeffDict());
this->coeffDict().readIfPresent("FSST", FSST_);
return true;
}
else
{
return false;
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace LESModels
} // End namespace Foam
// ************************************************************************* //

View File

@ -1,174 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::LESModels::kOmegaSST
Description
Implementation of the k-omega-SST-DES turbulence model for
incompressible and compressible flows.
DES model described in:
\verbatim
Menter, F. R., Kuntz, M., and Langtry, R. (2003).
Ten Years of Industrial Experience with the SST Turbulence Model.
Turbulence, Heat and Mass Transfer 4, ed: K. Hanjalic, Y. Nagano,
& M. Tummers, Begell House, Inc., 625 - 632.
\endverbatim
Optional support for zonal filtering based on F1 or F2 is provided as
described in the paper.
For further details of the implementation of the base k-omega-SST model
see Foam::kOmegaSST.
Group
grpLESTurbulence
See also
Foam::kOmegaSST
SourceFiles
kOmegaSST.C
\*---------------------------------------------------------------------------*/
#ifndef kOmegaSSTDES_H
#define kOmegaSSTDES_H
#include "kOmegaSSTBase.H"
#include "LESModel.H"
#include "LESeddyViscosity.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace LESModels
{
/*---------------------------------------------------------------------------*\
Class kOmegaSST Declaration
\*---------------------------------------------------------------------------*/
template<class BasicTurbulenceModel>
class kOmegaSSTDES
:
public Foam::kOmegaSST
<
LESeddyViscosity<BasicTurbulenceModel>,
BasicTurbulenceModel
>
{
protected:
// Protected data
// Model constants
//- DES coefficient
dimensionedScalar CDES_;
//- Zonal filter choice
//
// - 0: no filtering
// - 1: (1 - F1)
// - 2: (1 - F2)
direction FSST_;
// Protected Member Functions
//- Return the turbulent length-scale
tmp<volScalarField::Internal> Lt() const;
//- The DES dissipation-rate multiplier with options zonal filtering
// based on either F1 or F2
virtual tmp<volScalarField::Internal> FDES
(
const volScalarField::Internal& F1,
const volScalarField::Internal& F2
) const;
//- Return epsilon/k which for standard RAS is betaStar*omega
virtual tmp<volScalarField::Internal> epsilonByk
(
const volScalarField::Internal& F1,
const volScalarField::Internal& F2
) const;
public:
typedef typename BasicTurbulenceModel::alphaField alphaField;
typedef typename BasicTurbulenceModel::rhoField rhoField;
typedef typename BasicTurbulenceModel::transportModel transportModel;
//- Runtime type information
TypeName("kOmegaSSTDES");
// Constructors
//- Construct from components
kOmegaSSTDES
(
const alphaField& alpha,
const rhoField& rho,
const volVectorField& U,
const surfaceScalarField& alphaRhoPhi,
const surfaceScalarField& phi,
const transportModel& transport,
const word& propertiesName = turbulenceModel::propertiesName,
const word& type = typeName
);
//- Destructor
virtual ~kOmegaSSTDES()
{}
// Member Functions
//- Read model coefficients if they have changed
virtual bool read();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace LESModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "kOmegaSSTDES.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -44,7 +44,7 @@ namespace Foam
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class linearViscousStress Declaration Class linearViscousStress Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
template<class BasicTurbulenceModel> template<class BasicTurbulenceModel>

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenCFD Ltd. \\ / A nd | Copyright (C) 2015-2016 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -36,40 +36,13 @@ void Foam::combustionModels::
diffusionMulticomponent<CombThermoType, ThermoType>::init() diffusionMulticomponent<CombThermoType, ThermoType>::init()
{ {
// Load default values // Load default values
if (this->coeffs().found("Ci")) this->coeffs().readIfPresent("Ci", Ci_);
{ this->coeffs().readIfPresent("YoxStream", YoxStream_);
this->coeffs().lookup("Ci") >> Ci_; this->coeffs().readIfPresent("YfStream", YfStream_);
} this->coeffs().readIfPresent("sigma", sigma_);
this->coeffs().readIfPresent("ftCorr", ftCorr_);
if (this->coeffs().found("YoxStream")) this->coeffs().readIfPresent("alpha", alpha_);
{ this->coeffs().readIfPresent("laminarIgn", laminarIgn_);
this->coeffs().lookup("YoxStream") >> YoxStream_;
}
if (this->coeffs().found("YfStream"))
{
this->coeffs().lookup("YfStream") >> YfStream_;
}
if (this->coeffs().found("sigma"))
{
this->coeffs().lookup("sigma") >> sigma_;
}
if (this->coeffs().found("ftCorr"))
{
this->coeffs().lookup("ftCorr") >> ftCorr_;
}
if (this->coeffs().found("alpha"))
{
alpha_ = readScalar(this->coeffs().lookup("alpha"));
}
if (this->coeffs().found("laminarIgn"))
{
this->coeffs().lookup("laminarIgn") >> laminarIgn_;
}
typedef typename Reaction<ThermoType>::specieCoeffs specieCoeffs; typedef typename Reaction<ThermoType>::specieCoeffs specieCoeffs;
@ -142,7 +115,6 @@ diffusionMulticomponent<CombThermoType, ThermoType>::init()
const scalar fStoich = 1.0/(1.0 + stoicRatio_[k]); const scalar fStoich = 1.0/(1.0 + stoicRatio_[k]);
Info << "stoichiometric mixture fraction : " << fStoich << endl; Info << "stoichiometric mixture fraction : " << fStoich << endl;
} }
} }
@ -164,7 +136,7 @@ diffusionMulticomponent
specieThermo_ specieThermo_
( (
dynamic_cast<const reactingMixture<ThermoType>&> dynamic_cast<const reactingMixture<ThermoType>&>
(this->thermo()).speciesData() (this->thermo()).speciesData()
), ),
RijPtr_(reactions_.size()), RijPtr_(reactions_.size()),
Ci_(reactions_.size(), 1.0), Ci_(reactions_.size(), 1.0),
@ -218,7 +190,6 @@ diffusionMulticomponent<CombThermoType, ThermoType>::correct()
for (label k=0; k < nReactions; k++) for (label k=0; k < nReactions; k++)
{ {
RijlPtr.set RijlPtr.set
( (
k, k,
@ -246,8 +217,7 @@ diffusionMulticomponent<CombThermoType, ThermoType>::correct()
if (laminarIgn_) if (laminarIgn_)
{ {
Rijl.dimensionedInternalField() = Rijl.ref() = -this->chemistryPtr_->calculateRR(k, fuelIndex);
-this->chemistryPtr_->calculateRR(k, fuelIndex);
} }
@ -287,11 +257,9 @@ diffusionMulticomponent<CombThermoType, ThermoType>::correct()
( (
"ft" + name(k), "ft" + name(k),
( (
s_[k]*Yfuel s_[k]*Yfuel - (Yox - YoxStream_[k])
- (Yox - YoxStream_[k])
) )
/ /(
(
s_[k]*YfStream_[k] + YoxStream_[k] s_[k]*YfStream_[k] + YoxStream_[k]
) )
); );
@ -318,15 +286,9 @@ diffusionMulticomponent<CombThermoType, ThermoType>::correct()
* exp(-sqr(ft - fStoich)/(2*sqr(sigma))) * exp(-sqr(ft - fStoich)/(2*sqr(sigma)))
); );
const volScalarField topHatFilter const volScalarField topHatFilter(pos(filter - 1e-3));
(
pos(filter - 1e-3)
);
const volScalarField prob const volScalarField prob("prob" + name(k), preExp*filter);
(
"prob" + name(k), preExp*filter
);
const volScalarField RijkDiff const volScalarField RijkDiff
( (
@ -383,8 +345,7 @@ diffusionMulticomponent<CombThermoType, ThermoType>::correct()
const scalar stoichCoeff = lhs[l].stoichCoeff; const scalar stoichCoeff = lhs[l].stoichCoeff;
this->chemistryPtr_->RR(lIndex) += this->chemistryPtr_->RR(lIndex) +=
-Rijk*stoichCoeff*specieThermo_[lIndex].W() -Rijk*stoichCoeff*specieThermo_[lIndex].W()/fuelStoic/MwFuel;
/fuelStoic/MwFuel;
} }
@ -396,8 +357,7 @@ diffusionMulticomponent<CombThermoType, ThermoType>::correct()
const scalar stoichCoeff = rhs[r].stoichCoeff; const scalar stoichCoeff = rhs[r].stoichCoeff;
this->chemistryPtr_->RR(rIndex) += this->chemistryPtr_->RR(rIndex) +=
Rijk*stoichCoeff*specieThermo_[rIndex].W() Rijk*stoichCoeff*specieThermo_[rIndex].W()/fuelStoic/MwFuel;
/fuelStoic/MwFuel;
} }
} }
} }

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. \\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -280,11 +280,9 @@ void Foam::fvMeshAdder::MapVolFields
++fieldIter ++fieldIter
) )
{ {
if (debug) DebugPout
{ << "MapVolFields : Storing old time for " << fieldIter()->name()
Pout<< "MapVolFields : Storing old time for " << fieldIter()->name() << endl;
<< endl;
}
const_cast<GeometricField<Type, fvPatchField, volMesh>*>(fieldIter()) const_cast<GeometricField<Type, fvPatchField, volMesh>*>(fieldIter())
->storeOldTimes(); ->storeOldTimes();
@ -310,11 +308,9 @@ void Foam::fvMeshAdder::MapVolFields
const GeometricField<Type, fvPatchField, volMesh>& fldToAdd = const GeometricField<Type, fvPatchField, volMesh>& fldToAdd =
*fieldsToAdd[fld.name()]; *fieldsToAdd[fld.name()];
if (debug) DebugPout
{ << "MapVolFields : mapping " << fld.name()
Pout<< "MapVolFields : mapping " << fld.name() << " and " << fldToAdd.name() << endl;
<< " and " << fldToAdd.name() << endl;
}
MapVolField<Type>(meshMap, fld, fldToAdd); MapVolField<Type>(meshMap, fld, fldToAdd);
} }
@ -597,11 +593,9 @@ void Foam::fvMeshAdder::MapSurfaceFields
++fieldIter ++fieldIter
) )
{ {
if (debug) DebugPout
{ << "MapSurfaceFields : Storing old time for "
Pout<< "MapSurfaceFields : Storing old time for " << fieldIter()->name() << endl;
<< fieldIter()->name() << endl;
}
const_cast<fldType*>(fieldIter())->storeOldTimes(); const_cast<fldType*>(fieldIter())->storeOldTimes();
} }
@ -621,11 +615,9 @@ void Foam::fvMeshAdder::MapSurfaceFields
{ {
const fldType& fldToAdd = *fieldsToAdd[fld.name()]; const fldType& fldToAdd = *fieldsToAdd[fld.name()];
if (debug) DebugPout
{ << "MapSurfaceFields : mapping " << fld.name()
Pout<< "MapSurfaceFields : mapping " << fld.name() << " and " << fldToAdd.name() << endl;
<< " and " << fldToAdd.name() << endl;
}
MapSurfaceField<Type>(meshMap, fld, fldToAdd); MapSurfaceField<Type>(meshMap, fld, fldToAdd);
} }
@ -697,11 +689,9 @@ void Foam::fvMeshAdder::MapDimFields
{ {
const fldType& fldToAdd = *fieldsToAdd[fld.name()]; const fldType& fldToAdd = *fieldsToAdd[fld.name()];
if (debug) DebugPout
{ << "MapDimFields : mapping " << fld.name()
Pout<< "MapDimFields : mapping " << fld.name() << " and " << fldToAdd.name() << endl;
<< " and " << fldToAdd.name() << endl;
}
MapDimField<Type>(meshMap, fld, fldToAdd); MapDimField<Type>(meshMap, fld, fldToAdd);
} }
@ -716,80 +706,4 @@ void Foam::fvMeshAdder::MapDimFields
} }
template<class Type>
void Foam::fvMeshAdder::MapDimField
(
const mapAddedPolyMesh& meshMap,
DimensionedField<Type, volMesh>& fld,
const DimensionedField<Type, volMesh>& fldToAdd
)
{
const fvMesh& mesh = fld.mesh();
// Store old field
Field<Type> oldField(fld);
fld.setSize(mesh.nCells());
fld.rmap(oldField, meshMap.oldCellMap());
fld.rmap(fldToAdd, meshMap.addedCellMap());
}
template<class Type>
void Foam::fvMeshAdder::MapDimFields
(
const mapAddedPolyMesh& meshMap,
const fvMesh& mesh,
const fvMesh& meshToAdd
)
{
typedef DimensionedField<Type, volMesh> fldType;
// Note: use strict flag on lookupClass to avoid picking up
// volFields
HashTable<const fldType*> fields
(
mesh.objectRegistry::lookupClass<fldType>(true)
);
HashTable<const fldType*> fieldsToAdd
(
meshToAdd.objectRegistry::lookupClass<fldType>(true)
);
for
(
typename HashTable<const fldType*>::
iterator fieldIter = fields.begin();
fieldIter != fields.end();
++fieldIter
)
{
fldType& fld = const_cast<fldType&>(*fieldIter());
if (fieldsToAdd.found(fld.name()))
{
const fldType& fldToAdd = *fieldsToAdd[fld.name()];
if (debug)
{
Pout<< "MapDimFields : mapping " << fld.name()
<< " and " << fldToAdd.name() << endl;
}
MapDimField<Type>(meshMap, fld, fldToAdd);
}
else
{
WarningIn("fvMeshAdder::MapDimFields(..)")
<< "Not mapping field " << fld.name()
<< " since not present on mesh to add"
<< endl;
}
}
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -189,13 +189,14 @@ Foam::labelList Foam::fvMeshDistribute::select
} }
// Check all procs have same names and in exactly same order.
void Foam::fvMeshDistribute::checkEqualWordList void Foam::fvMeshDistribute::checkEqualWordList
( (
const string& msg, const string& msg,
const wordList& lst const wordList& lst
) )
{ {
// Check all procs have same names and in exactly same order.
List<wordList> allNames(Pstream::nProcs()); List<wordList> allNames(Pstream::nProcs());
allNames[Pstream::myProcNo()] = lst; allNames[Pstream::myProcNo()] = lst;
Pstream::gatherList(allNames); Pstream::gatherList(allNames);
@ -235,7 +236,6 @@ Foam::wordList Foam::fvMeshDistribute::mergeWordList(const wordList& procNames)
} }
// Print some info on mesh.
void Foam::fvMeshDistribute::printMeshInfo(const fvMesh& mesh) void Foam::fvMeshDistribute::printMeshInfo(const fvMesh& mesh)
{ {
Pout<< "Primitives:" << nl Pout<< "Primitives:" << nl
@ -322,9 +322,10 @@ void Foam::fvMeshDistribute::printCoupleInfo
} }
// Finds (non-empty) patch that exposed internal and proc faces can be put into.
Foam::label Foam::fvMeshDistribute::findNonEmptyPatch() const Foam::label Foam::fvMeshDistribute::findNonEmptyPatch() const
{ {
// Finds (non-empty) patch that exposed internal and proc faces can be
// put into.
const polyBoundaryMesh& patches = mesh_.boundaryMesh(); const polyBoundaryMesh& patches = mesh_.boundaryMesh();
label nonEmptyPatchi = -1; label nonEmptyPatchi = -1;
@ -412,18 +413,22 @@ Foam::tmp<Foam::surfaceScalarField> Foam::fvMeshDistribute::generateTestField
const surfaceVectorField n(mesh.Sf()/mesh.magSf()); const surfaceVectorField n(mesh.Sf()/mesh.magSf());
forAll(fld, faceI) forAll(fld, facei)
{ {
fld[faceI] = (n[faceI] & testNormal); fld[facei] = (n[facei] & testNormal);
} }
forAll(fld.boundaryField(), patchI)
surfaceScalarField::Boundary& fluxBf = fld.boundaryFieldRef();
const surfaceVectorField::Boundary& nBf = n.boundaryField();
forAll(fluxBf, patchi)
{ {
fvsPatchScalarField& fvp = fld.boundaryField()[patchI]; fvsPatchScalarField& fvp = fluxBf[patchi];
scalarField newPfld(fvp.size()); scalarField newPfld(fvp.size());
forAll(newPfld, i) forAll(newPfld, i)
{ {
newPfld[i] = (n.boundaryField()[patchI][i] & testNormal); newPfld[i] = (nBf[patchi][i] & testNormal);
} }
fvp == newPfld; fvp == newPfld;
} }
@ -441,41 +446,41 @@ void Foam::fvMeshDistribute::testField(const surfaceScalarField& fld)
const surfaceVectorField n(mesh.Sf()/mesh.magSf()); const surfaceVectorField n(mesh.Sf()/mesh.magSf());
forAll(fld, faceI) forAll(fld, facei)
{ {
scalar cos = (n[faceI] & testNormal); scalar cos = (n[facei] & testNormal);
if (mag(cos-fld[faceI]) > 1e-6) if (mag(cos - fld[facei]) > 1e-6)
{ {
//FatalErrorInFunction //FatalErrorInFunction
WarningInFunction WarningInFunction
<< "On internal face " << faceI << " at " << "On internal face " << facei << " at "
<< mesh.faceCentres()[faceI] << mesh.faceCentres()[facei]
<< " the field value is " << fld[faceI] << " the field value is " << fld[facei]
<< " whereas cos angle of " << testNormal << " whereas cos angle of " << testNormal
<< " with mesh normal " << n[faceI] << " with mesh normal " << n[facei]
<< " is " << cos << " is " << cos
//<< exit(FatalError); //<< exit(FatalError);
<< endl; << endl;
} }
} }
forAll(fld.boundaryField(), patchI) forAll(fld.boundaryField(), patchi)
{ {
const fvsPatchScalarField& fvp = fld.boundaryField()[patchI]; const fvsPatchScalarField& fvp = fld.boundaryField()[patchi];
const fvsPatchVectorField& np = n.boundaryField()[patchI]; const fvsPatchVectorField& np = n.boundaryField()[patchi];
forAll(fvp, i) forAll(fvp, i)
{ {
scalar cos = (np[i] & testNormal); scalar cos = (np[i] & testNormal);
if (mag(cos-fvp[i]) > 1e-6) if (mag(cos - fvp[i]) > 1e-6)
{ {
label faceI = fvp.patch().start()+i; label facei = fvp.patch().start()+i;
//FatalErrorInFunction //FatalErrorInFunction
WarningInFunction WarningInFunction
<< "On face " << faceI << "On face " << facei
<< " on patch " << fvp.patch().name() << " on patch " << fvp.patch().name()
<< " at " << mesh.faceCentres()[faceI] << " at " << mesh.faceCentres()[facei]
<< " the field value is " << fvp[i] << " the field value is " << fvp[i]
<< " whereas cos angle of " << testNormal << " whereas cos angle of " << testNormal
<< " with mesh normal " << np[i] << " with mesh normal " << np[i]
@ -488,13 +493,14 @@ void Foam::fvMeshDistribute::testField(const surfaceScalarField& fld)
} }
// Delete all processor patches. Move any processor faces into the last
// non-processor patch.
Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::deleteProcPatches Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::deleteProcPatches
( (
const label destinationPatch const label destinationPatch
) )
{ {
// Delete all processor patches. Move any processor faces into the last
// non-processor patch.
// New patchID per boundary faces to be repatched. Is -1 (no change) // New patchID per boundary faces to be repatched. Is -1 (no change)
// or new patchID // or new patchID
labelList newPatchID(mesh_.nFaces() - mesh_.nInternalFaces(), -1); labelList newPatchID(mesh_.nFaces() - mesh_.nInternalFaces(), -1);
@ -535,23 +541,23 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::deleteProcPatches
// Delete (now empty) processor patches. // Delete (now empty) processor patches.
{ {
labelList oldToNew(identity(mesh_.boundaryMesh().size())); labelList oldToNew(identity(mesh_.boundaryMesh().size()));
label newI = 0; label newi = 0;
// Non processor patches first // Non processor patches first
forAll(mesh_.boundaryMesh(), patchi) forAll(mesh_.boundaryMesh(), patchi)
{ {
if (!isA<processorPolyPatch>(mesh_.boundaryMesh()[patchi])) if (!isA<processorPolyPatch>(mesh_.boundaryMesh()[patchi]))
{ {
oldToNew[patchi] = newI++; oldToNew[patchi] = newi++;
} }
} }
label nNonProcPatches = newI; label nNonProcPatches = newi;
// Processor patches as last // Processor patches as last
forAll(mesh_.boundaryMesh(), patchi) forAll(mesh_.boundaryMesh(), patchi)
{ {
if (isA<processorPolyPatch>(mesh_.boundaryMesh()[patchi])) if (isA<processorPolyPatch>(mesh_.boundaryMesh()[patchi]))
{ {
oldToNew[patchi] = newI++; oldToNew[patchi] = newi++;
} }
} }
fvMeshTools::reorderPatches(mesh_, oldToNew, nNonProcPatches, false); fvMeshTools::reorderPatches(mesh_, oldToNew, nNonProcPatches, false);
@ -561,7 +567,6 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::deleteProcPatches
} }
// Repatch the mesh.
Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::repatch Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::repatch
( (
const labelList& newPatchID, // per boundary face -1 or new patchID const labelList& newPatchID, // per boundary face -1 or new patchID
@ -2521,7 +2526,7 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::fvMeshDistribute::distribute
const labelList& oldPatchMap = map().oldPatchMap(); const labelList& oldPatchMap = map().oldPatchMap();
//Note: old mesh faces never flipped! //Note: old mesh faces never flipped!
forAll(constructPatchMap, procI) forAll(constructPatchMap, proci)
{ {
if (proci != sendProc && constructPatchMap[proci].size()) if (proci != sendProc && constructPatchMap[proci].size())
{ {

View File

@ -48,10 +48,7 @@ namespace Foam
Foam::wordList Foam::wordList
Foam::velocityDisplacementMotionSolver::pointDisplacementBoundaryTypes() const Foam::velocityDisplacementMotionSolver::pointDisplacementBoundaryTypes() const
{ {
const pointVectorField::GeometricBoundaryField& pmUbf const pointVectorField::Boundary& pmUbf(pointMotionU().boundaryField());
(
pointMotionU().boundaryField()
);
wordList cmUbf = pmUbf.types(); wordList cmUbf = pmUbf.types();
@ -93,7 +90,7 @@ Foam::velocityDisplacementMotionSolver::velocityDisplacementMotionSolver
pointDisplacementBoundaryTypes() pointDisplacementBoundaryTypes()
); );
pointDisplacement.internalField() = mesh.points() - points0; pointDisplacement.primitiveFieldRef() = mesh.points() - points0;
displacementMotionSolverPtr_.set displacementMotionSolverPtr_.set
( (
@ -155,6 +152,8 @@ void Foam::velocityDisplacementMotionSolver::solve()
// Update the velocity boundary conditions // Update the velocity boundary conditions
pointMotionU().correctBoundaryConditions(); pointMotionU().correctBoundaryConditions();
pointVectorField::Boundary& dispBf = displacement.boundaryFieldRef();
// Update the displacement boundary conditions // Update the displacement boundary conditions
forAll(pointMotionU().boundaryField(), patchI) forAll(pointMotionU().boundaryField(), patchI)
{ {
@ -163,7 +162,7 @@ void Foam::velocityDisplacementMotionSolver::solve()
pointMotionU().boundaryField()[patchI] pointMotionU().boundaryField()[patchI]
); );
displacement.boundaryField()[patchI] == dispBf[patchI] ==
patchField.patchInternalField()*deltaT patchField.patchInternalField()*deltaT
+ patchField.patchInternalField(displacementOld); + patchField.patchInternalField(displacementOld);
} }
@ -172,8 +171,8 @@ void Foam::velocityDisplacementMotionSolver::solve()
displacementMotionSolverPtr_->solve(); displacementMotionSolverPtr_->solve();
// Update the velocity // Update the velocity
pointMotionU().internalField() = pointMotionU().primitiveFieldRef() =
(displacement.internalField() - displacementOld)/deltaT; (displacement.primitiveField() - displacementOld)/deltaT;
} }

View File

@ -50,11 +50,11 @@ namespace Foam
Foam::label Foam::addPatchCellLayer::nbrFace Foam::label Foam::addPatchCellLayer::nbrFace
( (
const labelListList& edgeFaces, const labelListList& edgeFaces,
const label edgeI, const label edgei,
const label facei const label facei
) )
{ {
const labelList& eFaces = edgeFaces[edgeI]; const labelList& eFaces = edgeFaces[edgei];
if (eFaces.size() == 2) if (eFaces.size() == 2)
{ {
@ -97,19 +97,19 @@ bool Foam::addPatchCellLayer::sameEdgeNeighbour
const boolList& doneEdge, const boolList& doneEdge,
const label thisGlobalFacei, const label thisGlobalFacei,
const label nbrGlobalFacei, const label nbrGlobalFacei,
const label edgeI const label edgei
) const ) const
{ {
const edge& e = pp.edges()[edgeI]; const edge& e = pp.edges()[edgei];
return return
!doneEdge[edgeI] // not yet handled !doneEdge[edgei] // not yet handled
&& ( && (
addedPoints_[e[0]].size() // is extruded addedPoints_[e[0]].size() // is extruded
|| addedPoints_[e[1]].size() || addedPoints_[e[1]].size()
) )
&& ( && (
nbrFace(globalEdgeFaces, edgeI, thisGlobalFacei) nbrFace(globalEdgeFaces, edgei, thisGlobalFacei)
== nbrGlobalFacei // is to same neighbour == nbrGlobalFacei // is to same neighbour
); );
} }
@ -135,12 +135,12 @@ Foam::labelPair Foam::addPatchCellLayer::getEdgeString
// Get edge that hasn't been done yet but needs extrusion // Get edge that hasn't been done yet but needs extrusion
forAll(fEdges, fp) forAll(fEdges, fp)
{ {
label edgeI = fEdges[fp]; label edgei = fEdges[fp];
const edge& e = pp.edges()[edgeI]; const edge& e = pp.edges()[edgei];
if if
( (
!doneEdge[edgeI] !doneEdge[edgei]
&& ( addedPoints_[e[0]].size() || addedPoints_[e[1]].size() ) && ( addedPoints_[e[0]].size() || addedPoints_[e[1]].size() )
) )
{ {
@ -229,14 +229,14 @@ Foam::label Foam::addPatchCellLayer::addSideFace
const labelListList& addedCells, // per pp face the new extruded cell const labelListList& addedCells, // per pp face the new extruded cell
const face& newFace, const face& newFace,
const label newPatchID, const label newPatchID,
const label zoneI, const label zonei,
const bool edgeFlip, const bool edgeFlip,
const label inflateFaceI, const label inflateFacei,
const label ownFaceI, // pp face that provides owner const label ownFacei, // pp face that provides owner
const label nbrFaceI, const label nbrFacei,
const label meshEdgeI, // corresponding mesh edge const label meshEdgei, // corresponding mesh edge
const label layerI, // layer const label layeri, // layer
const label numEdgeFaces, // number of layers for edge const label numEdgeFaces, // number of layers for edge
const labelList& meshFaces, // precalculated edgeFaces const labelList& meshFaces, // precalculated edgeFaces
polyTopoChange& meshMod polyTopoChange& meshMod
@ -261,18 +261,18 @@ Foam::label Foam::addPatchCellLayer::addSideFace
if (addedCells[ownFacei].size() < numEdgeFaces) if (addedCells[ownFacei].size() < numEdgeFaces)
{ {
label offset = numEdgeFaces - addedCells[ownFacei].size(); label offset = numEdgeFaces - addedCells[ownFacei].size();
if (layerI <= offset) if (layeri <= offset)
{ {
layerOwn = 0; layerOwn = 0;
} }
else else
{ {
layerOwn = layerI - offset; layerOwn = layeri - offset;
} }
} }
else else
{ {
layerOwn = layerI; layerOwn = layeri;
} }
@ -313,15 +313,15 @@ Foam::label Foam::addPatchCellLayer::addSideFace
label offset = label offset =
addedCells[ownFacei].size() - addedCells[nbrFacei].size(); addedCells[ownFacei].size() - addedCells[nbrFacei].size();
layerOwn = layerI; layerOwn = layeri;
if (layerI <= offset) if (layeri <= offset)
{ {
layerNbr = 0; layerNbr = 0;
} }
else else
{ {
layerNbr = layerI - offset; layerNbr = layeri - offset;
} }
} }
else if (addedCells[nbrFacei].size() > addedCells[ownFacei].size()) else if (addedCells[nbrFacei].size() > addedCells[ownFacei].size())
@ -329,22 +329,22 @@ Foam::label Foam::addPatchCellLayer::addSideFace
label offset = label offset =
addedCells[nbrFacei].size() - addedCells[ownFacei].size(); addedCells[nbrFacei].size() - addedCells[ownFacei].size();
layerNbr = layerI; layerNbr = layeri;
if (layerI <= offset) if (layeri <= offset)
{ {
layerOwn = 0; layerOwn = 0;
} }
else else
{ {
layerOwn = layerI - offset; layerOwn = layeri - offset;
} }
} }
else else
{ {
// Same number of layers on both sides. // Same number of layers on both sides.
layerNbr = layerI; layerNbr = layeri;
layerOwn = layerI; layerOwn = layeri;
} }
@ -364,7 +364,7 @@ Foam::label Foam::addPatchCellLayer::addSideFace
} }
addedFaceI = meshMod.setAction addedFacei = meshMod.setAction
( (
polyAddFace polyAddFace
( (
@ -422,13 +422,13 @@ void Foam::addPatchCellLayer::setFaceProps
const label facei, const label facei,
label& patchi, label& patchi,
label& zoneI, label& zonei,
bool& zoneFlip bool& zoneFlip
) )
{ {
patchi = mesh.boundaryMesh().whichPatch(facei); patchi = mesh.boundaryMesh().whichPatch(facei);
zonei = mesh.faceZones().whichZone(facei); zonei = mesh.faceZones().whichZone(facei);
if (zoneI != -1) if (zonei != -1)
{ {
label index = mesh.faceZones()[zonei].whichFace(facei); label index = mesh.faceZones()[zonei].whichFace(facei);
zoneFlip = mesh.faceZones()[zonei].flipMap()[index]; zoneFlip = mesh.faceZones()[zonei].flipMap()[index];
@ -716,13 +716,13 @@ void Foam::addPatchCellLayer::calcExtrudeInfo
// processor patch or create interprocessor-patch if necessary. // processor patch or create interprocessor-patch if necessary.
// Sets edgePatchID[edgeI] but none of the other quantities // Sets edgePatchID[edgeI] but none of the other quantities
forAll(globalEdgeFaces, edgeI) forAll(globalEdgeFaces, edgei)
{ {
const labelList& eGlobalFaces = globalEdgeFaces[edgeI]; const labelList& eGlobalFaces = globalEdgeFaces[edgei];
if if
( (
eGlobalFaces.size() == 2 eGlobalFaces.size() == 2
&& pp.edgeFaces()[edgeI].size() == 1 && pp.edgeFaces()[edgei].size() == 1
) )
{ {
// Locally but not globally a boundary edge. Hence a coupled // Locally but not globally a boundary edge. Hence a coupled
@ -746,11 +746,11 @@ void Foam::addPatchCellLayer::calcExtrudeInfo
{ {
if (findIndex(gd[Pstream::myProcNo()], otherProci) != -1) if (findIndex(gd[Pstream::myProcNo()], otherProci) != -1)
{ {
// There is already a processorPolyPatch to otherProcI. // There is already a processorPolyPatch to otherProci.
// Use it. Note that we can only index procPatchMap // Use it. Note that we can only index procPatchMap
// if the processor actually is a neighbour processor // if the processor actually is a neighbour processor
// so that is why we first check. // so that is why we first check.
edgePatchID[edgeI] = gd.procPatchMap()[otherProci]; edgePatchID[edgei] = gd.procPatchMap()[otherProci];
} }
else else
{ {
@ -786,20 +786,20 @@ void Foam::addPatchCellLayer::calcExtrudeInfo
{ {
UIndirectList<label> ppFaces(pp.addressing(), edgeFaces[edgei]); UIndirectList<label> ppFaces(pp.addressing(), edgeFaces[edgei]);
label meshEdgeI = meshEdges[edgeI]; label meshEdgei = meshEdges[edgei];
const labelList& meshFaces = mesh.edgeFaces const labelList& meshFaces = mesh.edgeFaces
( (
meshEdgeI, meshEdgei,
dynMeshEdgeFaces dynMeshEdgeFaces
); );
if (edgeFaces[edgeI].size() == 2) if (edgeFaces[edgei].size() == 2)
{ {
// Internal edge. Look at any face (internal or boundary) to // Internal edge. Look at any face (internal or boundary) to
// determine extrusion properties. First one that has zone // determine extrusion properties. First one that has zone
// info wins // info wins
label dummyPatchI = -1; label dummyPatchi = -1;
findZoneFace findZoneFace
( (
true, // useInternalFaces, true, // useInternalFaces,
@ -850,7 +850,7 @@ void Foam::addPatchCellLayer::calcExtrudeInfo
// Now hopefully every boundary edge has a edge patch. Check // Now hopefully every boundary edge has a edge patch. Check
if (debug) if (debug)
{ {
forAll(edgeFaces, edgeI) forAll(edgeFaces, edgei)
{ {
if (edgeFaces[edgei].size() == 1 && edgePatchID[edgei] == -1) if (edgeFaces[edgei].size() == 1 && edgePatchID[edgei] == -1)
{ {
@ -882,32 +882,32 @@ void Foam::addPatchCellLayer::calcExtrudeInfo
label myFaceI = pp.addressing()[edgeFaces[edgei][0]]; label myFaceI = pp.addressing()[edgeFaces[edgei][0]];
// Pick up any boundary face on this edge and use its properties // Pick up any boundary face on this edge and use its properties
label meshEdgeI = meshEdges[edgeI]; label meshEdgei = meshEdges[edgei];
const labelList& meshFaces = mesh.edgeFaces const labelList& meshFaces = mesh.edgeFaces
( (
meshEdgeI, meshEdgei,
dynMeshEdgeFaces dynMeshEdgeFaces
); );
forAll(meshFaces, k) forAll(meshFaces, k)
{ {
label faceI = meshFaces[k]; label facei = meshFaces[k];
if (faceI != myFaceI && !mesh.isInternalFace(faceI)) if (facei != myFaceI && !mesh.isInternalFace(facei))
{ {
if (patches.whichPatch(faceI) == edgePatchID[edgeI]) if (patches.whichPatch(facei) == edgePatchID[edgei])
{ {
setFaceProps setFaceProps
( (
mesh, mesh,
pp, pp,
edgeI, edgei,
faceI, facei,
edgePatchID[edgeI], edgePatchID[edgei],
edgeZoneID[edgeI], edgeZoneID[edgei],
edgeFlip[edgeI], edgeFlip[edgei],
inflateFaceID[edgeI] inflateFaceID[edgei]
); );
break; break;
} }
@ -947,17 +947,17 @@ void Foam::addPatchCellLayer::calcExtrudeInfo
boolList cppEdgeFlip(cpp.nEdges(), false); boolList cppEdgeFlip(cpp.nEdges(), false);
forAll(coupledEdges, i) forAll(coupledEdges, i)
{ {
label cppEdgeI = coupledEdges[i]; label cppEdgei = coupledEdges[i];
label ppEdgeI = patchEdges[i]; label ppEdgei = patchEdges[i];
cppEdgeZoneID[cppEdgeI] = edgeZoneID[ppEdgeI]; cppEdgeZoneID[cppEdgei] = edgeZoneID[ppEdgei];
if (sameEdgeOrientation[i]) if (sameEdgeOrientation[i])
{ {
cppEdgeFlip[cppEdgeI] = edgeFlip[ppEdgeI]; cppEdgeFlip[cppEdgei] = edgeFlip[ppEdgei];
} }
else else
{ {
cppEdgeFlip[cppEdgeI] = !edgeFlip[ppEdgeI]; cppEdgeFlip[cppEdgei] = !edgeFlip[ppEdgei];
} }
} }
@ -989,17 +989,17 @@ void Foam::addPatchCellLayer::calcExtrudeInfo
// Convert data on coupled edges to pp edges // Convert data on coupled edges to pp edges
forAll(coupledEdges, i) forAll(coupledEdges, i)
{ {
label cppEdgeI = coupledEdges[i]; label cppEdgei = coupledEdges[i];
label ppEdgeI = patchEdges[i]; label ppEdgei = patchEdges[i];
edgeZoneID[ppEdgeI] = cppEdgeZoneID[cppEdgeI]; edgeZoneID[ppEdgei] = cppEdgeZoneID[cppEdgei];
if (sameEdgeOrientation[i]) if (sameEdgeOrientation[i])
{ {
edgeFlip[ppEdgeI] = cppEdgeFlip[cppEdgeI]; edgeFlip[ppEdgei] = cppEdgeFlip[cppEdgei];
} }
else else
{ {
edgeFlip[ppEdgeI] = !cppEdgeFlip[cppEdgeI]; edgeFlip[ppEdgei] = !cppEdgeFlip[cppEdgei];
} }
} }
} }
@ -1070,11 +1070,11 @@ void Foam::addPatchCellLayer::setRefinement
} }
} }
forAll(globalEdgeFaces, edgeI) forAll(globalEdgeFaces, edgei)
{ {
if (globalEdgeFaces[edgeI].size() > 2) if (globalEdgeFaces[edgei].size() > 2)
{ {
const edge& e = pp.edges()[edgeI]; const edge& e = pp.edges()[edgei];
if (nPointLayers[e[0]] > 0 || nPointLayers[e[1]] > 0) if (nPointLayers[e[0]] > 0 || nPointLayers[e[1]] > 0)
{ {
@ -1082,10 +1082,10 @@ void Foam::addPatchCellLayer::setRefinement
<< "Trying to extrude edge " << "Trying to extrude edge "
<< e.line(pp.localPoints()) << e.line(pp.localPoints())
<< " which is non-manifold (has " << " which is non-manifold (has "
<< globalEdgeFaces[edgeI].size() << globalEdgeFaces[edgei].size()
<< " local or coupled faces using it)" << " local or coupled faces using it)"
<< " of which " << " of which "
<< pp.edgeFaces()[edgeI].size() << pp.edgeFaces()[edgei].size()
<< " local" << " local"
<< abort(FatalError); << abort(FatalError);
} }
@ -1207,15 +1207,15 @@ void Foam::addPatchCellLayer::setRefinement
// sides decide the same. // sides decide the same.
// ~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~
for (label edgeI = pp.nInternalEdges(); edgeI < pp.nEdges(); edgeI++) for (label edgei = pp.nInternalEdges(); edgei < pp.nEdges(); edgei++)
{ {
const edge& e = pp.edges()[edgeI]; const edge& e = pp.edges()[edgei];
if (nPointLayers[e[0]] > 0 || nPointLayers[e[1]] > 0) if (nPointLayers[e[0]] > 0 || nPointLayers[e[1]] > 0)
{ {
// Edge is to become a face // Edge is to become a face
const labelList& eFaces = pp.edgeFaces()[edgeI]; const labelList& eFaces = pp.edgeFaces()[edgei];
// First check: pp should be single connected. // First check: pp should be single connected.
if (eFaces.size() != 1) if (eFaces.size() != 1)
@ -1230,10 +1230,10 @@ void Foam::addPatchCellLayer::setRefinement
label myFacei = pp.addressing()[eFaces[0]]; label myFacei = pp.addressing()[eFaces[0]];
label meshEdgeI = meshEdges[edgeI]; label meshEdgei = meshEdges[edgei];
// Mesh faces using edge // Mesh faces using edge
const labelList& meshFaces = mesh_.edgeFaces(meshEdgeI, ef); const labelList& meshFaces = mesh_.edgeFaces(meshEdgei, ef);
// Check that there is only one patchface using edge. // Check that there is only one patchface using edge.
const polyBoundaryMesh& patches = mesh_.boundaryMesh(); const polyBoundaryMesh& patches = mesh_.boundaryMesh();
@ -1609,26 +1609,26 @@ void Foam::addPatchCellLayer::setRefinement
// partial list synchronisation. // partial list synchronisation.
labelList meshEdgeLayers(mesh_.nEdges(), -1); labelList meshEdgeLayers(mesh_.nEdges(), -1);
forAll(meshEdges, edgeI) forAll(meshEdges, edgei)
{ {
const edge& e = edges[edgeI]; const edge& e = edges[edgei];
label meshEdgeI = meshEdges[edgeI]; label meshEdgei = meshEdges[edgei];
if ((nPointLayers[e[0]] == 0) && (nPointLayers[e[1]] == 0)) if ((nPointLayers[e[0]] == 0) && (nPointLayers[e[1]] == 0))
{ {
meshEdgeLayers[meshEdgeI] = 0; meshEdgeLayers[meshEdgei] = 0;
} }
else else
{ {
const labelList& eFaces = pp.edgeFaces()[edgeI]; const labelList& eFaces = pp.edgeFaces()[edgei];
forAll(eFaces, i) forAll(eFaces, i)
{ {
meshEdgeLayers[meshEdgeI] = max meshEdgeLayers[meshEdgei] = max
( (
nFaceLayers[eFaces[i]], nFaceLayers[eFaces[i]],
meshEdgeLayers[meshEdgeI] meshEdgeLayers[meshEdgei]
); );
} }
} }
@ -1642,9 +1642,9 @@ void Foam::addPatchCellLayer::setRefinement
label(0) // initial value label(0) // initial value
); );
forAll(meshEdges, edgeI) forAll(meshEdges, edgei)
{ {
edgeLayers[edgeI] = meshEdgeLayers[meshEdges[edgeI]]; edgeLayers[edgei] = meshEdgeLayers[meshEdges[edgei]];
} }
} }
@ -1718,11 +1718,11 @@ void Foam::addPatchCellLayer::setRefinement
// because we loop in incrementing order as well we will // because we loop in incrementing order as well we will
// always have nbrFacei > patchFacei. // always have nbrFacei > patchFacei.
label startEdgeI = fEdges[startFp]; label startEdgei = fEdges[startFp];
label meshEdgeI = meshEdges[startEdgeI]; label meshEdgei = meshEdges[startEdgei];
label numEdgeSideFaces = edgeLayers[startEdgeI]; label numEdgeSideFaces = edgeLayers[startEdgei];
for (label i = 0; i < numEdgeSideFaces; i++) for (label i = 0; i < numEdgeSideFaces; i++)
{ {
@ -1897,9 +1897,9 @@ void Foam::addPatchCellLayer::setRefinement
) << nl ) << nl
<< "Layer:" << i << "Layer:" << i
<< " out of:" << numEdgeSideFaces << nl << " out of:" << numEdgeSideFaces << nl
<< "ExtrudeEdge:" << meshEdgeI << "ExtrudeEdge:" << meshEdgei
<< " at:" << " at:"
<< mesh_.edges()[meshEdgeI].line << mesh_.edges()[meshEdgei].line
( (
mesh_.points() mesh_.points()
) << nl ) << nl
@ -1924,13 +1924,13 @@ void Foam::addPatchCellLayer::setRefinement
label nbrFacei = nbrFace label nbrFacei = nbrFace
( (
pp.edgeFaces(), pp.edgeFaces(),
startEdgeI, startEdgei,
patchFacei patchFacei
); );
const labelList& meshFaces = mesh_.edgeFaces const labelList& meshFaces = mesh_.edgeFaces
( (
meshEdgeI, meshEdgei,
ef ef
); );
@ -1938,9 +1938,9 @@ void Foam::addPatchCellLayer::setRefinement
// of face edges so face orientation will be opposite // of face edges so face orientation will be opposite
// that of the patch edge // that of the patch edge
bool zoneFlip = false; bool zoneFlip = false;
if (edgeZoneID[startEdgeI] != -1) if (edgeZoneID[startEdgei] != -1)
{ {
zoneFlip = !edgeFlip[startEdgeI]; zoneFlip = !edgeFlip[startEdgei];
} }
addSideFace addSideFace
@ -1949,14 +1949,14 @@ void Foam::addPatchCellLayer::setRefinement
addedCells, addedCells,
newFace, // vertices of new face newFace, // vertices of new face
edgePatchID[startEdgeI],// -1 or patch for face edgePatchID[startEdgei],// -1 or patch for face
edgeZoneID[startEdgeI], edgeZoneID[startEdgei],
zoneFlip, zoneFlip,
inflateFaceID[startEdgeI], inflateFaceID[startEdgei],
patchFaceI, patchFacei,
nbrFaceI, nbrFacei,
meshEdgeI, // (mesh) edge to inflate meshEdgei, // (mesh) edge to inflate
i, // layer i, // layer
numEdgeSideFaces, // num layers numEdgeSideFaces, // num layers
meshFaces, // edgeFaces meshFaces, // edgeFaces

View File

@ -557,7 +557,6 @@ void Foam::refinementHistory::apply
Foam::refinementHistory::refinementHistory(const IOobject& io) Foam::refinementHistory::refinementHistory(const IOobject& io)
: :
regIOobject(io), regIOobject(io),
refCount(),
active_(false) active_(false)
{ {
// Warn for MUST_READ_IF_MODIFIED // Warn for MUST_READ_IF_MODIFIED
@ -600,7 +599,6 @@ Foam::refinementHistory::refinementHistory
) )
: :
regIOobject(io), regIOobject(io),
refCount(),
active_(active), active_(active),
splitCells_(splitCells), splitCells_(splitCells),
freeSplitCells_(0), freeSplitCells_(0),
@ -642,7 +640,6 @@ Foam::refinementHistory::refinementHistory
) )
: :
regIOobject(io), regIOobject(io),
refCount(),
active_(false), active_(false),
freeSplitCells_(0) freeSplitCells_(0)
{ {
@ -698,7 +695,6 @@ Foam::refinementHistory::refinementHistory
) )
: :
regIOobject(io), regIOobject(io),
refCount(),
active_(active), active_(active),
freeSplitCells_(0) freeSplitCells_(0)
{ {
@ -750,7 +746,6 @@ Foam::refinementHistory::refinementHistory
) )
: :
regIOobject(io), regIOobject(io),
refCount(),
active_(rh.active_), active_(rh.active_),
splitCells_(rh.splitCells()), splitCells_(rh.splitCells()),
freeSplitCells_(rh.freeSplitCells()), freeSplitCells_(rh.freeSplitCells()),
@ -773,7 +768,6 @@ Foam::refinementHistory::refinementHistory
) )
: :
regIOobject(io), regIOobject(io),
refCount(),
active_(false) active_(false)
{ {
if if
@ -886,7 +880,6 @@ Foam::refinementHistory::refinementHistory
Foam::refinementHistory::refinementHistory(const IOobject& io, Istream& is) Foam::refinementHistory::refinementHistory(const IOobject& io, Istream& is)
: :
regIOobject(io), regIOobject(io),
refCount(),
splitCells_(is), splitCells_(is),
freeSplitCells_(0), freeSplitCells_(0),
visibleCells_(is) visibleCells_(is)

View File

@ -71,7 +71,6 @@ SourceFiles
#ifndef refinementHistory_H #ifndef refinementHistory_H
#define refinementHistory_H #define refinementHistory_H
#include "UPtrList.H"
#include "DynamicList.H" #include "DynamicList.H"
#include "labelList.H" #include "labelList.H"
#include "FixedList.H" #include "FixedList.H"
@ -99,13 +98,12 @@ Ostream& operator<<(Ostream&, const refinementHistory&);
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class refinementHistory Declaration Class refinementHistory Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class refinementHistory class refinementHistory
: :
public regIOobject, public regIOobject
public refCount
{ {
public: public:

View File

@ -481,9 +481,9 @@ void Foam::polyTopoChange::makeCells
if (faceOwner_[facei] < 0) if (faceOwner_[facei] < 0)
{ {
pointField newPoints; pointField newPoints;
if (faceI < faces_.size()) if (facei < faces_.size())
{ {
const face& f = faces_[faceI]; const face& f = faces_[facei];
newPoints.setSize(f.size(), vector::max); newPoints.setSize(f.size(), vector::max);
forAll(f, fp) forAll(f, fp)
{ {

View File

@ -29,6 +29,7 @@ License
#include "fvPatchFieldMapper.H" #include "fvPatchFieldMapper.H"
#include "momentOfInertia.H" #include "momentOfInertia.H"
#include "cartesianCS.H" #include "cartesianCS.H"
#include "IFstream.H"
#include "OFstream.H" #include "OFstream.H"
#include "globalIndex.H" #include "globalIndex.H"
@ -106,20 +107,19 @@ void Foam::turbulentDFSEMInletFvPatchVectorField::writeLumleyCoeffs() const
// Before interpolation/raw data // Before interpolation/raw data
if (interpolateR_) if (interpolateR_)
{ {
AverageIOField<symmTensor> Rexp fileName valsFile
( (
IOobject this->db().time().caseConstant()
( /"boundaryData"
"R", /this->patch().name()
this->db().time().caseConstant(), /"0"
"boundaryData"/patch().name()/"0", /"R"
this->db(),
IOobject::MUST_READ,
IOobject::AUTO_WRITE,
false
)
); );
IFstream is(valsFile);
Field<symmTensor> Rexp(is);
OFstream os(db().time().path()/"lumley_input.out"); OFstream os(db().time().path()/"lumley_input.out");
os << "# xi" << token::TAB << "eta" << endl; os << "# xi" << token::TAB << "eta" << endl;
@ -507,7 +507,7 @@ void Foam::turbulentDFSEMInletFvPatchVectorField::initialiseEddies()
{ {
WarningInFunction WarningInFunction
<< "Patch: " << patch().patch().name() << "Patch: " << patch().patch().name()
<< " on field " << dimensionedInternalField().name() << " on field " << internalField().name()
<< ": No eddies seeded - please check your set-up" << endl; << ": No eddies seeded - please check your set-up" << endl;
} }
} }

View File

@ -23,9 +23,9 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "AverageIOField.H"
#include "pointToPointPlanarInterpolation.H" #include "pointToPointPlanarInterpolation.H"
#include "Time.H" #include "Time.H"
#include "IFstream.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -70,25 +70,23 @@ Foam::turbulentDFSEMInletFvPatchVectorField::interpolateBoundaryData
{ {
const word& patchName = this->patch().name(); const word& patchName = this->patch().name();
// Note: reading from the '0' directory only fileName valsFile
IOobject io
( (
fieldName, this->db().time().caseConstant()
this->db().time().caseConstant(), /"boundaryData"
"boundaryData"/patchName/"0", /patchName
this->db(), /"0"
IOobject::MUST_READ, /fieldName
IOobject::AUTO_WRITE,
false
); );
Info<< "Turbulent DFSEM patch " << this->patch().name() IFstream is(valsFile);
Field<Type> vals(is);
Info<< "Turbulent DFSEM patch " << patchName
<< ": interpolating field " << fieldName << ": interpolating field " << fieldName
<< " from " << io.path() << endl; << " from " << valsFile << endl;
AverageIOField<Type> aFld(io); return patchMapper().interpolate(vals);
return patchMapper().interpolate(aFld);
} }

View File

@ -78,10 +78,10 @@ private:
// Private Member Functions // Private Member Functions
//- Disallow default bitwise copy construct //- Disallow default bitwise copy construct
fvMeshFunctionObject(const fvMeshFunctionObject&); fvMeshFunctionObject(const fvMeshFunctionObject&) = delete;
//- Disallow default bitwise assignment //- Disallow default bitwise assignment
void operator=(const fvMeshFunctionObject&); void operator=(const fvMeshFunctionObject&) = delete;
public: public:

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -58,7 +58,7 @@ void Foam::functionObjects::volRegion::writeFileHeader
( (
const writeFile& wf, const writeFile& wf,
Ostream& file Ostream& file
) ) const
{ {
wf.writeCommented(file, "Region"); wf.writeCommented(file, "Region");
file<< setw(1) << ':' << setw(1) << ' ' file<< setw(1) << ':' << setw(1) << ' '

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -85,7 +85,7 @@ namespace functionObjects
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class volRegion Declaration Class volRegion Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class volRegion class volRegion
@ -106,8 +106,8 @@ public:
//- Region type enumeration //- Region type enumeration
enum regionTypes enum regionTypes
{ {
vrtCellZone, vrtCellZone, //< cell zone
vrtAll vrtAll //< all cells
}; };
//- Region type names //- Region type names
@ -131,7 +131,7 @@ protected:
// Protected Member Functions // Protected Member Functions
//- Output file header information //- Output file header information
void writeFileHeader(const writeFile& wf, Ostream& file); void writeFileHeader(const writeFile& wf, Ostream& file) const;
public: public:
@ -143,11 +143,7 @@ public:
// Constructors // Constructors
//- Construct from fvMesh and dictionary //- Construct from fvMesh and dictionary
volRegion volRegion(const fvMesh& mesh, const dictionary& dict);
(
const fvMesh& mesh,
const dictionary& dict
);
//- Destructor //- Destructor

View File

@ -38,7 +38,7 @@ Usage
CourantNo1 CourantNo1
{ {
type CourantNo; type CourantNo;
functionObjectLibs ("libutilityFunctionObjects.so"); libs ("libfieldFunctionObjects.so");
... ...
} }
\endverbatim \endverbatim
@ -113,8 +113,8 @@ public:
CourantNo CourantNo
( (
const word& name, const word& name,
const Time&, const Time& runTime,
const dictionary& const dictionary& dict
); );

Some files were not shown because too many files have changed in this diff Show More