diff --git a/applications/solvers/basic/potentialFoam/potentialFoam.C b/applications/solvers/basic/potentialFoam/potentialFoam.C index 0dbe1b5cad..f0c04eadb4 100644 --- a/applications/solvers/basic/potentialFoam/potentialFoam.C +++ b/applications/solvers/basic/potentialFoam/potentialFoam.C @@ -28,9 +28,9 @@ Group grpBasicSolvers Description - Potential flow solver which solves for the velocity potential - from which the flux-field is obtained and velocity field by reconstructing - the flux. + Potential flow solver which solves for the velocity potential, to + calculate the flux-field, from which the velocity field is obtained by + reconstructing the flux. \heading Solver details The potential flow solution is typically employed to generate initial fields diff --git a/applications/solvers/combustion/XiFoam/XiDyMFoam/XiDyMFoam.C b/applications/solvers/combustion/XiFoam/XiDyMFoam/XiDyMFoam.C index 0f6f2976f1..07b52d60d9 100644 --- a/applications/solvers/combustion/XiFoam/XiDyMFoam/XiDyMFoam.C +++ b/applications/solvers/combustion/XiFoam/XiDyMFoam/XiDyMFoam.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -67,25 +67,26 @@ Description int main(int argc, char *argv[]) { - #include "setRootCase.H" + #include "postProcess.H" + #include "setRootCase.H" #include "createTime.H" #include "createDynamicFvMesh.H" - #include "initContinuityErrs.H" - - pimpleControl pimple(mesh); - + #include "createControl.H" #include "readCombustionProperties.H" #include "readGravitationalAcceleration.H" #include "createFields.H" - #include "createMRF.H" + #include "createFieldRefs.H" #include "createFvOptions.H" + #include "initContinuityErrs.H" #include "createRhoUf.H" #include "createControls.H" #include "initContinuityErrs.H" #include "compressibleCourantNo.H" #include "setInitialDeltaT.H" + turbulence->validate(); + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; diff --git a/applications/solvers/combustion/XiFoam/XiDyMFoam/readControls.H b/applications/solvers/combustion/XiFoam/XiDyMFoam/readControls.H index cf50980460..ed2db49fb4 100644 --- a/applications/solvers/combustion/XiFoam/XiDyMFoam/readControls.H +++ b/applications/solvers/combustion/XiFoam/XiDyMFoam/readControls.H @@ -1,7 +1,6 @@ - #include "readTimeControls.H" +#include "readTimeControls.H" - bool correctPhi = - pimple.dict().lookupOrDefault("correctPhi", true); +correctPhi = pimple.dict().lookupOrDefault("correctPhi", true); - bool checkMeshCourantNo = - pimple.dict().lookupOrDefault("checkMeshCourantNo", false); +checkMeshCourantNo = + pimple.dict().lookupOrDefault("checkMeshCourantNo", false); diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/createFields.H b/applications/solvers/heatTransfer/buoyantPimpleFoam/createFields.H index 5e1644fc97..cc0bc64f0a 100644 --- a/applications/solvers/heatTransfer/buoyantPimpleFoam/createFields.H +++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/createFields.H @@ -18,8 +18,6 @@ volScalarField rho ); volScalarField& p = thermo.p(); -const volScalarField& psi = thermo.psi(); - Info<< "Reading field U\n" << endl; volVectorField U diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H index c778ef40a8..15c87f9c85 100644 --- a/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H @@ -41,8 +41,6 @@ p_rghDDtEqn = ( fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh)) - == - fvOptions(psi, p_rgh, rho.name()) ); } @@ -53,6 +51,8 @@ p_rghDDtEqn() + fvc::div(phiHbyA) - fvm::laplacian(rhorAUf, p_rgh) + == + fvOptions(psi, p_rgh, rho.name()) ); p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter()))); diff --git a/applications/solvers/heatTransfer/thermoFoam/setAlphaEff.H b/applications/solvers/heatTransfer/thermoFoam/setAlphaEff.H index 73a157fc12..c760349a6e 100644 --- a/applications/solvers/heatTransfer/thermoFoam/setAlphaEff.H +++ b/applications/solvers/heatTransfer/thermoFoam/setAlphaEff.H @@ -11,7 +11,7 @@ IOobject turbulencePropertiesHeader false ); -if (turbulencePropertiesHeader.headerOk()) +if (turbulencePropertiesHeader.typeHeaderOk(false)) { autoPtr turbulence ( diff --git a/applications/solvers/lagrangian/simpleCoalParcelFoam/EEqn.H b/applications/solvers/lagrangian/simpleCoalParcelFoam/EEqn.H new file mode 100644 index 0000000000..8239d44621 --- /dev/null +++ b/applications/solvers/lagrangian/simpleCoalParcelFoam/EEqn.H @@ -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; +} diff --git a/applications/solvers/lagrangian/simpleCoalParcelFoam/Make/options b/applications/solvers/lagrangian/simpleCoalParcelFoam/Make/options index efdf721ee3..d88ca09eae 100644 --- a/applications/solvers/lagrangian/simpleCoalParcelFoam/Make/options +++ b/applications/solvers/lagrangian/simpleCoalParcelFoam/Make/options @@ -24,8 +24,7 @@ EXE_INC = \ -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ -I$(LIB_SRC)/combustionModels/lnInclude \ -I$(LIB_SRC)/fvOptions/lnInclude \ - -I$(LIB_SRC)/sampling/lnInclude \ - -I$(FOAM_SOLVERS)/lagrangian/reactingParcelFoam/simpleReactingParcelFoam + -I$(LIB_SRC)/sampling/lnInclude EXE_LIBS = \ diff --git a/applications/solvers/lagrangian/simpleCoalParcelFoam/UEqn.H b/applications/solvers/lagrangian/simpleCoalParcelFoam/UEqn.H new file mode 100644 index 0000000000..a29d4b8c57 --- /dev/null +++ b/applications/solvers/lagrangian/simpleCoalParcelFoam/UEqn.H @@ -0,0 +1,21 @@ + MRF.correctBoundaryVelocity(U); + + tmp 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); diff --git a/applications/solvers/lagrangian/simpleCoalParcelFoam/YEqn.H b/applications/solvers/lagrangian/simpleCoalParcelFoam/YEqn.H new file mode 100644 index 0000000000..7c7cf9a4c0 --- /dev/null +++ b/applications/solvers/lagrangian/simpleCoalParcelFoam/YEqn.H @@ -0,0 +1,48 @@ +tmp> mvConvection +( + fv::convectionScheme::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); +} diff --git a/applications/solvers/lagrangian/simpleCoalParcelFoam/createFieldRefs.H b/applications/solvers/lagrangian/simpleCoalParcelFoam/createFieldRefs.H new file mode 100644 index 0000000000..fdc479bc23 --- /dev/null +++ b/applications/solvers/lagrangian/simpleCoalParcelFoam/createFieldRefs.H @@ -0,0 +1,3 @@ +const volScalarField& psi = thermo.psi(); +const volScalarField& T = thermo.T(); +const label inertIndex(composition.species()[inertSpecie]); diff --git a/applications/solvers/lagrangian/simpleCoalParcelFoam/createFields.H b/applications/solvers/lagrangian/simpleCoalParcelFoam/createFields.H new file mode 100644 index 0000000000..16f297c995 --- /dev/null +++ b/applications/solvers/lagrangian/simpleCoalParcelFoam/createFields.H @@ -0,0 +1,122 @@ +#include "readGravitationalAcceleration.H" + +Info<< "Creating combustion model\n" << endl; + +autoPtr combustion +( + combustionModels::rhoCombustionModel::New(mesh) +); + +rhoReactionThermo& thermo = combustion->thermo(); +thermo.validate(args.executable(), "h", "e"); + +SLGThermo slgThermo(mesh, thermo); + +basicSpecieMixture& composition = thermo.composition(); +PtrList& 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 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::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" diff --git a/applications/solvers/lagrangian/simpleCoalParcelFoam/pEqn.H b/applications/solvers/lagrangian/simpleCoalParcelFoam/pEqn.H new file mode 100644 index 0000000000..055eff6f0b --- /dev/null +++ b/applications/solvers/lagrangian/simpleCoalParcelFoam/pEqn.H @@ -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; +} diff --git a/applications/solvers/lagrangian/simpleCoalParcelFoam/simpleCoalParcelFoam.C b/applications/solvers/lagrangian/simpleCoalParcelFoam/simpleCoalParcelFoam.C index d9932d06dd..12ac28ccdf 100644 --- a/applications/solvers/lagrangian/simpleCoalParcelFoam/simpleCoalParcelFoam.C +++ b/applications/solvers/lagrangian/simpleCoalParcelFoam/simpleCoalParcelFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2015-2016 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,13 +24,12 @@ License Application simpleReactingParcelFoam -Description - Steady state SIMPLE solver for laminar or turbulent flow with coal - Lagrangian parcels. +Group + grpLagrangianSolvers - Note: - - including run-time selectable finite volume options,e.g. sources, - constraints +Description + Steady state solver for compressible, turbulent flow with coal particle + clouds and optional sources/constraints. \*---------------------------------------------------------------------------*/ @@ -49,21 +48,19 @@ Description int main(int argc, char *argv[]) { - #include "setRootCase.H" + #include "postProcess.H" + #include "setRootCase.H" #include "createTime.H" #include "createMesh.H" - #include "readGravitationalAcceleration.H" - - simpleControl simple(mesh); - + #include "createControl.H" #include "createFields.H" - #include "createRadiationModel.H" - #include "createClouds.H" - #include "createMRF.H" + #include "createFieldRefs.H" #include "createFvOptions.H" #include "initContinuityErrs.H" + turbulence->validate(); + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; diff --git a/applications/solvers/multiphase/MPPICInterFoam/CompressibleTwoPhaseMixtureTurbulenceModels/CompressibleTwoPhaseMixtureTurbulenceModels.C b/applications/solvers/multiphase/MPPICInterFoam/CompressibleTwoPhaseMixtureTurbulenceModels/CompressibleTwoPhaseMixtureTurbulenceModels.C index 193501ea42..86eabba39e 100644 --- a/applications/solvers/multiphase/MPPICInterFoam/CompressibleTwoPhaseMixtureTurbulenceModels/CompressibleTwoPhaseMixtureTurbulenceModels.C +++ b/applications/solvers/multiphase/MPPICInterFoam/CompressibleTwoPhaseMixtureTurbulenceModels/CompressibleTwoPhaseMixtureTurbulenceModels.C @@ -32,6 +32,15 @@ License #include "turbulentTransportModel.H" #include "LESModel.H" +makeTurbulenceModelTypes +( + volScalarField, + geometricOneField, + incompressibleTurbulenceModel, + PhaseCompressibleTurbulenceModel, + immiscibleIncompressibleTwoPhaseMixture +); + makeBaseTurbulenceModel ( volScalarField, diff --git a/applications/solvers/multiphase/MPPICInterFoam/MPPICInterFoam.C b/applications/solvers/multiphase/MPPICInterFoam/MPPICInterFoam.C index 07a6b062bb..d2cab50bee 100644 --- a/applications/solvers/multiphase/MPPICInterFoam/MPPICInterFoam.C +++ b/applications/solvers/multiphase/MPPICInterFoam/MPPICInterFoam.C @@ -30,7 +30,7 @@ Description The momentum and other fluid properties are of the "mixture" and a single 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. @@ -53,26 +53,22 @@ Description int main(int argc, char *argv[]) { + #include "postProcess.H" + #include "setRootCase.H" #include "createTime.H" #include "createMesh.H" - - pimpleControl pimple(mesh); - - #include "createTimeControls.H" + #include "createControl.H" #include "initContinuityErrs.H" #include "createFields.H" - #include "createMRF.H" #include "createFvOptions.H" + #include "createTimeControls.H" #include "correctPhi.H" - - turbulence->validate(); - - - #include "readTimeControls.H" #include "CourantNo.H" #include "setInitialDeltaT.H" + turbulence->validate(); + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; @@ -126,7 +122,7 @@ int main(int argc, char *argv[]) zeroGradientFvPatchVectorField::typeName ); - cloudVolSUSu.internalField() = -cloudSU.source()/mesh.V(); + cloudVolSUSu.primitiveFieldRef() = -cloudSU.source()/mesh.V(); cloudVolSUSu.correctBoundaryConditions(); cloudSU.source() = vector::zero; diff --git a/applications/solvers/multiphase/MPPICInterFoam/Make/options b/applications/solvers/multiphase/MPPICInterFoam/Make/options index 8ecd0b4a1e..e298ad1f59 100644 --- a/applications/solvers/multiphase/MPPICInterFoam/Make/options +++ b/applications/solvers/multiphase/MPPICInterFoam/Make/options @@ -1,6 +1,7 @@ interFoamPath = $(FOAM_SOLVERS)/multiphase/interFoam EXE_INC = \ + -I. \ -I./IncompressibleTwoPhaseMixtureTurbulenceModels/lnInclude \ -I$(interFoamPath) \ -I$(LIB_SRC)/finiteVolume/lnInclude \ diff --git a/applications/solvers/multiphase/MPPICInterFoam/alphaEqn.H b/applications/solvers/multiphase/MPPICInterFoam/alphaEqn.H index a177326504..97d1428638 100644 --- a/applications/solvers/multiphase/MPPICInterFoam/alphaEqn.H +++ b/applications/solvers/multiphase/MPPICInterFoam/alphaEqn.H @@ -17,9 +17,10 @@ // Do not compress interface at non-coupled boundary faces // (inlets, outlets etc.) + surfaceScalarField::Boundary& phicBf = phic.boundaryFieldRef(); forAll(phic.boundaryField(), patchi) { - fvsPatchScalarField& phicp = phic.boundaryField()[patchi]; + fvsPatchScalarField& phicp = phicBf[patchi]; if (!phicp.coupled()) { diff --git a/applications/solvers/multiphase/MPPICInterFoam/createFields.H b/applications/solvers/multiphase/MPPICInterFoam/createFields.H index a7d456f532..de8ae559cc 100644 --- a/applications/solvers/multiphase/MPPICInterFoam/createFields.H +++ b/applications/solvers/multiphase/MPPICInterFoam/createFields.H @@ -217,3 +217,5 @@ mixture ) ); + + #include "createMRF.H" diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.C b/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.C index a2c2b71fcf..e8ae64ce1d 100644 --- a/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.C +++ b/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.C @@ -42,7 +42,7 @@ namespace Foam void Foam::twoPhaseMixtureEThermo::eBoundaryCorrection(volScalarField& h) { - volScalarField::GeometricBoundaryField& hbf = h.boundaryField(); + volScalarField::Boundary& hbf = h.boundaryFieldRef(); forAll(hbf, patchi) { @@ -59,6 +59,7 @@ void Foam::twoPhaseMixtureEThermo::eBoundaryCorrection(volScalarField& h) } } + void Foam::twoPhaseMixtureEThermo::init() { const volScalarField alpha1Rho1(alpha1()*rho1()); @@ -74,6 +75,7 @@ void Foam::twoPhaseMixtureEThermo::init() e_.correctBoundaryConditions(); } + // * * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * // Foam::twoPhaseMixtureEThermo::twoPhaseMixtureEThermo @@ -117,11 +119,13 @@ Foam::twoPhaseMixtureEThermo::twoPhaseMixtureEThermo init(); } + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::twoPhaseMixtureEThermo::~twoPhaseMixtureEThermo() {} + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void Foam::twoPhaseMixtureEThermo::correct() @@ -226,10 +230,8 @@ Foam::tmp Foam::twoPhaseMixtureEThermo::he } -Foam::tmp -Foam::twoPhaseMixtureEThermo::hc() const +Foam::tmp Foam::twoPhaseMixtureEThermo::hc() const { - const fvMesh& mesh = this->T_.mesh(); return tmp @@ -277,8 +279,7 @@ Foam::tmp Foam::twoPhaseMixtureEThermo::THE } -Foam::tmp -Foam::twoPhaseMixtureEThermo::Cp() const +Foam::tmp Foam::twoPhaseMixtureEThermo::Cp() const { const volScalarField limitedAlpha1 ( @@ -317,8 +318,7 @@ Foam::tmp Foam::twoPhaseMixtureEThermo::Cp } -Foam::tmp -Foam::twoPhaseMixtureEThermo::rho() const +Foam::tmp Foam::twoPhaseMixtureEThermo::rho() const { const volScalarField limitedAlpha1 ( @@ -337,8 +337,7 @@ Foam::twoPhaseMixtureEThermo::rho() const } -Foam::tmp -Foam::twoPhaseMixtureEThermo::rho +Foam::tmp Foam::twoPhaseMixtureEThermo::rho ( const label patchi ) const @@ -357,8 +356,7 @@ Foam::twoPhaseMixtureEThermo::rho } -Foam::tmp -Foam::twoPhaseMixtureEThermo::Cv() const +Foam::tmp Foam::twoPhaseMixtureEThermo::Cv() const { const volScalarField limitedAlpha1 ( @@ -376,8 +374,7 @@ Foam::twoPhaseMixtureEThermo::Cv() const } -Foam::tmp -Foam::twoPhaseMixtureEThermo::Cv +Foam::tmp Foam::twoPhaseMixtureEThermo::Cv ( const scalarField& p, const scalarField& T, @@ -398,8 +395,7 @@ Foam::twoPhaseMixtureEThermo::Cv } -Foam::tmp -Foam::twoPhaseMixtureEThermo::gamma() const +Foam::tmp Foam::twoPhaseMixtureEThermo::gamma() const { return tmp ( @@ -422,8 +418,7 @@ Foam::tmp Foam::twoPhaseMixtureEThermo::gamma } -Foam::tmp -Foam::twoPhaseMixtureEThermo::Cpv() const +Foam::tmp Foam::twoPhaseMixtureEThermo::Cpv() const { // This is an e thermo (Cpv = Cv) return Cv(); @@ -442,16 +437,14 @@ Foam::tmp Foam::twoPhaseMixtureEThermo::Cpv } -Foam::tmp -Foam::twoPhaseMixtureEThermo::CpByCpv() const +Foam::tmp Foam::twoPhaseMixtureEThermo::CpByCpv() const { NotImplemented; return tmp(); } -Foam::tmp -Foam::twoPhaseMixtureEThermo::CpByCpv +Foam::tmp Foam::twoPhaseMixtureEThermo::CpByCpv ( const scalarField& p, const scalarField& T, @@ -463,8 +456,7 @@ Foam::twoPhaseMixtureEThermo::CpByCpv } -Foam::tmp -Foam::twoPhaseMixtureEThermo::kappa() const +Foam::tmp Foam::twoPhaseMixtureEThermo::kappa() const { const volScalarField limitedAlpha1 ( @@ -482,8 +474,10 @@ Foam::twoPhaseMixtureEThermo::kappa() const } -Foam::tmp -Foam::twoPhaseMixtureEThermo::kappa(const label patchi) const +Foam::tmp Foam::twoPhaseMixtureEThermo::kappa +( + const label patchi +) const { const volScalarField limitedAlpha1 ( @@ -496,8 +490,7 @@ Foam::twoPhaseMixtureEThermo::kappa(const label patchi) const } -Foam::tmp -Foam::twoPhaseMixtureEThermo::kappaEff +Foam::tmp Foam::twoPhaseMixtureEThermo::kappaEff ( const volScalarField& kappat ) const @@ -508,8 +501,7 @@ Foam::twoPhaseMixtureEThermo::kappaEff } -Foam::tmp -Foam::twoPhaseMixtureEThermo::kappaEff +Foam::tmp Foam::twoPhaseMixtureEThermo::kappaEff ( const scalarField& kappat, const label patchi @@ -528,8 +520,7 @@ Foam::twoPhaseMixtureEThermo::kappaEff } -Foam::tmp -Foam::twoPhaseMixtureEThermo::alphaEff +Foam::tmp Foam::twoPhaseMixtureEThermo::alphaEff ( const volScalarField& alphat ) const @@ -539,12 +530,11 @@ Foam::twoPhaseMixtureEThermo::alphaEff alpha1_*rho1() + (1.0 - alpha1_)*rho2() ); - return (kappa()/Cp()/rho + alphat); } -Foam::tmp -Foam::twoPhaseMixtureEThermo::alphaEff + +Foam::tmp Foam::twoPhaseMixtureEThermo::alphaEff ( const scalarField& alphat, const label patchi @@ -575,6 +565,7 @@ Foam::twoPhaseMixtureEThermo::alphaEff return kappa/Cp/rho + alphat; } + bool Foam::twoPhaseMixtureEThermo::read() { if (basicThermo::read() && thermoIncompressibleTwoPhaseMixture::read()) @@ -589,4 +580,5 @@ bool Foam::twoPhaseMixtureEThermo::read() } } + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/Make/options b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/Make/options index 0194820c91..1d4880f1ba 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/Make/options +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseCompressibleTurbulenceModels/Make/options @@ -12,7 +12,7 @@ EXE_INC = \ -I$(LIB_SRC)/meshTools/lnInclude LIB_LIBS = \ - -lcompressibleTurbulenceModels + -lcompressibleTurbulenceModels \ -lreactingPhaseSystem \ -lreactingMultiphaseSystem \ -lreactingEulerianInterfacialModels \ diff --git a/applications/utilities/mesh/advanced/snappyRefineMesh/Make/files b/applications/utilities/mesh/advanced/snappyRefineMesh/Make/files index 666a1c6b10..2d0b43d342 100644 --- a/applications/utilities/mesh/advanced/snappyRefineMesh/Make/files +++ b/applications/utilities/mesh/advanced/snappyRefineMesh/Make/files @@ -1,4 +1,4 @@ -autoRefineMesh.C +snappyRefineMesh.C -EXE = $(FOAM_APPBIN)/autoRefineMesh +EXE = $(FOAM_APPBIN)/snappyRefineMesh diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C index ade260fd9c..235f81db47 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C @@ -1316,14 +1316,14 @@ int main(int argc, char *argv[]) Info<< surfaces.names()[surfi] << ':' << nl << nl; - const word& fzName = surfaces.surfZones()[surfI].faceZoneName(); + const word& fzName = surfaces.surfZones()[surfi].faceZoneName(); if (fzName.empty()) { // 'Normal' surface forAll(regNames, i) { - label globalRegioni = surfaces.globalRegion(surfI, i); + label globalRegioni = surfaces.globalRegion(surfi, i); label patchi; diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C b/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C index 39da68933e..11d6cfd523 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C +++ b/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C @@ -392,7 +392,7 @@ Foam::label Foam::checkTopology // Already marked regionDisconnected[regioni] = false; } - else if (pRegion != regionI) + else if (pRegion != regioni) { // Multiple regions regionDisconnected[regioni] = false; diff --git a/applications/utilities/mesh/manipulation/subsetMesh/subsetMesh.C b/applications/utilities/mesh/manipulation/subsetMesh/subsetMesh.C index 988415c4e4..7af8edb75a 100644 --- a/applications/utilities/mesh/manipulation/subsetMesh/subsetMesh.C +++ b/applications/utilities/mesh/manipulation/subsetMesh/subsetMesh.C @@ -326,7 +326,7 @@ int main(int argc, char *argv[]) // Create mesh subsetting engine fvMeshSubset subsetter(mesh); - label patchi = -1; + labelList exposedPatchIDs; if (args.optionFound("patch")) { diff --git a/applications/utilities/miscellaneous/foamDebugSwitches/Allwmake b/applications/utilities/miscellaneous/foamDebugSwitches/Allwmake deleted file mode 100755 index edc1f5f0dd..0000000000 --- a/applications/utilities/miscellaneous/foamDebugSwitches/Allwmake +++ /dev/null @@ -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 - -#------------------------------------------------------------------------------ diff --git a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C index 3196fadbd6..cab70e7076 100644 --- a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C +++ b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C @@ -1151,10 +1151,6 @@ int main(int argc, char *argv[]) // For the first region of a multi-region case additionally // decompose the "uniform" directory in the time directory 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); } diff --git a/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C b/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C index df8bd3eeb3..047c68b21a 100644 --- a/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C +++ b/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C @@ -615,7 +615,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets) label zonei = faceToZone[curF]; - if (zoneI >= 0) + if (zonei >= 0) { // Single zone. Add the face zoneFaces[zonei].append(facei); diff --git a/applications/utilities/parallelProcessing/redistributePar/parFvFieldReconstructorReconstructFields.C b/applications/utilities/parallelProcessing/redistributePar/parFvFieldReconstructorReconstructFields.C index 5b9dc19431..3df020099f 100644 --- a/applications/utilities/parallelProcessing/redistributePar/parFvFieldReconstructorReconstructFields.C +++ b/applications/utilities/parallelProcessing/redistributePar/parFvFieldReconstructorReconstructFields.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -125,12 +125,8 @@ Foam::parFvFieldReconstructor::reconstructFvVolumeField PtrList> patchFields(fld.mesh().boundary().size()); - const typename GeometricField - < - Type, - fvPatchField, - volMesh - >::GeometricBoundaryField& bfld = fld.boundaryField(); + const typename GeometricField::Boundary& + bfld = fld.boundaryField(); forAll(bfld, patchI) { @@ -292,12 +288,8 @@ Foam::parFvFieldReconstructor::reconstructFvSurfaceField PtrList> patchFields(fld.mesh().boundary().size()); - const typename GeometricField - < - Type, - fvsPatchField, - surfaceMesh - >::GeometricBoundaryField& bfld = fld.boundaryField(); + const typename GeometricField::Boundary& + bfld = fld.boundaryField(); forAll(bfld, patchI) { diff --git a/applications/utilities/parallelProcessing/redistributePar/redistributePar.C b/applications/utilities/parallelProcessing/redistributePar/redistributePar.C index dfe0340347..65ebbc1c6f 100644 --- a/applications/utilities/parallelProcessing/redistributePar/redistributePar.C +++ b/applications/utilities/parallelProcessing/redistributePar/redistributePar.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -716,8 +716,7 @@ void correctCoupledBoundaryConditions(fvMesh& mesh) { GeoField& fld = *iter(); - typename GeoField::GeometricBoundaryField& bfld = - fld.boundaryField(); + typename GeoField::Boundary& bfld = fld.boundaryFieldRef(); if ( Pstream::defaultCommsType == Pstream::blocking @@ -728,7 +727,7 @@ void correctCoupledBoundaryConditions(fvMesh& mesh) forAll(bfld, patchi) { - typename GeoField::PatchFieldType& pfld = bfld[patchi]; + typename GeoField::Patch& pfld = bfld[patchi]; //if (pfld.coupled()) //if (isA(pfld)) @@ -750,7 +749,7 @@ void correctCoupledBoundaryConditions(fvMesh& mesh) forAll(bfld, patchi) { - typename GeoField::PatchFieldType& pfld = bfld[patchi]; + typename GeoField::Patch& pfld = bfld[patchi]; //if (pfld.coupled()) //if (isA(pfld)) @@ -768,7 +767,7 @@ void correctCoupledBoundaryConditions(fvMesh& mesh) forAll(patchSchedule, patchEvali) { label patchi = patchSchedule[patchEvali].patch; - typename GeoField::PatchFieldType& pfld = bfld[patchi]; + typename GeoField::Patch& pfld = bfld[patchi]; //if (pfld.coupled()) //if (isA(pfld)) diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C index b6b058b2b9..6e7a2d24fe 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C @@ -70,12 +70,7 @@ tmp> volField ( const fvMeshSubset& meshSubsetter, - const typename GeometricField - < - Type, - fvPatchField, - volMesh - >::DimensionedInternalField& df + const typename GeometricField::Internal& df ) { // Construct volField (with zeroGradient) from dimensioned field @@ -93,7 +88,7 @@ volField zeroGradientFvPatchField::typeName ) ); - tvf.ref().internalField() = df; + tvf.ref().primitiveFieldRef() = df; tvf.ref().correctBoundaryConditions(); const GeometricField& vf = tvf(); diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.H index 813fea468e..93452d04d3 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -60,7 +60,7 @@ volField Type, Foam::fvPatchField, Foam::volMesh - >::DimensionedInternalField& df + >::Internal& df ); diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C index 842bc95c79..d027e7afbb 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C @@ -186,11 +186,11 @@ int main(int argc, char *argv[]) volSymmTensorField::typeName, volTensorField::typeName, - volScalarField::DimensionedInternalField::typeName, - volVectorField::DimensionedInternalField::typeName, - volSphericalTensorField::DimensionedInternalField::typeName, - volSymmTensorField::DimensionedInternalField::typeName, - volTensorField::DimensionedInternalField::typeName + volScalarField::Internal::typeName, + volVectorField::Internal::typeName, + volSphericalTensorField::Internal::typeName, + volSymmTensorField::Internal::typeName, + volTensorField::Internal::typeName }; // Path to EnSight directory at case level only @@ -562,15 +562,10 @@ int main(int argc, char *argv[]) // DimensionedFields else if ( - volFieldTypes[i] - == volScalarField::DimensionedInternalField::typeName + volFieldTypes[i] == volScalarField::Internal::typeName ) { - volScalarField::DimensionedInternalField df - ( - fieldObject, - mesh - ); + volScalarField::Internal df(fieldObject, mesh); ensightField ( volField(meshSubsetter, df), @@ -585,15 +580,10 @@ int main(int argc, char *argv[]) } else if ( - volFieldTypes[i] - == volVectorField::DimensionedInternalField::typeName + volFieldTypes[i] == volVectorField::Internal::typeName ) { - volVectorField::DimensionedInternalField df - ( - fieldObject, - mesh - ); + volVectorField::Internal df(fieldObject, mesh); ensightField ( volField(meshSubsetter, df), @@ -609,14 +599,10 @@ int main(int argc, char *argv[]) else if ( volFieldTypes[i] - == volSphericalTensorField::DimensionedInternalField::typeName + == volSphericalTensorField::Internal::typeName ) { - volSphericalTensorField::DimensionedInternalField df - ( - fieldObject, - mesh - ); + volSphericalTensorField::Internal df(fieldObject, mesh); ensightField ( volField(meshSubsetter, df), @@ -631,15 +617,10 @@ int main(int argc, char *argv[]) } else if ( - volFieldTypes[i] - == volSymmTensorField::DimensionedInternalField::typeName + volFieldTypes[i] == volSymmTensorField::Internal::typeName ) { - volSymmTensorField::DimensionedInternalField df - ( - fieldObject, - mesh - ); + volSymmTensorField::Internal df(fieldObject, mesh); ensightField ( volField(meshSubsetter, df), @@ -654,15 +635,10 @@ int main(int argc, char *argv[]) } else if ( - volFieldTypes[i] - == volTensorField::DimensionedInternalField::typeName + volFieldTypes[i] == volTensorField::Internal::typeName ) { - volTensorField::DimensionedInternalField df - ( - fieldObject, - mesh - ); + volTensorField::Internal df(fieldObject, mesh); ensightField ( volField(meshSubsetter, df), diff --git a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK.C b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK.C index f5f6e019d6..c699c0ef03 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK.C +++ b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -618,11 +618,11 @@ int main(int argc, char *argv[]) // Construct dimensioned fields - PtrList dsf; - PtrList dvf; - PtrList dSpheretf; - PtrList dSymmtf; - PtrList dtf; + PtrList dsf; + PtrList dvf; + PtrList dSpheretf; + PtrList dSymmtf; + PtrList dtf; if (!specifiedFields || selectedFields.size()) { diff --git a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/internalWriter.H b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/internalWriter.H index e478544bfb..b61cfd6377 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/internalWriter.H +++ b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/internalWriter.H @@ -98,7 +98,7 @@ public: template void write ( - const PtrList>& flds + const PtrList>& flds ); //- Interpolate and write volFields @@ -114,7 +114,7 @@ public: void write ( const volPointInterpolation&, - const PtrList>& + const PtrList>& ); }; diff --git a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/internalWriterTemplates.C b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/internalWriterTemplates.C index 0412336323..f5e3b1aa39 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/internalWriterTemplates.C +++ b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/internalWriterTemplates.C @@ -44,7 +44,7 @@ void Foam::internalWriter::write template void Foam::internalWriter::write ( - const PtrList>& flds + const PtrList>& flds ) { forAll(flds, i) @@ -79,7 +79,7 @@ template void Foam::internalWriter::write ( const volPointInterpolation& pInterp, - const PtrList>& flds + const PtrList>& flds ) { forAll(flds, i) diff --git a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/writeFunsTemplates.C b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/writeFunsTemplates.C index c38a77c74e..a6778a461c 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/writeFunsTemplates.C +++ b/applications/utilities/postProcessing/dataConversion/foamToVTK/foamToVTK/writeFunsTemplates.C @@ -64,7 +64,7 @@ void Foam::writeFuns::write ( std::ostream& os, const bool binary, - const DimensionedField& vvf, + const DimensionedField& df, const vtkMesh& vMesh ) { @@ -74,19 +74,19 @@ void Foam::writeFuns::write label nValues = mesh.nCells() + superCells.size(); - os << vvf.name() << ' ' + os << df.name() << ' ' << int(pTraits::nComponents) << ' ' << nValues << " float" << std::endl; DynamicList fField(pTraits::nComponents*nValues); - insert(vvf.primitiveField(), fField); + insert(df.field(), fField); forAll(superCells, superCelli) { label origCelli = superCells[superCelli]; - insert(vvf[origCelli], fField); + insert(df[origCelli], fField); } write(os, binary, fField); } diff --git a/applications/utilities/postProcessing/lagrangian/steadyParticleTracks/steadyParticleTracksTemplates.C b/applications/utilities/postProcessing/lagrangian/steadyParticleTracks/steadyParticleTracksTemplates.C index 7e8c022250..f54b9b04a4 100644 --- a/applications/utilities/postProcessing/lagrangian/steadyParticleTracks/steadyParticleTracksTemplates.C +++ b/applications/utilities/postProcessing/lagrangian/steadyParticleTracks/steadyParticleTracksTemplates.C @@ -116,11 +116,11 @@ void Foam::writeVTKFields Info<< " writing field " << fieldNames[fieldi] << endl; os << nl << fieldNames[fieldi] << ' ' << int(pTraits::nComponents) << ' ' - << values[fieldI].size() << " float" << nl; + << values[fieldi].size() << " float" << nl; label offset = 0; - forAll(addr, trackI) + forAll(addr, tracki) { - const List