diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModel.C b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModel.C index 49f36d3309..2b2cd7c4fd 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModel.C +++ b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -79,7 +79,7 @@ Foam::PDRDragModel::~PDRDragModel() bool Foam::PDRDragModel::read(const dictionary& PDRProperties) { - PDRDragModelCoeffs_ = PDRProperties.subDict(type() + "Coeffs"); + PDRDragModelCoeffs_ = PDRProperties.optionalSubDict(type() + "Coeffs"); PDRDragModelCoeffs_.lookup("drag") >> on_; diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModel.C b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModel.C index a6301ba973..7e3b2536b1 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModel.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -67,7 +67,7 @@ Foam::XiEqModel::~XiEqModel() bool Foam::XiEqModel::read(const dictionary& XiEqProperties) { - XiEqModelCoeffs_ = XiEqProperties.subDict(type() + "Coeffs"); + XiEqModelCoeffs_ = XiEqProperties.optionalSubDict(type() + "Coeffs"); return true; } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModel.C b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModel.C index 12bd713060..217242b24b 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModel.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -67,7 +67,7 @@ Foam::XiGModel::~XiGModel() bool Foam::XiGModel::read(const dictionary& XiGProperties) { - XiGModelCoeffs_ = XiGProperties.subDict(type() + "Coeffs"); + XiGModelCoeffs_ = XiGProperties.optionalSubDict(type() + "Coeffs"); return true; } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModel.C b/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModel.C index 0bb0cd1e0b..9580728905 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModel.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -85,7 +85,7 @@ Foam::XiModel::~XiModel() bool Foam::XiModel::read(const dictionary& XiProperties) { - XiModelCoeffs_ = XiProperties.subDict(type() + "Coeffs"); + XiModelCoeffs_ = XiProperties.optionalSubDict(type() + "Coeffs"); return true; } diff --git a/applications/solvers/combustion/PDRFoam/laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.C b/applications/solvers/combustion/PDRFoam/laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.C index 947c62132e..afdebbd2c6 100644 --- a/applications/solvers/combustion/PDRFoam/laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.C +++ b/applications/solvers/combustion/PDRFoam/laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -80,7 +80,7 @@ Foam::laminarFlameSpeedModels::SCOPE::SCOPE dict.lookup("fuelFile") ) )() - ).subDict(typeName + "Coeffs") + ).optionalSubDict(typeName + "Coeffs") ), LFL_(readScalar(coeffsDict_.lookup("lowerFlamabilityLimit"))), UFL_(readScalar(coeffsDict_.lookup("upperFlamabilityLimit"))), diff --git a/applications/solvers/combustion/fireFoam/YEEqn.H b/applications/solvers/combustion/fireFoam/YEEqn.H index d400bf36bb..5176956acc 100644 --- a/applications/solvers/combustion/fireFoam/YEEqn.H +++ b/applications/solvers/combustion/fireFoam/YEEqn.H @@ -68,7 +68,7 @@ tmp> mvConvection - fvm::laplacian(turbulence->alphaEff(), he) == Qdot - + radiation->Sh(thermo) + + radiation->Sh(thermo, he) + parcels.Sh(he) + surfaceFilm.Sh() + fvOptions(rho, he) diff --git a/applications/solvers/compressible/rhoPimpleFoam/pEqn.H b/applications/solvers/compressible/rhoPimpleFoam/pEqn.H index 73ecafd89f..5aab536239 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/pEqn.H @@ -10,10 +10,8 @@ if (pimple.nCorrPISO() <= 1) surfaceScalarField phiHbyA ( "phiHbyA", - ( - fvc::flux(rho*HbyA) - + rhorAUf*fvc::ddtCorr(rho, U, phi) - ) + fvc::flux(rho*HbyA) + + rhorAUf*fvc::ddtCorr(rho, U, phi) ); MRF.makeRelative(fvc::interpolate(rho), phiHbyA); diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/EEqn.H b/applications/solvers/heatTransfer/buoyantPimpleFoam/EEqn.H index ddd21254a9..f0a7e3ad36 100644 --- a/applications/solvers/heatTransfer/buoyantPimpleFoam/EEqn.H +++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/EEqn.H @@ -18,7 +18,7 @@ - fvm::laplacian(turbulence->alphaEff(), he) == rho*(U&g) - + radiation->Sh(thermo) + + radiation->Sh(thermo, he) + fvOptions(rho, he) ); diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/EEqn.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/EEqn.H index b9782d3f73..e932d2fdef 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/EEqn.H +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/EEqn.H @@ -12,7 +12,7 @@ - fvm::laplacian(turbulence->alphaEff(), he) == rho*(U&g) - + radiation->Sh(thermo) + + radiation->Sh(thermo, he) + fvOptions(rho, he) ); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/EEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/EEqn.H index b618478860..daf3af8f2d 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/EEqn.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/EEqn.H @@ -12,7 +12,7 @@ - fvm::laplacian(turb.alphaEff(), he) == rho*(U&g) - + rad.Sh(thermo) + + rad.Sh(thermo, he) + fvOptions(rho, he) ); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/EEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/EEqn.H index eafea3fd4c..d8f4516f5e 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/EEqn.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/EEqn.H @@ -18,7 +18,7 @@ - fvm::laplacian(turb.alphaEff(), he) == rho*(U&g) - + rad.Sh(thermo) + + rad.Sh(thermo, he) + fvOptions(rho, he) ); diff --git a/applications/solvers/heatTransfer/thermoFoam/EEqn.H b/applications/solvers/heatTransfer/thermoFoam/EEqn.H index 51232bf0be..98a248ac35 100644 --- a/applications/solvers/heatTransfer/thermoFoam/EEqn.H +++ b/applications/solvers/heatTransfer/thermoFoam/EEqn.H @@ -17,7 +17,7 @@ ) - fvm::laplacian(alphaEff, he) == - radiation->Sh(thermo) + radiation->Sh(thermo, he) + fvOptions(rho, he) ); diff --git a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pimpleDyMFoam.C b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pimpleDyMFoam.C index 241ae11c3d..3c0f7b99e2 100644 --- a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pimpleDyMFoam.C +++ b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pimpleDyMFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -70,7 +70,6 @@ int main(int argc, char *argv[]) { #include "readControls.H" #include "CourantNo.H" - #include "setDeltaT.H" runTime++; diff --git a/applications/solvers/lagrangian/DPMFoam/Allwclean b/applications/solvers/lagrangian/DPMFoam/Allwclean index f953f59874..b78c67f661 100755 --- a/applications/solvers/lagrangian/DPMFoam/Allwclean +++ b/applications/solvers/lagrangian/DPMFoam/Allwclean @@ -2,7 +2,10 @@ cd ${0%/*} || exit 1 # Run from this directory wclean libso DPMTurbulenceModels + wclean wclean MPPICFoam +wclean DPMDyMFoam +wclean DPMDyMFoam/MPPICDyMFoam #------------------------------------------------------------------------------ diff --git a/applications/solvers/lagrangian/DPMFoam/Allwmake b/applications/solvers/lagrangian/DPMFoam/Allwmake index 2af858f6bb..e3c5370297 100755 --- a/applications/solvers/lagrangian/DPMFoam/Allwmake +++ b/applications/solvers/lagrangian/DPMFoam/Allwmake @@ -1,5 +1,5 @@ #!/bin/sh -cd ${0%/*} || exit 1 +cd ${0%/*} || exit 1 # Run from this directory # Parse arguments for library compilation . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments @@ -8,5 +8,7 @@ wmake $targetType DPMTurbulenceModels wmake $targetType wmake $targetType MPPICFoam +wmake $targetType DPMDyMFoam +wmake $targetType DPMDyMFoam/MPPICDyMFoam #------------------------------------------------------------------------------ diff --git a/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/DPMDyMFoam.C b/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/DPMDyMFoam.C new file mode 100644 index 0000000000..aec4c64304 --- /dev/null +++ b/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/DPMDyMFoam.C @@ -0,0 +1,163 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2017 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 . + +Application + DPMDyMFoam + +Description + Transient solver for the coupled transport of a single kinematic particle + cloud including the effect of the volume fraction of particles on the + continuous phase, with optional mesh motion and mesh topology changes. + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "dynamicFvMesh.H" +#include "singlePhaseTransportModel.H" +#include "PhaseIncompressibleTurbulenceModel.H" +#include "pimpleControl.H" +#include "CorrectPhi.H" + +#ifdef MPPIC + #include "basicKinematicMPPICCloud.H" + #define basicKinematicTypeCloud basicKinematicMPPICCloud +#else + #include "basicKinematicCollidingCloud.H" + #define basicKinematicTypeCloud basicKinematicCollidingCloud +#endif + +int main(int argc, char *argv[]) +{ + argList::addOption + ( + "cloudName", + "name", + "specify alternative cloud name. default is 'kinematicCloud'" + ); + + #include "postProcess.H" + + #include "setRootCase.H" + #include "createTime.H" + #include "createDynamicFvMesh.H" + #include "createControls.H" + #include "createFields.H" + #include "createUcf.H" + #include "initContinuityErrs.H" + + Info<< "\nStarting time loop\n" << endl; + + while (runTime.run()) + { + #include "readControls.H" + #include "CourantNo.H" + #include "setDeltaT.H" + + runTime++; + + Info<< "Time = " << runTime.timeName() << nl << endl; + + mesh.update(); + + // Calculate absolute flux from the mapped surface velocity + phic = mesh.Sf() & Ucf; + + if (mesh.changing() && correctPhi) + { + #include "correctPhic.H" + } + + // Make the flux relative to the mesh motion + fvc::makeRelative(phic, Uc); + + if (mesh.changing() && checkMeshCourantNo) + { + #include "meshCourantNo.H" + } + + continuousPhaseTransport.correct(); + muc = rhoc*continuousPhaseTransport.nu(); + + Info<< "Evolving " << kinematicCloud.name() << endl; + kinematicCloud.evolve(); + + // Update continuous phase volume fraction field + alphac = max(1.0 - kinematicCloud.theta(), alphacMin); + alphac.correctBoundaryConditions(); + alphacf = fvc::interpolate(alphac); + alphaPhic = alphacf*phic; + + fvVectorMatrix cloudSU(kinematicCloud.SU(Uc)); + volVectorField cloudVolSUSu + ( + IOobject + ( + "cloudVolSUSu", + runTime.timeName(), + mesh + ), + mesh, + dimensionedVector + ( + "0", + cloudSU.dimensions()/dimVolume, + Zero + ), + zeroGradientFvPatchVectorField::typeName + ); + + cloudVolSUSu.primitiveFieldRef() = -cloudSU.source()/mesh.V(); + cloudVolSUSu.correctBoundaryConditions(); + cloudSU.source() = Zero; + + // --- Pressure-velocity PIMPLE corrector loop + while (pimple.loop()) + { + #include "UcEqn.H" + + // --- PISO loop + while (pimple.correct()) + { + #include "pEqn.H" + } + + if (pimple.turbCorr()) + { + continuousPhaseTurbulence->correct(); + } + } + + runTime.write(); + + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + } + + Info<< "End\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/MPPICDyMFoam/MPPICDyMFoam.C b/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/MPPICDyMFoam/MPPICDyMFoam.C new file mode 100644 index 0000000000..ba5dc1bc85 --- /dev/null +++ b/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/MPPICDyMFoam/MPPICDyMFoam.C @@ -0,0 +1,41 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2017 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 . + +Application + MPPICDyMFoam + +Description + Transient solver for the coupled transport of a single kinematic particle + cloud including the effect of the volume fraction of particles on the + continuous phase. Multi-Phase Particle In Cell (MPPIC) modeling is used to + represent collisions without resolving particle-particle interactions, + with optional mesh motion and mesh topology changes. + +\*---------------------------------------------------------------------------*/ + +#define MPPIC + +#include "DPMDyMFoam.C" + + +// ************************************************************************* // diff --git a/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/MPPICDyMFoam/Make/files b/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/MPPICDyMFoam/Make/files new file mode 100644 index 0000000000..d25393d1ff --- /dev/null +++ b/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/MPPICDyMFoam/Make/files @@ -0,0 +1,3 @@ +MPPICDyMFoam.C + +EXE = $(FOAM_APPBIN)/MPPICDyMFoam diff --git a/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/MPPICDyMFoam/Make/options b/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/MPPICDyMFoam/Make/options new file mode 100644 index 0000000000..8b16d20d06 --- /dev/null +++ b/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/MPPICDyMFoam/Make/options @@ -0,0 +1,42 @@ +EXE_INC = \ + -I.. \ + -I../.. \ + -I../DPMTurbulenceModels/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/lagrangian/basic/lnInclude \ + -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I$(LIB_SRC)/transportModels/compressible/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ + -I$(LIB_SRC)/transportModels \ + -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ + -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/phaseIncompressible/lnInclude \ + -I$(LIB_SRC)/regionModels/regionModel/lnInclude \ + -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ + -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ + -I$(LIB_SRC)/dynamicMesh/lnInclude + +EXE_LIBS = \ + -lfiniteVolume \ + -lfvOptions \ + -lmeshTools \ + -llagrangian \ + -llagrangianIntermediate \ + -llagrangianTurbulence \ + -lspecie \ + -lradiationModels \ + -lincompressibleTransportModels \ + -lturbulenceModels \ + -lincompressibleTurbulenceModels \ + -lDPMTurbulenceModels \ + -lregionModels \ + -lsurfaceFilmModels \ + -lsampling \ + -ldynamicFvMesh \ + -ltopoChangerFvMesh \ + -ldynamicMesh diff --git a/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/Make/files b/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/Make/files new file mode 100644 index 0000000000..c3354998ef --- /dev/null +++ b/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/Make/files @@ -0,0 +1,3 @@ +DPMDyMFoam.C + +EXE = $(FOAM_APPBIN)/DPMDyMFoam diff --git a/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/Make/options b/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/Make/options new file mode 100644 index 0000000000..a4c0fcc139 --- /dev/null +++ b/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/Make/options @@ -0,0 +1,41 @@ +EXE_INC = \ + -I.. \ + -I../DPMTurbulenceModels/lnInclude \ + -I$(LIB_SRC)/lagrangian/basic/lnInclude \ + -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I$(LIB_SRC)/transportModels/compressible/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ + -I$(LIB_SRC)/transportModels \ + -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ + -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/phaseIncompressible/lnInclude \ + -I$(LIB_SRC)/regionModels/regionModel/lnInclude \ + -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ + -I$(LIB_SRC)/dynamicMesh/lnInclude + +EXE_LIBS = \ + -llagrangian \ + -llagrangianIntermediate \ + -llagrangianTurbulence \ + -lspecie \ + -lradiationModels \ + -lincompressibleTransportModels \ + -lturbulenceModels \ + -lincompressibleTurbulenceModels \ + -lDPMTurbulenceModels \ + -lregionModels \ + -lsurfaceFilmModels \ + -lsampling \ + -lfiniteVolume \ + -lfvOptions \ + -lmeshTools \ + -ldynamicFvMesh \ + -ltopoChangerFvMesh \ + -ldynamicMesh diff --git a/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/correctPhic.H b/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/correctPhic.H new file mode 100644 index 0000000000..46ef721fa2 --- /dev/null +++ b/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/correctPhic.H @@ -0,0 +1,11 @@ +CorrectPhi +( + Uc, + phic, + p, + dimensionedScalar("rAUf", dimTime, 1), + geometricZeroField(), + pimple +); + +#include "continuityErrs.H" diff --git a/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/createControls.H b/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/createControls.H new file mode 100644 index 0000000000..bee8bd4f39 --- /dev/null +++ b/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/createControls.H @@ -0,0 +1,12 @@ +#include "createControl.H" +#include "createTimeControls.H" + +bool correctPhi +( + pimple.dict().lookupOrDefault("correctPhi", false) +); + +bool checkMeshCourantNo +( + pimple.dict().lookupOrDefault("checkMeshCourantNo", false) +); diff --git a/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/createUcf.H b/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/createUcf.H new file mode 100644 index 0000000000..bdd9898b69 --- /dev/null +++ b/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/createUcf.H @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2017 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 . + +Global + createUcf + +Description + Creates and initialises the velocity velocity field Ucf. + +\*---------------------------------------------------------------------------*/ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +Info<< "Reading/calculating continuous phase face velocity Ucf\n" << endl; + +surfaceVectorField Ucf +( + IOobject + ( + "Ucf", + runTime.timeName(), + mesh, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + fvc::interpolate(Uc) +); + +// ************************************************************************* // diff --git a/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/pEqn.H b/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/pEqn.H new file mode 100644 index 0000000000..2f7b843d25 --- /dev/null +++ b/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/pEqn.H @@ -0,0 +1,62 @@ +{ + volVectorField HbyA("HbyA", Uc); + HbyA = rAUc*UcEqn.H(); + + surfaceScalarField phiHbyA + ( + "phiHbyA", + ( + fvc::flux(HbyA) + + alphacf*rAUcf*fvc::ddtCorr(Uc, Ucf) + + phicForces + ) + ); + + if (p.needReference()) + { + fvc::makeRelative(phiHbyA, Uc); + adjustPhi(phiHbyA, Uc, p); + fvc::makeAbsolute(phiHbyA, Uc); + } + + // Update the pressure BCs to ensure flux consistency + constrainPressure(p, Uc, phiHbyA, rAUcf); + + // Non-orthogonal pressure corrector loop + while (pimple.correctNonOrthogonal()) + { + fvScalarMatrix pEqn + ( + fvm::laplacian(alphacf*rAUcf, p) + == + fvc::ddt(alphac) + fvc::div(alphacf*phiHbyA) + ); + + pEqn.setReference(pRefCell, pRefValue); + + pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); + + if (pimple.finalNonOrthogonalIter()) + { + phic = phiHbyA - pEqn.flux()/alphacf; + + p.relax(); + + Uc = HbyA + + rAUc + *fvc::reconstruct((phicForces - pEqn.flux()/alphacf)/rAUcf); + Uc.correctBoundaryConditions(); + + { + Ucf = fvc::interpolate(Uc); + surfaceVectorField n(mesh.Sf()/mesh.magSf()); + Ucf += n*(phic/mesh.magSf() - (n & Ucf)); + } + + // Make the fluxes relative to the mesh motion + fvc::makeRelative(phic, Uc); + } + } +} + +#include "continuityErrs.H" diff --git a/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/readControls.H b/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/readControls.H new file mode 100644 index 0000000000..9f982e260b --- /dev/null +++ b/applications/solvers/lagrangian/DPMFoam/DPMDyMFoam/readControls.H @@ -0,0 +1,5 @@ +#include "readTimeControls.H" + +correctPhi = pimple.dict().lookupOrDefault("correctPhi", false); + +checkMeshCourantNo = pimple.dict().lookupOrDefault("checkMeshCourantNo", false); diff --git a/applications/solvers/lagrangian/coalChemistryFoam/EEqn.H b/applications/solvers/lagrangian/coalChemistryFoam/EEqn.H index 1a1f014da0..6f1ad9041b 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/EEqn.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/EEqn.H @@ -21,7 +21,7 @@ + Qdot + coalParcels.Sh(he) + limestoneParcels.Sh(he) - + radiation->Sh(thermo) + + radiation->Sh(thermo, he) + fvOptions(rho, he) ); diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/EEqn.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/EEqn.H index 325009f067..4d112da030 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/EEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/EEqn.H @@ -20,7 +20,7 @@ rho*(U&g) + parcels.Sh(he) + surfaceFilm.Sh() - + radiation->Sh(thermo) + + radiation->Sh(thermo, he) + Qdot + fvOptions(rho, he) ); diff --git a/applications/solvers/lagrangian/reactingParcelFoam/EEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/EEqn.H index 2ba1ef693f..42185b8afb 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/EEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/EEqn.H @@ -19,7 +19,7 @@ == rho*(U&g) + parcels.Sh(he) - + radiation->Sh(thermo) + + radiation->Sh(thermo, he) + Qdot + fvOptions(rho, he) ); @@ -35,6 +35,6 @@ thermo.correct(); radiation->correct(); - Info<< "T gas min/max = " << min(T).value() << ", " + Info<< "T gas min/max " << min(T).value() << ", " << max(T).value() << endl; } diff --git a/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/EEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/EEqn.H index 9bc1254428..c8baf6beab 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/EEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/simpleReactingParcelFoam/EEqn.H @@ -13,7 +13,7 @@ == rho*(U&g) + parcels.Sh(he) - + radiation->Sh(thermo) + + radiation->Sh(thermo, he) + Qdot + fvOptions(rho, he) ); diff --git a/applications/solvers/multiphase/compressibleInterFoam/Allwclean b/applications/solvers/multiphase/compressibleInterFoam/Allwclean index deb5e2378b..71bff64a72 100755 --- a/applications/solvers/multiphase/compressibleInterFoam/Allwclean +++ b/applications/solvers/multiphase/compressibleInterFoam/Allwclean @@ -2,6 +2,7 @@ cd ${0%/*} || exit 1 # Run from this directory wclean libso twoPhaseMixtureThermo +wclean libso surfaceTensionModels wclean wclean compressibleInterDyMFoam diff --git a/applications/solvers/multiphase/compressibleInterFoam/Allwmake b/applications/solvers/multiphase/compressibleInterFoam/Allwmake index 20da00c472..29bafc3a61 100755 --- a/applications/solvers/multiphase/compressibleInterFoam/Allwmake +++ b/applications/solvers/multiphase/compressibleInterFoam/Allwmake @@ -5,6 +5,7 @@ cd ${0%/*} || exit 1 # Run from this directory . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments wmake $targetType twoPhaseMixtureThermo +wmake $targetType surfaceTensionModels wmake $targetType wmake $targetType compressibleInterDyMFoam diff --git a/applications/solvers/multiphase/compressibleInterFoam/Make/options b/applications/solvers/multiphase/compressibleInterFoam/Make/options index b947836f65..29b12f3114 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/Make/options +++ b/applications/solvers/multiphase/compressibleInterFoam/Make/options @@ -13,6 +13,7 @@ EXE_INC = \ EXE_LIBS = \ -ltwoPhaseMixtureThermo \ + -ltwoPhaseSurfaceTension \ -lcompressibleTransportModels \ -lfluidThermophysicalModels \ -lspecie \ diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/Make/options b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/Make/options index b44af44a72..4de8fd2713 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/Make/options +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/Make/options @@ -16,6 +16,7 @@ EXE_INC = \ EXE_LIBS = \ -ltwoPhaseMixtureThermo \ + -ltwoPhaseSurfaceTension \ -lcompressibleTransportModels \ -lfluidThermophysicalModels \ -lspecie \ diff --git a/applications/solvers/multiphase/compressibleInterFoam/surfaceTensionModels/Make/files b/applications/solvers/multiphase/compressibleInterFoam/surfaceTensionModels/Make/files new file mode 100644 index 0000000000..fa34a83824 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/surfaceTensionModels/Make/files @@ -0,0 +1,3 @@ +liquidProperties/liquidPropertiesSurfaceTension.C + +LIB = $(FOAM_LIBBIN)/libtwoPhaseSurfaceTension diff --git a/applications/solvers/multiphase/compressibleInterFoam/surfaceTensionModels/Make/options b/applications/solvers/multiphase/compressibleInterFoam/surfaceTensionModels/Make/options new file mode 100644 index 0000000000..0d8cc30e2d --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/surfaceTensionModels/Make/options @@ -0,0 +1,15 @@ +EXE_INC = \ + -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ + -I$(LIB_SRC)/transportModels/compressible/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude + +LIB_LIBS = \ + -linterfaceProperties \ + -lcompressibleTransportModels \ + -lfluidThermophysicalModels \ + -lspecie \ + -lthermophysicalProperties \ + -lfiniteVolume diff --git a/applications/solvers/multiphase/compressibleInterFoam/surfaceTensionModels/liquidProperties/liquidPropertiesSurfaceTension.C b/applications/solvers/multiphase/compressibleInterFoam/surfaceTensionModels/liquidProperties/liquidPropertiesSurfaceTension.C new file mode 100644 index 0000000000..71e1089802 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/surfaceTensionModels/liquidProperties/liquidPropertiesSurfaceTension.C @@ -0,0 +1,155 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2017 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 . + +\*---------------------------------------------------------------------------*/ + +#include "liquidPropertiesSurfaceTension.H" +#include "liquidThermo.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace surfaceTensionModels +{ + defineTypeNameAndDebug(liquidProperties, 0); + addToRunTimeSelectionTable + ( + surfaceTensionModel, + liquidProperties, + dictionary + ); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::surfaceTensionModels::liquidProperties::liquidProperties +( + const dictionary& dict, + const fvMesh& mesh +) +: + surfaceTensionModel(mesh), + phaseName_(dict.lookup("phase")) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::surfaceTensionModels::liquidProperties::~liquidProperties() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp +Foam::surfaceTensionModels::liquidProperties::sigma() const +{ + const heRhoThermopureMixtureliquidProperties& thermo = + mesh_.lookupObject + ( + IOobject::groupName(basicThermo::dictName, phaseName_) + ); + + const Foam::liquidProperties& liquid = thermo.mixture().properties(); + + tmp tsigma + ( + new volScalarField + ( + IOobject + ( + "sigma", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + mesh_, + dimSigma + ) + ); + volScalarField& sigma = tsigma.ref(); + + const volScalarField& T = thermo.T(); + const volScalarField& p = thermo.p(); + + volScalarField::Internal& sigmai = sigma; + const volScalarField::Internal& pi = p; + const volScalarField::Internal& Ti = T; + + forAll(sigmai, celli) + { + sigmai[celli] = liquid.sigma(pi[celli], Ti[celli]); + } + + volScalarField::Boundary& sigmaBf = sigma.boundaryFieldRef(); + const volScalarField::Boundary& pBf = p.boundaryField(); + const volScalarField::Boundary& TBf = T.boundaryField(); + + forAll(sigmaBf, patchi) + { + scalarField& sigmaPf = sigmaBf[patchi]; + const scalarField& pPf = pBf[patchi]; + const scalarField& TPf = TBf[patchi]; + + forAll(sigmaPf, facei) + { + sigmaPf[facei] = liquid.sigma(pPf[facei], TPf[facei]); + } + } + + return tsigma; +} + + +bool Foam::surfaceTensionModels::liquidProperties::read +( + const dictionary& dict +) +{ + return true; +} + + +bool Foam::surfaceTensionModels::liquidProperties::writeData +( + Ostream& os +) const +{ + if (surfaceTensionModel::writeData(os)) + { + return os.good(); + } + else + { + return false; + } +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleInterFoam/surfaceTensionModels/liquidProperties/liquidPropertiesSurfaceTension.H b/applications/solvers/multiphase/compressibleInterFoam/surfaceTensionModels/liquidProperties/liquidPropertiesSurfaceTension.H new file mode 100644 index 0000000000..b209dfc9d6 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/surfaceTensionModels/liquidProperties/liquidPropertiesSurfaceTension.H @@ -0,0 +1,123 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2017 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 . + +Class + Foam::surfaceTensionModels::liquidProperties + +Description + Temperature-dependent surface tension model in which the surface tension + function provided by the phase Foam::liquidProperties class is used. + +Usage + \table + Property | Description | Required | Default value + phase | Phase name | yes | + \endtable + + Example of the surface tension specification: + \verbatim + sigma + { + type liquidProperties; + phase water; + } + \endverbatim + +See also + Foam::surfaceTensionModel + +SourceFiles + liquidPropertiesSurfaceTension.C + +\*---------------------------------------------------------------------------*/ + +#ifndef liquidPropertiesSurfaceTension_H +#define liquidPropertiesSurfaceTension_H + +#include "surfaceTensionModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +namespace surfaceTensionModels +{ + +/*---------------------------------------------------------------------------*\ + Class liquidProperties Declaration +\*---------------------------------------------------------------------------*/ + +class liquidProperties +: + public surfaceTensionModel +{ + // Private data + + //- Name of the liquid phase + word phaseName_; + + +public: + + //- Runtime type information + TypeName("liquidProperties"); + + + // Constructors + + //- Construct from dictionary and mesh + liquidProperties + ( + const dictionary& dict, + const fvMesh& mesh + ); + + + //- Destructor + virtual ~liquidProperties(); + + + // Member Functions + + //- Surface tension coefficient + virtual tmp sigma() const; + + //- Update surface tension coefficient from given dictionary + virtual bool read(const dictionary& dict); + + //- Write in dictionary format + virtual bool writeData(Ostream& os) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace surfaceTensionModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C index cfad517482..6274ad1c31 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C +++ b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C @@ -360,4 +360,17 @@ Foam::tmp Foam::twoPhaseMixtureThermo::alphaEff } +bool Foam::twoPhaseMixtureThermo::read() +{ + if (psiThermo::read()) + { + return interfaceProperties::read(); + } + else + { + return false; + } +} + + // ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H index 82b0ac90a2..aefdbdee4f 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H +++ b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.H @@ -285,6 +285,12 @@ public: const scalarField& alphat, const label patchi ) const; + + + // IO + + //- Read base transportProperties dictionary + virtual bool read(); }; diff --git a/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/plastic/plastic.C b/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/plastic/plastic.C index 5eb7e0f9ce..c096513474 100644 --- a/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/plastic/plastic.C +++ b/applications/solvers/multiphase/driftFluxFoam/mixtureViscosityModels/plastic/plastic.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -56,7 +56,7 @@ Foam::mixtureViscosityModels::plastic::plastic ) : mixtureViscosityModel(name, viscosityProperties, U, phi), - plasticCoeffs_(viscosityProperties.subDict(modelName + "Coeffs")), + plasticCoeffs_(viscosityProperties.optionalSubDict(modelName + "Coeffs")), plasticViscosityCoeff_ ( "coeff", @@ -117,7 +117,7 @@ bool Foam::mixtureViscosityModels::plastic::read { mixtureViscosityModel::read(viscosityProperties); - plasticCoeffs_ = viscosityProperties.subDict(typeName + "Coeffs"); + plasticCoeffs_ = viscosityProperties.optionalSubDict(typeName + "Coeffs"); plasticCoeffs_.lookup("k") >> plasticViscosityCoeff_; plasticCoeffs_.lookup("n") >> plasticViscosityExponent_; diff --git a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C index b6e7fbae00..103ad496b7 100644 --- a/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C +++ b/applications/solvers/multiphase/driftFluxFoam/relativeVelocityModels/relativeVelocityModel/relativeVelocityModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -126,7 +126,7 @@ Foam::autoPtr Foam::relativeVelocityModel::New ( cstrIter() ( - dict.subDict(modelType + "Coeffs"), + dict.optionalSubDict(modelType + "Coeffs"), mixture ) ); diff --git a/applications/solvers/multiphase/interFoam/interMixingFoam/createFields.H b/applications/solvers/multiphase/interFoam/interMixingFoam/createFields.H index 5b152b78a7..5d8a42388a 100644 --- a/applications/solvers/multiphase/interFoam/interMixingFoam/createFields.H +++ b/applications/solvers/multiphase/interFoam/interMixingFoam/createFields.H @@ -40,7 +40,7 @@ const dimensionedScalar& rho1 = mixture.rho1(); const dimensionedScalar& rho2 = mixture.rho2(); const dimensionedScalar& rho3 = mixture.rho3(); -dimensionedScalar D23(mixture.lookup("D23")); +dimensionedScalar D23("D23", dimViscosity, mixture); // Need to store rho for ddt(rho, U) volScalarField rho diff --git a/applications/solvers/multiphase/interFoam/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.C b/applications/solvers/multiphase/interFoam/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.C index dce55234e7..644c3b25a0 100644 --- a/applications/solvers/multiphase/interFoam/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.C +++ b/applications/solvers/multiphase/interFoam/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -168,8 +168,8 @@ Foam::threePhaseInterfaceProperties::threePhaseInterfaceProperties ).lookup("cAlpha") ) ), - sigma12_(mixture.lookup("sigma12")), - sigma13_(mixture.lookup("sigma13")), + sigma12_("sigma12", dimensionSet(1, 0, -2, 0, 0), mixture), + sigma13_("sigma13", dimensionSet(1, 0, -2, 0, 0), mixture), deltaN_ ( diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.C index a4663ba488..32d3fe4308 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -47,10 +47,10 @@ Foam::phaseChangeTwoPhaseMixtures::Kunz::Kunz : phaseChangeTwoPhaseMixture(typeName, U, phi), - UInf_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("UInf")), - tInf_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("tInf")), - Cc_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("Cc")), - Cv_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("Cv")), + UInf_("UInf", dimVelocity, phaseChangeTwoPhaseMixtureCoeffs_), + tInf_("tInf", dimTime, phaseChangeTwoPhaseMixtureCoeffs_), + Cc_("Cc", dimless, phaseChangeTwoPhaseMixtureCoeffs_), + Cv_("Cv", dimless, phaseChangeTwoPhaseMixtureCoeffs_), p0_("0", pSat().dimensions(), 0.0), @@ -102,7 +102,7 @@ bool Foam::phaseChangeTwoPhaseMixtures::Kunz::read() { if (phaseChangeTwoPhaseMixture::read()) { - phaseChangeTwoPhaseMixtureCoeffs_ = subDict(type() + "Coeffs"); + phaseChangeTwoPhaseMixtureCoeffs_ = optionalSubDict(type() + "Coeffs"); phaseChangeTwoPhaseMixtureCoeffs_.lookup("UInf") >> UInf_; phaseChangeTwoPhaseMixtureCoeffs_.lookup("tInf") >> tInf_; diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.C index cfe6b1b008..ade26e86a4 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -47,10 +47,10 @@ Foam::phaseChangeTwoPhaseMixtures::Merkle::Merkle : phaseChangeTwoPhaseMixture(typeName, U, phi), - UInf_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("UInf")), - tInf_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("tInf")), - Cc_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("Cc")), - Cv_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("Cv")), + UInf_("UInf", dimVelocity, phaseChangeTwoPhaseMixtureCoeffs_), + tInf_("tInf", dimTime, phaseChangeTwoPhaseMixtureCoeffs_), + Cc_("Cc", dimless, phaseChangeTwoPhaseMixtureCoeffs_), + Cv_("Cv", dimless, phaseChangeTwoPhaseMixtureCoeffs_), p0_("0", pSat().dimensions(), 0.0), @@ -97,7 +97,7 @@ bool Foam::phaseChangeTwoPhaseMixtures::Merkle::read() { if (phaseChangeTwoPhaseMixture::read()) { - phaseChangeTwoPhaseMixtureCoeffs_ = subDict(type() + "Coeffs"); + phaseChangeTwoPhaseMixtureCoeffs_ = optionalSubDict(type() + "Coeffs"); phaseChangeTwoPhaseMixtureCoeffs_.lookup("UInf") >> UInf_; phaseChangeTwoPhaseMixtureCoeffs_.lookup("tInf") >> tInf_; diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C index 3be86e0f51..07fe4a2331 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -54,10 +54,10 @@ Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::SchnerrSauer : phaseChangeTwoPhaseMixture(typeName, U, phi), - n_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("n")), - dNuc_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("dNuc")), - Cc_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("Cc")), - Cv_(phaseChangeTwoPhaseMixtureCoeffs_.lookup("Cv")), + n_("n", dimless/dimVolume, phaseChangeTwoPhaseMixtureCoeffs_), + dNuc_("dNuc", dimLength, phaseChangeTwoPhaseMixtureCoeffs_), + Cc_("Cc", dimless, phaseChangeTwoPhaseMixtureCoeffs_), + Cv_("Cv", dimless, phaseChangeTwoPhaseMixtureCoeffs_), p0_("0", pSat().dimensions(), 0.0) { @@ -151,7 +151,7 @@ bool Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::read() { if (phaseChangeTwoPhaseMixture::read()) { - phaseChangeTwoPhaseMixtureCoeffs_ = subDict(type() + "Coeffs"); + phaseChangeTwoPhaseMixtureCoeffs_ = optionalSubDict(type() + "Coeffs"); phaseChangeTwoPhaseMixtureCoeffs_.lookup("n") >> n_; phaseChangeTwoPhaseMixtureCoeffs_.lookup("dNuc") >> dNuc_; diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C index b9a5e69bf8..c4fe701a2f 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,7 +43,7 @@ Foam::phaseChangeTwoPhaseMixture::phaseChangeTwoPhaseMixture ) : incompressibleTwoPhaseMixture(U, phi), - phaseChangeTwoPhaseMixtureCoeffs_(subDict(type + "Coeffs")), + phaseChangeTwoPhaseMixtureCoeffs_(optionalSubDict(type + "Coeffs")), pSat_("pSat", dimPressure, lookup("pSat")) {} @@ -77,7 +77,7 @@ bool Foam::phaseChangeTwoPhaseMixture::read() { if (incompressibleTwoPhaseMixture::read()) { - phaseChangeTwoPhaseMixtureCoeffs_ = subDict(type() + "Coeffs"); + phaseChangeTwoPhaseMixtureCoeffs_ = optionalSubDict(type() + "Coeffs"); lookup("pSat") >> pSat_; return true; diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/diameterModels/diameterModel/newDiameterModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/diameterModels/diameterModel/newDiameterModel.C index b58f00291b..ef872df0cc 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/diameterModels/diameterModel/newDiameterModel.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/diameterModels/diameterModel/newDiameterModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -56,7 +56,11 @@ Foam::autoPtr Foam::diameterModel::New << exit(FatalError); } - return cstrIter()(dict.subDict(diameterModelType + "Coeffs"), phase); + return cstrIter() + ( + dict.optionalSubDict(diameterModelType + "Coeffs"), + phase + ); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/diameterModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/diameterModel.C index a956565b47..d7eaa2f081 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/diameterModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/diameterModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -61,7 +61,7 @@ void Foam::diameterModel::correct() bool Foam::diameterModel::read(const dictionary& phaseProperties) { - diameterProperties_ = phaseProperties.subDict(type() + "Coeffs"); + diameterProperties_ = phaseProperties.optionalSubDict(type() + "Coeffs"); return true; } diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/newDiameterModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/newDiameterModel.C index b58f00291b..ef872df0cc 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/newDiameterModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/diameterModels/diameterModel/newDiameterModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -56,7 +56,11 @@ Foam::autoPtr Foam::diameterModel::New << exit(FatalError); } - return cstrIter()(dict.subDict(diameterModelType + "Coeffs"), phase); + return cstrIter() + ( + dict.optionalSubDict(diameterModelType + "Coeffs"), + phase + ); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/reactionThermo/hRefConstThermos.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/reactionThermo/hRefConstThermos.C index f43303a2b7..712a96e1de 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/reactionThermo/hRefConstThermos.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/reactionThermo/hRefConstThermos.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -253,6 +253,14 @@ makeReactionMixtureThermo constRefRhoConstHThermoPhysics ); +makeReactionMixtureThermo +( + rhoThermo, + rhoReactionThermo, + heRhoThermo, + multiComponentMixture, + constRefFluidHThermoPhysics +); makeReactionMixtureThermo ( diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C index 3dfc5e971b..034da57349 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.C @@ -86,7 +86,8 @@ alphatWallBoilingWallFunctionFvPatchScalarField relax_(0.5), AbyV_(p.size(), 0), alphatConv_(p.size(), 0), - dDep_(p.size(), 0), + dDep_(p.size(), 1e-5), + qq_(p.size(), 0), partitioningModel_(nullptr), nucleationSiteModel_(nullptr), departureDiamModel_(nullptr), @@ -114,7 +115,8 @@ alphatWallBoilingWallFunctionFvPatchScalarField relax_(dict.lookupOrDefault("relax", 0.5)), AbyV_(p.size(), 0), alphatConv_(p.size(), 0), - dDep_(p.size(), 0), + dDep_(p.size(), 1e-5), + qq_(p.size(), 0), partitioningModel_(nullptr), nucleationSiteModel_(nullptr), departureDiamModel_(nullptr), @@ -165,6 +167,11 @@ alphatWallBoilingWallFunctionFvPatchScalarField dDep_ = scalarField("dDep", dict, p.size()); } + if (dict.found("qQuenching")) + { + qq_ = scalarField("qQuenching", dict, p.size()); + } + break; } } @@ -203,6 +210,7 @@ alphatWallBoilingWallFunctionFvPatchScalarField AbyV_(psf.AbyV_), alphatConv_(psf.alphatConv_, mapper), dDep_(psf.dDep_, mapper), + qq_(psf.qq_, mapper), partitioningModel_(psf.partitioningModel_), nucleationSiteModel_(psf.nucleationSiteModel_), departureDiamModel_(psf.departureDiamModel_), @@ -221,6 +229,7 @@ alphatWallBoilingWallFunctionFvPatchScalarField AbyV_(psf.AbyV_), alphatConv_(psf.alphatConv_), dDep_(psf.dDep_), + qq_(psf.qq_), partitioningModel_(psf.partitioningModel_), nucleationSiteModel_(psf.nucleationSiteModel_), departureDiamModel_(psf.departureDiamModel_), @@ -240,6 +249,7 @@ alphatWallBoilingWallFunctionFvPatchScalarField AbyV_(psf.AbyV_), alphatConv_(psf.alphatConv_), dDep_(psf.dDep_), + qq_(psf.qq_), partitioningModel_(psf.partitioningModel_), nucleationSiteModel_(psf.nucleationSiteModel_), departureDiamModel_(psf.departureDiamModel_), @@ -436,14 +446,7 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() const scalarField Tplus(Prt_*(log(E_*yPlus)/kappa_ + P)); scalarField Tl(Tw - (Tplus_y250/Tplus)*(Tw - Tc)); - Tl = max(Tc - 40, min(Tc, Tl)); - const scalarField Tsub(max(Tsatw - Tl, scalar(0))); - - // Wall heat flux partitioning - const scalarField fLiquid - ( - partitioningModel_->fLiquid(liquidw) - ); + Tl = max(Tc - 40, Tl); // Nucleation site density: const scalarField N @@ -453,7 +456,9 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() liquid, vapor, patchi, - Tsatw + Tl, + Tsatw, + L ) ); @@ -463,7 +468,9 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() liquid, vapor, patchi, - Tsub + Tl, + Tsatw, + L ); // Bubble departure frequency: @@ -481,19 +488,24 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() // Area fractions: // Del Valle & Kenning (1985) - const scalarField Ja(rhoLiquidw*Cpw*Tsub/(rhoVaporw*L)); - const scalarField Al(fLiquid*4.8*exp(-Ja/80)); + const scalarField Ja + ( + rhoLiquidw*Cpw*(Tsatw - Tl)/(rhoVaporw*L) + ); + const scalarField Al + ( + fLiquid*4.8*exp( min(-Ja/80,log(VGREAT))) + ); const scalarField A2(min(pi*sqr(dDep_)*N*Al/4, scalar(1))); const scalarField A1(max(1 - A2, scalar(1e-4))); const scalarField A2E(min(pi*sqr(dDep_)*N*Al/4, scalar(5))); - // Wall evaporation heat flux [kg/s3 = J/m2s] - const scalarField Qe((1.0/6.0)*A2E*dDep_*rhoVaporw*fDep*L); - // Volumetric mass source in the near wall cell due to the // wall boiling - dmdt_ = (1 - relax_)*dmdt_ + relax_*Qe*AbyV_/L; + dmdt_ = + (1 - relax_)*dmdt_ + + relax_*(1.0/6.0)*A2E*dDep_*rhoVaporw*fDep*AbyV_; // Volumetric source in the near wall cell due to the wall // boiling @@ -506,7 +518,7 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() ); // Quenching heat flux - const scalarField Qq(A2*hQ*max(Tw - Tl, scalar(0))); + qq_ = (A2*hQ*max(Tw - Tl, scalar(0))); // Effective thermal diffusivity that corresponds to the // calculated convective, quenching and evaporative heat fluxes @@ -515,7 +527,7 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() ( ( A1*alphatConv_ - + (Qq + Qe)/max(hew.snGrad(), scalar(1e-16)) + + (qq_ + qe())/max(hew.snGrad(), scalar(1e-16)) ) /max(liquidw, scalar(1e-8)) ); @@ -538,12 +550,12 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() if (debug) { - const scalarField Qc + const scalarField qc ( fLiquid*A1*(alphatConv_ + alphaw)*hew.snGrad() ); - const scalarField QEff + const scalarField qEff ( liquidw*(*this + alphaw)*hew.snGrad() ); @@ -562,13 +574,13 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::updateCoeffs() << gMax(A2E) << endl; Info<< " dmdtW: " << gMin(dmdt_) << " - " << gMax(dmdt_) << endl; - Info<< " Qc: " << gMin(Qc) << " - " << gMax(Qc) << endl; - Info<< " Qq: " << gMin(fLiquid*Qq) << " - " - << gMax(fLiquid*Qq) << endl; - Info<< " Qe: " << gMin(fLiquid*Qe) << " - " - << gMax(fLiquid*Qe) << endl; - Info<< " QEff: " << gMin(QEff) << " - " - << gMax(QEff) << endl; + Info<< " qc: " << gMin(qc) << " - " << gMax(qc) << endl; + Info<< " qq: " << gMin(fLiquid*qq()) << " - " + << gMax(fLiquid*qq()) << endl; + Info<< " qe: " << gMin(fLiquid*qe()) << " - " + << gMax(fLiquid*qe()) << endl; + Info<< " qEff: " << gMin(qEff) << " - " + << gMax(qEff) << endl; Info<< " alphat: " << gMin(*this) << " - " << gMax(*this) << endl; Info<< " alphatConv: " << gMin(alphatConv_) @@ -636,6 +648,7 @@ void alphatWallBoilingWallFunctionFvPatchScalarField::write(Ostream& os) const dmdt_.writeEntry("dmdt", os); dDep_.writeEntry("dDep", os); + qq_.writeEntry("qQuenching", os); alphatConv_.writeEntry("alphatConv", os); writeEntry("value", os); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.H index 701a3f911f..665d41197e 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/alphatWallBoilingWallFunction/alphatWallBoilingWallFunctionFvPatchScalarField.H @@ -181,6 +181,9 @@ private: //- Departure diameter field scalarField dDep_; + //- Quenching surface heat flux + scalarField qq_; + //- Run-time selected heat flux partitioning model autoPtr partitioningModel_; @@ -275,6 +278,17 @@ public: return dDep_; } + //- Return the quenching surface heat flux [W/m2] + const scalarField& qq() const + { + return qq_; + } + + //- Return the evaporation surface heat flux [W/m2] + tmp qe() const + { + return mDotL_/AbyV_; + } // Evaluation functions diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshii/KocamustafaogullariIshii.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshii/KocamustafaogullariIshii.C index ae6ecf4620..53fe0e2f15 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshii/KocamustafaogullariIshii.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshii/KocamustafaogullariIshii.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -80,7 +80,9 @@ KocamustafaogullariIshii::dDeparture const phaseModel& liquid, const phaseModel& vapor, const label patchi, - const scalarField& Tsub + const scalarField& Tl, + const scalarField& Tsatw, + const scalarField& L ) const { // Gravitational acceleration diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshii/KocamustafaogullariIshii.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshii/KocamustafaogullariIshii.H index 5bbe8d5433..e7f0c67555 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshii/KocamustafaogullariIshii.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/KocamustafaogullariIshii/KocamustafaogullariIshii.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -92,7 +92,9 @@ public: const phaseModel& liquid, const phaseModel& vapor, const label patchi, - const scalarField& Tsub + const scalarField& Tl, + const scalarField& Tsatw, + const scalarField& L ) const; virtual void write(Ostream& os) const; diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.C index 23229071c0..71ef4f03c7 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -54,7 +54,10 @@ TolubinskiKostanchuk::TolubinskiKostanchuk const dictionary& dict ) : - departureDiameterModel() + departureDiameterModel(), + dRef_(dict.lookupOrDefault("dRef", 6e-4)), + dMax_(dict.lookupOrDefault("dMax", 0.0014)), + dMin_(dict.lookupOrDefault("dMin", 1e-6)) {} @@ -74,10 +77,22 @@ TolubinskiKostanchuk::dDeparture const phaseModel& liquid, const phaseModel& vapor, const label patchi, - const scalarField& Tsub + const scalarField& Tl, + const scalarField& Tsatw, + const scalarField& L ) const { - return max(min(0.0006*exp(-Tsub/45), scalar(0.0014)), scalar(1e-6)); + return max(min(dRef_*exp(-(Tsatw-Tl)/45), dMax_), dMin_); +} + + +void Foam::wallBoilingModels::departureDiameterModels:: +TolubinskiKostanchuk::write(Ostream& os) const +{ + departureDiameterModel::write(os); + os.writeKeyword("dRef") << dRef_ << token::END_STATEMENT << nl; + os.writeKeyword("dMax") << dMax_ << token::END_STATEMENT << nl; + os.writeKeyword("dMin") << dMin_ << token::END_STATEMENT << nl; } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.H index 9437f5185b..79c5d61c6a 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/TolubinskiKostanchuk/TolubinskiKostanchuk.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -63,6 +63,17 @@ class TolubinskiKostanchuk public departureDiameterModel { + // Private data: + + //- Coefficient of the temperature term + scalar dRef_; + + //- Maximum diameter + scalar dMax_; + + //- Minimum diameter + scalar dMin_; + public: //- Runtime type information @@ -87,8 +98,12 @@ public: const phaseModel& liquid, const phaseModel& vapor, const label patchi, - const scalarField& Tsub + const scalarField& Tl, + const scalarField& Tsatw, + const scalarField& L ) const; + + virtual void write(Ostream& os) const; }; diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.H index 47f431eb19..5a7375e061 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/departureDiameterModels/departureDiameterModel/departureDiameterModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -107,7 +107,9 @@ public: const phaseModel& liquid, const phaseModel& vapor, const label patchi, - const scalarField& Tsub + const scalarField& Tl, + const scalarField& Tsatw, + const scalarField& L ) const = 0; virtual void write(Ostream& os) const; diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.C index 28920597d2..69eddc91c8 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -53,7 +53,8 @@ Foam::wallBoilingModels::nucleationSiteModels::LemmertChawla::LemmertChawla const dictionary& dict ) : - nucleationSiteModel() + nucleationSiteModel(), + Cn_(dict.lookupOrDefault("Cn", 1)) {} @@ -71,13 +72,15 @@ Foam::wallBoilingModels::nucleationSiteModels::LemmertChawla::N const phaseModel& liquid, const phaseModel& vapor, const label patchi, - const fvPatchScalarField& Tsatw + const scalarField& Tl, + const scalarField& Tsatw, + const scalarField& L ) const { const fvPatchScalarField& Tw = liquid.thermo().T().boundaryField()[patchi]; - return 0.8*9.922e5*pow(max((Tw - Tsatw)/10, scalar(0)), 1.805); + return Cn_*9.922e5*pow(max((Tw - Tsatw)/10, scalar(0)), 1.805); } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.H index a521eb7842..f3c560478f 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/LemmertChawla/LemmertChawla.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -68,6 +68,11 @@ class LemmertChawla public nucleationSiteModel { + // Private data: + + //- Coefficient for nucleation site density + scalar Cn_; + public: //- Runtime type information @@ -91,7 +96,9 @@ public: const phaseModel& liquid, const phaseModel& vapor, const label patchi, - const fvPatchScalarField& Tsatw + const scalarField& Tl, + const scalarField& Tsatw, + const scalarField& L ) const; }; diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.H index 6a26e4de70..fc26b7f9ec 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/derivedFvPatchFields/wallBoilingSubModels/nucleationSiteModels/nucleationSiteModel/nucleationSiteModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -107,7 +107,9 @@ public: const phaseModel& liquid, const phaseModel& vapor, const label patchi, - const fvPatchScalarField& Tsatw + const scalarField& Tl, + const scalarField& Tsatw, + const scalarField& L ) const = 0; virtual void write(Ostream& os) const; diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C index 5abe9f3561..a1794a7820 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -56,7 +56,7 @@ Foam::kineticTheoryModels::conductivityModels::HrenyaSinclair::HrenyaSinclair ) : conductivityModel(dict), - coeffDict_(dict.subDict(typeName + "Coeffs")), + coeffDict_(dict.optionalSubDict(typeName + "Coeffs")), L_("L", dimensionSet(0, 1, 0, 0, 0), coeffDict_) {} @@ -103,7 +103,7 @@ Foam::kineticTheoryModels::conductivityModels::HrenyaSinclair::kappa bool Foam::kineticTheoryModels::conductivityModels::HrenyaSinclair::read() { - coeffDict_ <<= dict_.subDict(typeName + "Coeffs"); + coeffDict_ <<= dict_.optionalSubDict(typeName + "Coeffs"); L_.readIfPresent(coeffDict_); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C index ab6d3d354a..6b110d3731 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -57,7 +57,7 @@ JohnsonJackson ) : frictionalStressModel(dict), - coeffDict_(dict.subDict(typeName + "Coeffs")), + coeffDict_(dict.optionalSubDict(typeName + "Coeffs")), Fr_("Fr", dimensionSet(1, -1, -2, 0, 0), coeffDict_), eta_("eta", dimless, coeffDict_), p_("p", dimless, coeffDict_), @@ -130,7 +130,7 @@ Foam::kineticTheoryModels::frictionalStressModels::JohnsonJackson::nu bool Foam::kineticTheoryModels::frictionalStressModels::JohnsonJackson::read() { - coeffDict_ <<= dict_.subDict(typeName + "Coeffs"); + coeffDict_ <<= dict_.optionalSubDict(typeName + "Coeffs"); Fr_.read(coeffDict_); eta_.read(coeffDict_); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.C index 3b69aa8a62..67517beb07 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -57,7 +57,7 @@ JohnsonJacksonSchaeffer::JohnsonJacksonSchaeffer ) : frictionalStressModel(dict), - coeffDict_(dict.subDict(typeName + "Coeffs")), + coeffDict_(dict.optionalSubDict(typeName + "Coeffs")), Fr_("Fr", dimensionSet(1, -1, -2, 0, 0), coeffDict_), eta_("eta", dimless, coeffDict_), p_("p", dimless, coeffDict_), @@ -190,7 +190,7 @@ JohnsonJacksonSchaeffer::nu bool Foam::kineticTheoryModels::frictionalStressModels:: JohnsonJacksonSchaeffer::read() { - coeffDict_ <<= dict_.subDict(typeName + "Coeffs"); + coeffDict_ <<= dict_.optionalSubDict(typeName + "Coeffs"); Fr_.read(coeffDict_); eta_.read(coeffDict_); diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C index be2555958c..eeabe622e1 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -55,7 +55,7 @@ Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::Schaeffer ) : frictionalStressModel(dict), - coeffDict_(dict.subDict(typeName + "Coeffs")), + coeffDict_(dict.optionalSubDict(typeName + "Coeffs")), phi_("phi", dimless, coeffDict_) { phi_ *= constant::mathematical::pi/180.0; @@ -178,7 +178,7 @@ Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::nu bool Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::read() { - coeffDict_ <<= dict_.subDict(typeName + "Coeffs"); + coeffDict_ <<= dict_.optionalSubDict(typeName + "Coeffs"); phi_.read(coeffDict_); phi_ *= constant::mathematical::pi/180.0; diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C index 415bb3145a..6607b16443 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -56,7 +56,7 @@ Foam::kineticTheoryModels::viscosityModels::HrenyaSinclair::HrenyaSinclair ) : viscosityModel(dict), - coeffDict_(dict.subDict(typeName + "Coeffs")), + coeffDict_(dict.optionalSubDict(typeName + "Coeffs")), L_("L", dimensionSet(0, 1, 0, 0, 0), coeffDict_) {} @@ -100,7 +100,7 @@ Foam::kineticTheoryModels::viscosityModels::HrenyaSinclair::nu bool Foam::kineticTheoryModels::viscosityModels::HrenyaSinclair::read() { - coeffDict_ <<= dict_.subDict(typeName + "Coeffs"); + coeffDict_ <<= dict_.optionalSubDict(typeName + "Coeffs"); L_.readIfPresent(coeffDict_); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C index 5abe9f3561..a1794a7820 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -56,7 +56,7 @@ Foam::kineticTheoryModels::conductivityModels::HrenyaSinclair::HrenyaSinclair ) : conductivityModel(dict), - coeffDict_(dict.subDict(typeName + "Coeffs")), + coeffDict_(dict.optionalSubDict(typeName + "Coeffs")), L_("L", dimensionSet(0, 1, 0, 0, 0), coeffDict_) {} @@ -103,7 +103,7 @@ Foam::kineticTheoryModels::conductivityModels::HrenyaSinclair::kappa bool Foam::kineticTheoryModels::conductivityModels::HrenyaSinclair::read() { - coeffDict_ <<= dict_.subDict(typeName + "Coeffs"); + coeffDict_ <<= dict_.optionalSubDict(typeName + "Coeffs"); L_.readIfPresent(coeffDict_); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C index ab6d3d354a..6b110d3731 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -57,7 +57,7 @@ JohnsonJackson ) : frictionalStressModel(dict), - coeffDict_(dict.subDict(typeName + "Coeffs")), + coeffDict_(dict.optionalSubDict(typeName + "Coeffs")), Fr_("Fr", dimensionSet(1, -1, -2, 0, 0), coeffDict_), eta_("eta", dimless, coeffDict_), p_("p", dimless, coeffDict_), @@ -130,7 +130,7 @@ Foam::kineticTheoryModels::frictionalStressModels::JohnsonJackson::nu bool Foam::kineticTheoryModels::frictionalStressModels::JohnsonJackson::read() { - coeffDict_ <<= dict_.subDict(typeName + "Coeffs"); + coeffDict_ <<= dict_.optionalSubDict(typeName + "Coeffs"); Fr_.read(coeffDict_); eta_.read(coeffDict_); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.C index 3b69aa8a62..67517beb07 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -57,7 +57,7 @@ JohnsonJacksonSchaeffer::JohnsonJacksonSchaeffer ) : frictionalStressModel(dict), - coeffDict_(dict.subDict(typeName + "Coeffs")), + coeffDict_(dict.optionalSubDict(typeName + "Coeffs")), Fr_("Fr", dimensionSet(1, -1, -2, 0, 0), coeffDict_), eta_("eta", dimless, coeffDict_), p_("p", dimless, coeffDict_), @@ -190,7 +190,7 @@ JohnsonJacksonSchaeffer::nu bool Foam::kineticTheoryModels::frictionalStressModels:: JohnsonJacksonSchaeffer::read() { - coeffDict_ <<= dict_.subDict(typeName + "Coeffs"); + coeffDict_ <<= dict_.optionalSubDict(typeName + "Coeffs"); Fr_.read(coeffDict_); eta_.read(coeffDict_); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C index be2555958c..eeabe622e1 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -55,7 +55,7 @@ Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::Schaeffer ) : frictionalStressModel(dict), - coeffDict_(dict.subDict(typeName + "Coeffs")), + coeffDict_(dict.optionalSubDict(typeName + "Coeffs")), phi_("phi", dimless, coeffDict_) { phi_ *= constant::mathematical::pi/180.0; @@ -178,7 +178,7 @@ Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::nu bool Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::read() { - coeffDict_ <<= dict_.subDict(typeName + "Coeffs"); + coeffDict_ <<= dict_.optionalSubDict(typeName + "Coeffs"); phi_.read(coeffDict_); phi_ *= constant::mathematical::pi/180.0; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C index 415bb3145a..6607b16443 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseCompressibleTurbulenceModels/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -56,7 +56,7 @@ Foam::kineticTheoryModels::viscosityModels::HrenyaSinclair::HrenyaSinclair ) : viscosityModel(dict), - coeffDict_(dict.subDict(typeName + "Coeffs")), + coeffDict_(dict.optionalSubDict(typeName + "Coeffs")), L_("L", dimensionSet(0, 1, 0, 0, 0), coeffDict_) {} @@ -100,7 +100,7 @@ Foam::kineticTheoryModels::viscosityModels::HrenyaSinclair::nu bool Foam::kineticTheoryModels::viscosityModels::HrenyaSinclair::read() { - coeffDict_ <<= dict_.subDict(typeName + "Coeffs"); + coeffDict_ <<= dict_.optionalSubDict(typeName + "Coeffs"); L_.readIfPresent(coeffDict_); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/diameterModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/diameterModel.C index 55225147ac..d7eaa2f081 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/diameterModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/diameterModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -61,7 +61,7 @@ void Foam::diameterModel::correct() bool Foam::diameterModel::read(const dictionary& phaseProperties) { - diameterProperties_ = phaseProperties.subDict(type() + "Coeffs"); + diameterProperties_ = phaseProperties.optionalSubDict(type() + "Coeffs"); return true; } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/newDiameterModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/newDiameterModel.C index b58f00291b..ef872df0cc 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/newDiameterModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/diameterModel/newDiameterModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -56,7 +56,11 @@ Foam::autoPtr Foam::diameterModel::New << exit(FatalError); } - return cstrIter()(dict.subDict(diameterModelType + "Coeffs"), phase); + return cstrIter() + ( + dict.optionalSubDict(diameterModelType + "Coeffs"), + phase + ); } diff --git a/applications/test/findSphereFeatureEdges-octree/Make/options b/applications/test/findSphereFeatureEdges-octree/Make/options index 6069034514..d27c95d033 100644 --- a/applications/test/findSphereFeatureEdges-octree/Make/options +++ b/applications/test/findSphereFeatureEdges-octree/Make/options @@ -1,9 +1,7 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/edgeMesh/lnInclude + -I$(LIB_SRC)/meshTools/lnInclude EXE_LIBS = \ -lfiniteVolume \ - -lmeshTools \ - -ledgeMesh + -lmeshTools diff --git a/applications/utilities/mesh/generation/foamyMesh/cellSizeAndAlignmentGrid/Make/options b/applications/utilities/mesh/generation/foamyMesh/cellSizeAndAlignmentGrid/Make/options index 21d9fd8131..c53403e602 100644 --- a/applications/utilities/mesh/generation/foamyMesh/cellSizeAndAlignmentGrid/Make/options +++ b/applications/utilities/mesh/generation/foamyMesh/cellSizeAndAlignmentGrid/Make/options @@ -19,7 +19,6 @@ EXE_INC = \ -I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/parallel/decompose/decompositionMethods/lnInclude \ - -I$(LIB_SRC)/edgeMesh/lnInclude \ -I$(LIB_SRC)/mesh/snappyHexMesh/lnInclude \ -I../conformalVoronoiMesh/lnInclude @@ -30,7 +29,6 @@ EXE_LIBS = \ -lmeshTools \ -ldecompositionMethods \ -L$(FOAM_LIBBIN)/dummy -lscotchDecomp -lptscotchDecomp \ - -ledgeMesh \ -ltriSurface \ -ldynamicMesh \ -lsampling \ diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/Make/options b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/Make/options index a25814c1c4..1baf4fb2f9 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/Make/options +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/Make/options @@ -17,7 +17,6 @@ EXE_INC = \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/parallel/decompose/decompositionMethods/lnInclude \ -I$(LIB_SRC)/parallel/decompose/decompose/lnInclude \ - -I$(LIB_SRC)/edgeMesh/lnInclude \ -I$(LIB_SRC)/fileFormats/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/surfMesh/lnInclude \ @@ -30,7 +29,6 @@ LIB_LIBS = \ ${CGAL_LIBS} \ -lmeshTools \ -ldecompose \ - -ledgeMesh \ -lfileFormats \ -ltriSurface \ -ldynamicMesh \ diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/cellSizeFunction/cellSizeFunction/cellSizeFunction.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/cellSizeFunction/cellSizeFunction/cellSizeFunction.C index c0db55e558..3e6860c7a5 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/cellSizeFunction/cellSizeFunction/cellSizeFunction.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/cellSizeFunction/cellSizeFunction/cellSizeFunction.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -58,7 +58,7 @@ Foam::cellSizeFunction::cellSizeFunction defaultCellSize ) ), - coeffsDict_(subDict(type + "Coeffs")), + coeffsDict_(optionalSubDict(type + "Coeffs")), defaultCellSize_(defaultCellSize), regionIndices_(regionIndices), sideMode_(), diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/automatic/automatic.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/automatic/automatic.C index ccaff192aa..d9bf097d1d 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/automatic/automatic.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/automatic/automatic.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. ------------------------------------------------------------------------------- License @@ -107,7 +107,7 @@ Foam::automatic::automatic surface, defaultCellSize ), - coeffsDict_(cellSizeCalcTypeDict.subDict(typeName + "Coeffs")), + coeffsDict_(cellSizeCalcTypeDict.optionalSubDict(typeName + "Coeffs")), surfaceName_(surface.searchableSurface::name()), readCurvature_(Switch(coeffsDict_.lookup("curvature"))), curvatureFile_(coeffsDict_.lookup("curvatureFile")), diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/fieldFromFile/fieldFromFile.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/fieldFromFile/fieldFromFile.C index 6d6b56e7b6..c4f2014caf 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/fieldFromFile/fieldFromFile.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/cellSizeCalculationType/fieldFromFile/fieldFromFile.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -58,10 +58,13 @@ Foam::fieldFromFile::fieldFromFile surface, defaultCellSize ), - coeffsDict_(cellSizeCalcTypeDict.subDict(typeName + "Coeffs")), + coeffsDict_(cellSizeCalcTypeDict.optionalSubDict(typeName + "Coeffs")), fileName_ ( - cellSizeCalcTypeDict.subDict(typeName + "Coeffs").lookup("fieldFile") + cellSizeCalcTypeDict.optionalSubDict + ( + typeName + "Coeffs" + ).lookup("fieldFile") ), cellSizeMultipleCoeff_ ( diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/surfaceCellSizeFunction/surfaceCellSizeFunction.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/surfaceCellSizeFunction/surfaceCellSizeFunction.C index cac1837021..33d7267d7d 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/surfaceCellSizeFunction/surfaceCellSizeFunction.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/cellSizeControlSurfaces/surfaceCellSizeFunction/surfaceCellSizeFunction/surfaceCellSizeFunction.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -46,7 +46,7 @@ Foam::surfaceCellSizeFunction::surfaceCellSizeFunction : dictionary(surfaceCellSizeFunctionDict), surface_(surface), - coeffsDict_(subDict(type + "Coeffs")), + coeffsDict_(optionalSubDict(type + "Coeffs")), defaultCellSize_(defaultCellSize), refinementFactor_ ( diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/faceAreaWeightModel/faceAreaWeightModel/faceAreaWeightModel.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/faceAreaWeightModel/faceAreaWeightModel/faceAreaWeightModel.C index 6388c0c6c8..0aa043cb1e 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/faceAreaWeightModel/faceAreaWeightModel/faceAreaWeightModel.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/faceAreaWeightModel/faceAreaWeightModel/faceAreaWeightModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -46,7 +46,7 @@ faceAreaWeightModel::faceAreaWeightModel ) : dictionary(relaxationDict), - coeffDict_(subDict(type + "Coeffs")) + coeffDict_(optionalSubDict(type + "Coeffs")) {} diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/initialPointsMethod/initialPointsMethod.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/initialPointsMethod/initialPointsMethod.C index 1100784155..d7b93caba4 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/initialPointsMethod/initialPointsMethod.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/initialPointsMethod/initialPointsMethod/initialPointsMethod.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -56,7 +56,7 @@ initialPointsMethod::initialPointsMethod geometryToConformTo_(geometryToConformTo), cellShapeControls_(cellShapeControls), decomposition_(decomposition), - detailsDict_(subDict(type + "Coeffs")), + detailsDict_(optionalSubDict(type + "Coeffs")), minimumSurfaceDistanceCoeffSqr_ ( sqr diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/relaxationModel/relaxationModel/relaxationModel.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/relaxationModel/relaxationModel/relaxationModel.C index e47cbf4aaa..c06c5ed969 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/relaxationModel/relaxationModel/relaxationModel.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/relaxationModel/relaxationModel/relaxationModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -48,7 +48,7 @@ relaxationModel::relaxationModel : dictionary(relaxationDict), runTime_(runTime), - coeffDict_(subDict(type + "Coeffs")) + coeffDict_(optionalSubDict(type + "Coeffs")) {} diff --git a/applications/utilities/mesh/generation/foamyMesh/foamyHexMesh/Make/options b/applications/utilities/mesh/generation/foamyMesh/foamyHexMesh/Make/options index 560ee3a7b8..ce8d65dcc6 100644 --- a/applications/utilities/mesh/generation/foamyMesh/foamyHexMesh/Make/options +++ b/applications/utilities/mesh/generation/foamyMesh/foamyHexMesh/Make/options @@ -17,7 +17,6 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/parallel/decompose/decompositionMethods/lnInclude \ - -I$(LIB_SRC)/edgeMesh/lnInclude \ -I$(LIB_SRC)/fileFormats/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/triSurface/lnInclude \ @@ -32,7 +31,6 @@ EXE_LIBS = \ -ldecompositionMethods \ -ldecompose \ -L$(FOAM_LIBBIN)/dummy -lptscotchDecomp -lscotchDecomp \ - -ledgeMesh \ -lfileFormats \ -ltriSurface \ -ldynamicMesh \ diff --git a/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshBackgroundMesh/Make/options b/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshBackgroundMesh/Make/options index 625763f597..293882347b 100644 --- a/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshBackgroundMesh/Make/options +++ b/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshBackgroundMesh/Make/options @@ -10,7 +10,6 @@ EXE_INC = \ -I../conformalVoronoiMesh/lnInclude \ -I$(LIB_SRC)/parallel/decompose/decompositionMethods/lnInclude \ -I$(LIB_SRC)/parallel/decompose/decompose/lnInclude \ - -I$(LIB_SRC)/edgeMesh/lnInclude \ -I$(LIB_SRC)/mesh/snappyHexMesh/lnInclude \ -I$(LIB_SRC)/triSurface/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ @@ -25,7 +24,6 @@ EXE_LIBS = \ -lconformalVoronoiMesh \ -ldecompositionMethods /* -L$(FOAM_LIBBIN)/dummy -lscotchDecomp */ \ -ldecompose \ - -ledgeMesh \ -ltriSurface \ -lmeshTools \ -lfileFormats \ diff --git a/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshSurfaceSimplify/Make/options b/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshSurfaceSimplify/Make/options index 1a24c89f70..0a1653a2f3 100644 --- a/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshSurfaceSimplify/Make/options +++ b/applications/utilities/mesh/generation/foamyMesh/foamyHexMeshSurfaceSimplify/Make/options @@ -8,7 +8,6 @@ EXE_INC = \ /* -IMarchingCubes */ \ -I$(FASTDUALOCTREE_SRC_PATH) \ -I../conformalVoronoiMesh/lnInclude \ - -I$(LIB_SRC)/edgeMesh/lnInclude \ -I$(LIB_SRC)/mesh/snappyHexMesh/lnInclude \ -I$(LIB_SRC)/fileFormats/lnInclude \ -I$(LIB_SRC)/triSurface/lnInclude \ @@ -20,7 +19,6 @@ EXE_LIBS = \ -lGL \ -lconformalVoronoiMesh \ -ldecompositionMethods -L$(FOAM_LIBBIN)/dummy -lscotchDecomp \ - -ledgeMesh \ -lfileFormats \ -ltriSurface \ -lmeshTools \ diff --git a/applications/utilities/mesh/generation/foamyMesh/foamyQuadMesh/Make/options b/applications/utilities/mesh/generation/foamyMesh/foamyQuadMesh/Make/options index ede07dde71..37dda18569 100644 --- a/applications/utilities/mesh/generation/foamyMesh/foamyQuadMesh/Make/options +++ b/applications/utilities/mesh/generation/foamyMesh/foamyQuadMesh/Make/options @@ -15,7 +15,6 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/surfMesh/lnInclude \ - -I$(LIB_SRC)/edgeMesh/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/mesh/extrudeModel/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude \ @@ -31,7 +30,6 @@ EXE_LIBS = \ -lconformalVoronoiMesh \ -lmeshTools \ -lsurfMesh \ - -ledgeMesh \ -ltriSurface \ -ldynamicMesh \ -ldecompositionMethods \ diff --git a/applications/utilities/mesh/generation/snappyHexMesh/Make/options b/applications/utilities/mesh/generation/snappyHexMesh/Make/options index 40ccd9c2ce..a01104b387 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/Make/options +++ b/applications/utilities/mesh/generation/snappyHexMesh/Make/options @@ -7,7 +7,6 @@ EXE_INC = \ -I$(LIB_SRC)/triSurface/lnInclude \ -I$(LIB_SRC)/surfMesh/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ - -I$(LIB_SRC)/edgeMesh/lnInclude \ -I$(LIB_SRC)/parallel/decompose/decompose/lnInclude \ -I$(LIB_SRC)/parallel/reconstruct/reconstruct/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C index 777730a96d..ba4a1e9306 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C @@ -144,7 +144,7 @@ autoPtr createRefinementSurfaces const word scsFuncName = shapeDict.lookup("surfaceCellSizeFunction"); const dictionary& scsDict = - shapeDict.subDict(scsFuncName + "Coeffs"); + shapeDict.optionalSubDict(scsFuncName + "Coeffs"); const scalar surfaceCellSize = readScalar(scsDict.lookup("surfaceCellSizeCoeff")); diff --git a/applications/utilities/miscellaneous/foamList/Make/options b/applications/utilities/miscellaneous/foamList/Make/options index 1835b22397..96e74a80ac 100644 --- a/applications/utilities/miscellaneous/foamList/Make/options +++ b/applications/utilities/miscellaneous/foamList/Make/options @@ -28,7 +28,6 @@ EXE_LIBS = \ -lDSMC \ -ldynamicFvMesh \ -ldynamicMesh \ - -ledgeMesh \ -lengine \ -lextrudeModel \ -lfieldFunctionObjects \ diff --git a/applications/utilities/postProcessing/miscellaneous/pdfPlot/createFields.H b/applications/utilities/postProcessing/miscellaneous/pdfPlot/createFields.H index 767d626880..4fc525a3a9 100644 --- a/applications/utilities/postProcessing/miscellaneous/pdfPlot/createFields.H +++ b/applications/utilities/postProcessing/miscellaneous/pdfPlot/createFields.H @@ -22,9 +22,9 @@ cachedRandom rndGen(label(0), -1); - autoPtr p + autoPtr p ( - distributionModels::distributionModel::New + distributionModel::New ( pdfDictionary, rndGen diff --git a/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/tabulatedWallFunction/tabulatedWallFunction.C b/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/tabulatedWallFunction/tabulatedWallFunction.C index 9079b11941..aa881bdc9d 100644 --- a/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/tabulatedWallFunction/tabulatedWallFunction.C +++ b/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/tabulatedWallFunction/tabulatedWallFunction.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -49,7 +49,7 @@ Foam::tabulatedWallFunctions::tabulatedWallFunction::tabulatedWallFunction : dict_(dict), mesh_(mesh), - coeffDict_(dict.subDict(name + "Coeffs")), + coeffDict_(dict.optionalSubDict(name + "Coeffs")), invertedTableName_(dict.lookup("invertedTableName")), invertedTable_(invertedTableName_, mesh_, dict, true) {} diff --git a/applications/utilities/surface/surfaceBooleanFeatures/Make/options b/applications/utilities/surface/surfaceBooleanFeatures/Make/options index 4ff7ef8014..5a431f7d73 100644 --- a/applications/utilities/surface/surfaceBooleanFeatures/Make/options +++ b/applications/utilities/surface/surfaceBooleanFeatures/Make/options @@ -17,12 +17,10 @@ EXE_INC = \ $(COMP_FLAGS) \ -I$(FOAM_SRC)/surfMesh/lnInclude \ -I$(FOAM_SRC)/triSurface/lnInclude \ - -I$(LIB_SRC)/edgeMesh/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude EXE_LIBS = \ -lsurfMesh \ -ltriSurface \ - -ledgeMesh \ -lmeshTools \ $(LINK_FLAGS) diff --git a/applications/utilities/surface/surfaceFeatureConvert/Make/options b/applications/utilities/surface/surfaceFeatureConvert/Make/options index e71834f99e..54c035b8f5 100644 --- a/applications/utilities/surface/surfaceFeatureConvert/Make/options +++ b/applications/utilities/surface/surfaceFeatureConvert/Make/options @@ -1,7 +1,5 @@ EXE_INC = \ - -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/edgeMesh/lnInclude + -I$(LIB_SRC)/meshTools/lnInclude EXE_LIBS = \ - -lmeshTools \ - -ledgeMesh + -lmeshTools diff --git a/applications/utilities/surface/surfaceFeatureExtract/Make/options b/applications/utilities/surface/surfaceFeatureExtract/Make/options index b733d5fde9..e96fbb3687 100644 --- a/applications/utilities/surface/surfaceFeatureExtract/Make/options +++ b/applications/utilities/surface/surfaceFeatureExtract/Make/options @@ -1,13 +1,11 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/edgeMesh/lnInclude \ -I$(LIB_SRC)/triSurface/lnInclude \ -I$(LIB_SRC)/surfMesh/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude EXE_LIBS = \ -lmeshTools \ - -ledgeMesh \ -ltriSurface \ -lsampling diff --git a/applications/utilities/surface/surfaceLambdaMuSmooth/Make/options b/applications/utilities/surface/surfaceLambdaMuSmooth/Make/options index c35bf55e39..5ae72ebd31 100644 --- a/applications/utilities/surface/surfaceLambdaMuSmooth/Make/options +++ b/applications/utilities/surface/surfaceLambdaMuSmooth/Make/options @@ -1,7 +1,7 @@ EXE_INC = \ -I$(LIB_SRC)/surfMesh/lnInclude \ - -I$(LIB_SRC)/edgeMesh/lnInclude + -I$(LIB_SRC)/meshTools/lnInclude EXE_LIBS = \ - -ledgeMesh \ - -lsurfMesh + -lsurfMesh \ + -lmeshTools diff --git a/bin/foamNewApp b/bin/foamNewApp index b2f664817b..e960ea0b73 100755 --- a/bin/foamNewApp +++ b/bin/foamNewApp @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -62,9 +62,12 @@ esac [ -d "$1" ] && usage "$1 directory already exists, aborting..." NAME=$1 +YEAR=$(date +%Y) echo "Creating application code directory $NAME" && mkdir $NAME -sed "s#NAME#${NAME}#g" ${DIR}/app.C > $NAME/$NAME.C +sed -e "s#NAME#${NAME}#g" \ + -e "s#YEAR#${YEAR}#g" \ + ${DIR}/app.C > $NAME/$NAME.C echo "Creating Make subdirectory" && mkdir $NAME/Make sed "s#NAME#${NAME}#g" ${DIR}/Make/files > $NAME/Make/files diff --git a/bin/foamNewBC b/bin/foamNewBC index 26ac4fcc91..ceac666502 100755 --- a/bin/foamNewBC +++ b/bin/foamNewBC @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2015-2017 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -134,6 +134,7 @@ FVPATCHF=fvPatch$(cap $FIELD) CLASS=$NAME$(cap $FVPATCHF) PARENT=$BASE$(cap $FVPATCHF) CONSTRUCT=$(echo $CLASS | sed 's///g') +YEAR=$(date +%Y) # Create some example values for the Description n=0 @@ -155,6 +156,7 @@ do -e "s#NAME#${NAME}#g" \ -e "s#BASE#${BASE}#g" \ -e "s#CONSTRUCT#${CONSTRUCT}#g" \ + -e "s#YEAR#${YEAR}#g" \ -e "s#CLASS#${CLASS}#g" \ -e "s#FIELD#${FIELD}#g" \ -e "s#FVPATCHF#${FVPATCHF}#g" \ diff --git a/bin/foamNewFunctionObject b/bin/foamNewFunctionObject index a2f5d2bf20..2445537572 100755 --- a/bin/foamNewFunctionObject +++ b/bin/foamNewFunctionObject @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -66,12 +66,15 @@ esac [ -d "$1" ] && usage "$1 directory already exists, aborting..." NAME=$1 +YEAR=$(date +%Y) echo "Creating function object code directory $NAME" && mkdir $NAME for F in $(ls ${DIR}/*.*) do FILE=$(basename $F | sed "s#FUNCTIONOBJECT#${NAME}#g") - sed "s#FUNCTIONOBJECT#${NAME}#g" ${F} > ${NAME}/${FILE} + sed -e "s#FUNCTIONOBJECT#${NAME}#g" \ + -e "s#YEAR#${YEAR}#g" \ + ${F} > ${NAME}/${FILE} done echo "Creating Make subdirectory" && mkdir $NAME/Make diff --git a/etc/caseDicts/postProcessing/visualization/streamlines.cfg b/etc/caseDicts/postProcessing/visualization/streamlines.cfg index 64d4bd474c..10dc9dd144 100644 --- a/etc/caseDicts/postProcessing/visualization/streamlines.cfg +++ b/etc/caseDicts/postProcessing/visualization/streamlines.cfg @@ -19,8 +19,8 @@ lifeTime 10000; nSubCycle 5; cloudName particleTracks; -seedSampleSet uniform; -uniformCoeffs + +seedSampleSet { type uniform; axis x; diff --git a/etc/codeTemplates/BC/BC.C b/etc/codeTemplates/BC/BC.C index ced40005b3..d31c281a5f 100644 --- a/etc/codeTemplates/BC/BC.C +++ b/etc/codeTemplates/BC/BC.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) YEAR OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/etc/codeTemplates/BC/BC.H b/etc/codeTemplates/BC/BC.H index c878d68d9d..72f66462f6 100644 --- a/etc/codeTemplates/BC/BC.H +++ b/etc/codeTemplates/BC/BC.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) YEAR OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/etc/codeTemplates/BC/BCs.C b/etc/codeTemplates/BC/BCs.C index a0b084933a..b8b4642918 100644 --- a/etc/codeTemplates/BC/BCs.C +++ b/etc/codeTemplates/BC/BCs.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) YEAR OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/etc/codeTemplates/BC/BCs.H b/etc/codeTemplates/BC/BCs.H index bbd112ed9d..f32d209bbe 100644 --- a/etc/codeTemplates/BC/BCs.H +++ b/etc/codeTemplates/BC/BCs.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) YEAR OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/etc/codeTemplates/BC/BCsFwd.H b/etc/codeTemplates/BC/BCsFwd.H index 4c600dd7eb..2aeabb56ff 100644 --- a/etc/codeTemplates/BC/BCsFwd.H +++ b/etc/codeTemplates/BC/BCsFwd.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) YEAR OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/etc/codeTemplates/app/app.C b/etc/codeTemplates/app/app.C index 2ed97537f6..0b765eb1e2 100644 --- a/etc/codeTemplates/app/app.C +++ b/etc/codeTemplates/app/app.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) YEAR OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/etc/codeTemplates/dynamicCode/codeStreamTemplate.C b/etc/codeTemplates/dynamicCode/codeStreamTemplate.C index 5d69d99632..58671e5876 100644 --- a/etc/codeTemplates/dynamicCode/codeStreamTemplate.C +++ b/etc/codeTemplates/dynamicCode/codeStreamTemplate.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) YEAR OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/etc/codeTemplates/dynamicCode/codedFvOptionTemplate.C b/etc/codeTemplates/dynamicCode/codedFvOptionTemplate.C index 6cb5cc0d7b..046412bd68 100644 --- a/etc/codeTemplates/dynamicCode/codedFvOptionTemplate.C +++ b/etc/codeTemplates/dynamicCode/codedFvOptionTemplate.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) YEAR OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/etc/codeTemplates/dynamicCode/codedFvOptionTemplate.H b/etc/codeTemplates/dynamicCode/codedFvOptionTemplate.H index a30727ccb6..a25fe3d30d 100644 --- a/etc/codeTemplates/dynamicCode/codedFvOptionTemplate.H +++ b/etc/codeTemplates/dynamicCode/codedFvOptionTemplate.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) YEAR OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/etc/codeTemplates/dynamicCode/fixedValueFvPatchFieldTemplate.C b/etc/codeTemplates/dynamicCode/fixedValueFvPatchFieldTemplate.C index c7f442f03a..e0a3943411 100644 --- a/etc/codeTemplates/dynamicCode/fixedValueFvPatchFieldTemplate.C +++ b/etc/codeTemplates/dynamicCode/fixedValueFvPatchFieldTemplate.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) YEAR OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/etc/codeTemplates/dynamicCode/fixedValueFvPatchFieldTemplate.H b/etc/codeTemplates/dynamicCode/fixedValueFvPatchFieldTemplate.H index 6026fe1256..468ef1326c 100644 --- a/etc/codeTemplates/dynamicCode/fixedValueFvPatchFieldTemplate.H +++ b/etc/codeTemplates/dynamicCode/fixedValueFvPatchFieldTemplate.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) YEAR OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/etc/codeTemplates/dynamicCode/fixedValuePointPatchFieldTemplate.C b/etc/codeTemplates/dynamicCode/fixedValuePointPatchFieldTemplate.C index f474cbbd73..c1cc7e66c9 100644 --- a/etc/codeTemplates/dynamicCode/fixedValuePointPatchFieldTemplate.C +++ b/etc/codeTemplates/dynamicCode/fixedValuePointPatchFieldTemplate.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) YEAR OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/etc/codeTemplates/dynamicCode/fixedValuePointPatchFieldTemplate.H b/etc/codeTemplates/dynamicCode/fixedValuePointPatchFieldTemplate.H index bbb46269ff..ce92b09fb2 100644 --- a/etc/codeTemplates/dynamicCode/fixedValuePointPatchFieldTemplate.H +++ b/etc/codeTemplates/dynamicCode/fixedValuePointPatchFieldTemplate.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) YEAR OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/etc/codeTemplates/dynamicCode/functionObjectTemplate.C b/etc/codeTemplates/dynamicCode/functionObjectTemplate.C index 4df4117cdd..b2d65aad5d 100644 --- a/etc/codeTemplates/dynamicCode/functionObjectTemplate.C +++ b/etc/codeTemplates/dynamicCode/functionObjectTemplate.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) YEAR OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/etc/codeTemplates/dynamicCode/functionObjectTemplate.H b/etc/codeTemplates/dynamicCode/functionObjectTemplate.H index a20a40120f..bd2580a9be 100644 --- a/etc/codeTemplates/dynamicCode/functionObjectTemplate.H +++ b/etc/codeTemplates/dynamicCode/functionObjectTemplate.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) YEAR OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/etc/codeTemplates/dynamicCode/mixedFvPatchFieldTemplate.C b/etc/codeTemplates/dynamicCode/mixedFvPatchFieldTemplate.C index ab2f100f3e..651ee6018a 100644 --- a/etc/codeTemplates/dynamicCode/mixedFvPatchFieldTemplate.C +++ b/etc/codeTemplates/dynamicCode/mixedFvPatchFieldTemplate.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) YEAR OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/etc/codeTemplates/dynamicCode/mixedFvPatchFieldTemplate.H b/etc/codeTemplates/dynamicCode/mixedFvPatchFieldTemplate.H index 129fb534dd..cb59d0a1f5 100644 --- a/etc/codeTemplates/dynamicCode/mixedFvPatchFieldTemplate.H +++ b/etc/codeTemplates/dynamicCode/mixedFvPatchFieldTemplate.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) YEAR OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/etc/codeTemplates/foamScript b/etc/codeTemplates/foamScript index 0c30f33715..48cc73bb5c 100755 --- a/etc/codeTemplates/foamScript +++ b/etc/codeTemplates/foamScript @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation +# \\ / A nd | Copyright (C) YEAR OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------ # License diff --git a/etc/codeTemplates/functionObject/FUNCTIONOBJECT.C b/etc/codeTemplates/functionObject/FUNCTIONOBJECT.C index 68c84dfe7d..5318dbead7 100644 --- a/etc/codeTemplates/functionObject/FUNCTIONOBJECT.C +++ b/etc/codeTemplates/functionObject/FUNCTIONOBJECT.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) YEAR OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/etc/codeTemplates/functionObject/FUNCTIONOBJECT.H b/etc/codeTemplates/functionObject/FUNCTIONOBJECT.H index 2a2dfd07cc..dc3a3edb2f 100644 --- a/etc/codeTemplates/functionObject/FUNCTIONOBJECT.H +++ b/etc/codeTemplates/functionObject/FUNCTIONOBJECT.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) YEAR OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/etc/codeTemplates/source/_Template.C b/etc/codeTemplates/source/_Template.C index 6812cbdf16..3d6f46ded1 100644 --- a/etc/codeTemplates/source/_Template.C +++ b/etc/codeTemplates/source/_Template.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) YEAR OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/etc/codeTemplates/source/_Template.H b/etc/codeTemplates/source/_Template.H index d2cbe47d0b..df90d5e4fe 100644 --- a/etc/codeTemplates/source/_Template.H +++ b/etc/codeTemplates/source/_Template.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) YEAR OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/etc/codeTemplates/source/_TemplateApp.C b/etc/codeTemplates/source/_TemplateApp.C index 80c562cbdb..aa6efc53f7 100644 --- a/etc/codeTemplates/source/_TemplateApp.C +++ b/etc/codeTemplates/source/_TemplateApp.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) YEAR OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/etc/codeTemplates/source/_TemplateI.H b/etc/codeTemplates/source/_TemplateI.H index eca8d9ea3b..dd1ba9ecf1 100644 --- a/etc/codeTemplates/source/_TemplateI.H +++ b/etc/codeTemplates/source/_TemplateI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) YEAR OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/etc/codeTemplates/source/_TemplateIO.C b/etc/codeTemplates/source/_TemplateIO.C index d07fc0d3f3..f1e498671e 100644 --- a/etc/codeTemplates/source/_TemplateIO.C +++ b/etc/codeTemplates/source/_TemplateIO.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) YEAR OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/etc/codeTemplates/source/foamNewSource b/etc/codeTemplates/source/foamNewSource index 0a9c1b91af..ae6d547141 100755 --- a/etc/codeTemplates/source/foamNewSource +++ b/etc/codeTemplates/source/foamNewSource @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -104,7 +104,9 @@ else fi # process class name - sed "s/CLASSNAME/$className/g" $Template$subType$Type > $fileName + sed -e "s/CLASSNAME/$className/g" \ + -e "s/YEAR/$(date +%Y)/g" \ + $Template$subType$Type > $fileName if [ "$subType" = App -a ! -d Make ] then diff --git a/etc/codeTemplates/template/_TemplateTemplate.C b/etc/codeTemplates/template/_TemplateTemplate.C index 63b895032b..2f733dfc3f 100644 --- a/etc/codeTemplates/template/_TemplateTemplate.C +++ b/etc/codeTemplates/template/_TemplateTemplate.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) YEAR OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/etc/codeTemplates/template/_TemplateTemplate.H b/etc/codeTemplates/template/_TemplateTemplate.H index 12e5511b73..ad98aca4af 100644 --- a/etc/codeTemplates/template/_TemplateTemplate.H +++ b/etc/codeTemplates/template/_TemplateTemplate.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) YEAR OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/etc/codeTemplates/template/_TemplateTemplateI.H b/etc/codeTemplates/template/_TemplateTemplateI.H index eca8d9ea3b..dd1ba9ecf1 100644 --- a/etc/codeTemplates/template/_TemplateTemplateI.H +++ b/etc/codeTemplates/template/_TemplateTemplateI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) YEAR OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/etc/codeTemplates/template/_TemplateTemplateIO.C b/etc/codeTemplates/template/_TemplateTemplateIO.C index c60b5be8b8..05921c9645 100644 --- a/etc/codeTemplates/template/_TemplateTemplateIO.C +++ b/etc/codeTemplates/template/_TemplateTemplateIO.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) YEAR OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/etc/codeTemplates/template/foamNewTemplate b/etc/codeTemplates/template/foamNewTemplate index dfc2e13375..a85be23b50 100755 --- a/etc/codeTemplates/template/foamNewTemplate +++ b/etc/codeTemplates/template/foamNewTemplate @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -106,7 +106,9 @@ else # process class name - sed -e "s/CLASSNAME/$className/g" $Template$Type > $fileName.1 + sed -e "s/CLASSNAME/$className/g" \ + -e "s/YEAR/$(date +%Y)/g" \ + $Template$Type > $fileName.1 # process remaining (template) arguments diff --git a/etc/controlDict b/etc/controlDict index 38ebd71b95..a0151fc0bd 100644 --- a/etc/controlDict +++ b/etc/controlDict @@ -855,7 +855,6 @@ DebugSwitches triSurface 0; triSurfaceMesh 0; turbulenceModel 0; - turbulentHeatFluxTemperature 0; turbulentInlet 0; turbulentIntensityKineticEnergyInlet 0; turbulentMixingLengthDissipationRateInlet 0; diff --git a/etc/templates/closedVolume/system/snappyHexMeshDict b/etc/templates/closedVolume/system/snappyHexMeshDict index f7927ca2c3..74f9cae76a 100644 --- a/etc/templates/closedVolume/system/snappyHexMeshDict +++ b/etc/templates/closedVolume/system/snappyHexMeshDict @@ -60,6 +60,7 @@ castellatedMeshControls locationInMesh (1e-5 1e-5 1e-5); // Offset from (0 0 0) to avoid // coinciding with face or edge + nCellsBetweenLevels 3; } snapControls diff --git a/etc/templates/closedVolumeRotating/README b/etc/templates/closedVolumeRotating/README index 693cee7bd9..79c0fbf857 100644 --- a/etc/templates/closedVolumeRotating/README +++ b/etc/templates/closedVolumeRotating/README @@ -2,6 +2,61 @@ Overview ======== + Template case for rotating geometry flow for a closed geometry + Can be used for MRF or AMI simulations -+ Setup to run the simpleFoam solver -+ Set up is like inflowOutflowRotating but without inlet and outlet -+ See $FOAM_ETC/templates/closedVolume/README for details of use \ No newline at end of file ++ Setup to run the simpleFoam solver for MRF, pimpleDyMFoam for AMI ++ The case is designed to be meshed with snappyHexMesh ++ snappyHexMesh is setup to use 3 trisurface files + + fixed.obj: CAD of the stationary geometry + + rotating.obj: CAD of the rotating geometry + + rotatingZone.obj: CAD of surface bounding the rotating region ++ Copy the *.obj files to the constant/triSurface directory ++ The fixed.obj should contain an inlet and outlet region to create the relevant + patches in the mesh + +Background Mesh +=============== ++ The blockMeshDict file contains a configuration for a cylindrical background + mesh aligned along the z-axis ++ The mesh includes a core box-shaped block and inner and outer cylinders ++ The backgroundMesh subdictionary includes key geometric parameters of the mesh ++ The inner cylinder relates to the rotatingZone.obj ++ The outer cyliner relates to the external boundary, e.g. fixed.obj ++ Set the radii of inner and outer cylinders to ~2% larger than respective OBJ + files ++ Set background mesh density with boxCells, inCells, outCells and zCells ++ Run blockMesh ++ NOTE: An alternative blockMeshDict-box file exists if the user wants a regular + box-shaped background mesh, similar to set up in the inflowOutflow template + +Features +======== ++ Run surfaceFeatureExtract to extract features for explicit feature capturing + +Castellated Mesh +================ ++ run snappyHexMesh to obtain a castellatedMesh ++ Review the mesh; modify refinement levels and regenerate the mesh as required + (levels are set in refinementSurfaces and refinementRegions) + +Snapped Mesh +============ ++ In snappyHexMeshDict, set castellatedMesh off; snap on; ++ Run the snapping phase of snappyHexMesh ++ Review the mesh + +Layers +====== ++ To add layers to the mesh along wall boundary patches... ++ Switch on addLayers; switch snap off; ++ Run snappyHexMesh ++ The number of layers can be changed by modifying nSurfaceLayers + +Initialisation +============== ++ Initialise the field files in the 0 directory ++ Set the viscosity in constant/transportProperties ++ Rotating properties are set in constant/rotatingZoneProperties + + For MRF, this file is included from system/fvOptions + + For AMI, this file is included from constant/dynamicMeshDict ++ Ensure settings are appropriate in controlDict, fvSchemes, fvSolution, for + relevant simulation; for AMI, in particular, ensure that deltaT, ddtSchemes + and relaxationFactors are set for transient simulation diff --git a/etc/templates/closedVolumeRotating/system/blockMeshDict b/etc/templates/closedVolumeRotating/system/blockMeshDict index 273d50fad2..b7f0c57061 100644 --- a/etc/templates/closedVolumeRotating/system/blockMeshDict +++ b/etc/templates/closedVolumeRotating/system/blockMeshDict @@ -14,47 +14,175 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Example configuration: +// - Cylindrical mesh along z-axis (0 < z < 10) +// - External boundary (fixed.obj) radius = 3 +// - Rotating zone (rotatingZone.obj) radius = 1 + backgroundMesh { - xMin -1; - xMax 1; - yMin -1; - yMax 1; - zMin -1; - zMax 1; - xCells 20; - yCells 20; - zCells 20; + radOut 3.06; // larger than fixed.obj by ~ 1/cos(45/boxCells) + radOutN -3.06; + radIn 1.02; // larger than rotatingZone.obj (see above) + radInN -1.02; + radBox 0.30; // ~30% of rotatingZone.obj + radBoxN -0.30; + + zMin 0; + zMax 10; // External boundary axial length + + boxCells 5; // Cells across inner box-shaped block + inCells 5; // Cells in radial direction, inner cylinder + outCells 8; // Cells in radial direction, outer cylinder + zCells 50; // Cells in axial direction + + outGrading 2.0; // Expansion ratio in outer region, radial direction +} + +geometry +{ + rotatingZone + { + type searchableCylinder; + point1 (0 0 -100); + point2 (0 0 100); + radius $:backgroundMesh.radIn; + } + + fixed + { + type searchableCylinder; + point1 (0 0 -100); + point2 (0 0 100); + radius $:backgroundMesh.radOut; + } } convertToMeters 1; vertices ( - ($:backgroundMesh.xMin $:backgroundMesh.yMin $:backgroundMesh.zMin) - ($:backgroundMesh.xMax $:backgroundMesh.yMin $:backgroundMesh.zMin) - ($:backgroundMesh.xMax $:backgroundMesh.yMax $:backgroundMesh.zMin) - ($:backgroundMesh.xMin $:backgroundMesh.yMax $:backgroundMesh.zMin) + ($:backgroundMesh.radBoxN $:backgroundMesh.radBoxN $:backgroundMesh.zMin) + ($:backgroundMesh.radBox $:backgroundMesh.radBoxN $:backgroundMesh.zMin) + ($:backgroundMesh.radBox $:backgroundMesh.radBox $:backgroundMesh.zMin) + ($:backgroundMesh.radBoxN $:backgroundMesh.radBox $:backgroundMesh.zMin) - ($:backgroundMesh.xMin $:backgroundMesh.yMin $:backgroundMesh.zMax) - ($:backgroundMesh.xMax $:backgroundMesh.yMin $:backgroundMesh.zMax) - ($:backgroundMesh.xMax $:backgroundMesh.yMax $:backgroundMesh.zMax) - ($:backgroundMesh.xMin $:backgroundMesh.yMax $:backgroundMesh.zMax) + project + ($:backgroundMesh.radInN $:backgroundMesh.radInN $:backgroundMesh.zMin) + (rotatingZone) + + project + ($:backgroundMesh.radIn $:backgroundMesh.radInN $:backgroundMesh.zMin) + (rotatingZone) + + project + ($:backgroundMesh.radIn $:backgroundMesh.radIn $:backgroundMesh.zMin) + (rotatingZone) + + project + ($:backgroundMesh.radInN $:backgroundMesh.radIn $:backgroundMesh.zMin) + (rotatingZone) + + project + ($:backgroundMesh.radOutN $:backgroundMesh.radOutN $:backgroundMesh.zMin) + (fixed) + + project + ($:backgroundMesh.radOut $:backgroundMesh.radOutN $:backgroundMesh.zMin) + (fixed) + + project + ($:backgroundMesh.radOut $:backgroundMesh.radOut $:backgroundMesh.zMin) + (fixed) + + project + ($:backgroundMesh.radOutN $:backgroundMesh.radOut $:backgroundMesh.zMin) + (fixed) + + ($:backgroundMesh.radBoxN $:backgroundMesh.radBoxN $:backgroundMesh.zMax) + ($:backgroundMesh.radBox $:backgroundMesh.radBoxN $:backgroundMesh.zMax) + ($:backgroundMesh.radBox $:backgroundMesh.radBox $:backgroundMesh.zMax) + ($:backgroundMesh.radBoxN $:backgroundMesh.radBox $:backgroundMesh.zMax) + + project + ($:backgroundMesh.radInN $:backgroundMesh.radInN $:backgroundMesh.zMax) + (rotatingZone) + + project + ($:backgroundMesh.radIn $:backgroundMesh.radInN $:backgroundMesh.zMax) + (rotatingZone) + + project + ($:backgroundMesh.radIn $:backgroundMesh.radIn $:backgroundMesh.zMax) + (rotatingZone) + + project + ($:backgroundMesh.radInN $:backgroundMesh.radIn $:backgroundMesh.zMax) + (rotatingZone) + + project + ($:backgroundMesh.radOutN $:backgroundMesh.radOutN $:backgroundMesh.zMax) + (fixed) + + project + ($:backgroundMesh.radOut $:backgroundMesh.radOutN $:backgroundMesh.zMax) + (fixed) + + project + ($:backgroundMesh.radOut $:backgroundMesh.radOut $:backgroundMesh.zMax) + (fixed) + + project + ($:backgroundMesh.radOutN $:backgroundMesh.radOut $:backgroundMesh.zMax) + (fixed) ); +boxMesh +($:backgroundMesh.boxCells $:backgroundMesh.boxCells $:backgroundMesh.zCells) +simpleGrading (1 1 1); + +inMesh +($:backgroundMesh.boxCells $:backgroundMesh.inCells $:backgroundMesh.zCells) +simpleGrading (1 1 1); + +outMesh +($:backgroundMesh.boxCells $:backgroundMesh.outCells $:backgroundMesh.zCells) +simpleGrading (1 $:backgroundMesh.outGrading 1); + blocks ( - hex (0 1 2 3 4 5 6 7) - ( - $:backgroundMesh.xCells - $:backgroundMesh.yCells - $:backgroundMesh.zCells - ) - simpleGrading (1 1 1) + hex (0 1 2 3 12 13 14 15) $boxMesh + + hex (1 0 4 5 13 12 16 17) $inMesh + hex (0 3 7 4 12 15 19 16) $inMesh + hex (2 1 5 6 14 13 17 18) $inMesh + hex (3 2 6 7 15 14 18 19) $inMesh + + hex (5 4 8 9 17 16 20 21) $outMesh + hex (4 7 11 8 16 19 23 20) $outMesh + hex (6 5 9 10 18 17 21 22) $outMesh + hex (7 6 10 11 19 18 22 23) $outMesh ); edges ( + project 4 5 (rotatingZone) + project 5 6 (rotatingZone) + project 6 7 (rotatingZone) + project 7 4 (rotatingZone) + project 16 17 (rotatingZone) + project 17 18 (rotatingZone) + project 18 19 (rotatingZone) + project 19 16 (rotatingZone) + + project 8 9 (fixed) + project 9 10 (fixed) + project 10 11 (fixed) + project 11 8 (fixed) + project 20 21 (fixed) + project 21 22 (fixed) + project 22 23 (fixed) + project 23 20 (fixed) ); boundary diff --git a/etc/templates/inflowOutflow/system/blockMeshDict.extPatches b/etc/templates/closedVolumeRotating/system/blockMeshDict-box similarity index 75% rename from etc/templates/inflowOutflow/system/blockMeshDict.extPatches rename to etc/templates/closedVolumeRotating/system/blockMeshDict-box index dbba64bbb9..273d50fad2 100644 --- a/etc/templates/inflowOutflow/system/blockMeshDict.extPatches +++ b/etc/templates/closedVolumeRotating/system/blockMeshDict-box @@ -59,59 +59,6 @@ edges boundary ( - left - { - type patch; - faces - ( - (0 3 7 4) - ); - } - - right - { - type patch; - faces - ( - (1 5 6 2) - ); - } - - bottom - { - type patch; - faces - ( - (0 1 2 3) - ); - } - - top - { - type patch; - faces - ( - (4 7 6 5) - ); - } - - back - { - type patch; - faces - ( - (0 4 5 1) - ); - } - - front - { - type patch; - faces - ( - (3 2 6 7) - ); - } ); mergePatchPairs diff --git a/etc/templates/closedVolumeRotating/system/snappyHexMeshDict b/etc/templates/closedVolumeRotating/system/snappyHexMeshDict index c31ea01666..115ce5b103 100644 --- a/etc/templates/closedVolumeRotating/system/snappyHexMeshDict +++ b/etc/templates/closedVolumeRotating/system/snappyHexMeshDict @@ -83,11 +83,13 @@ castellatedMeshControls locationInMesh (1e-5 1e-5 1e-5); // Offset from (0 0 0) to avoid // coinciding with face or edge + nCellsBetweenLevels 3; } snapControls { explicitFeatureSnap true; + implicitFeatureSnap false; } addLayersControls diff --git a/etc/templates/compressibleInflowOutflow/README b/etc/templates/compressibleInflowOutflow/README index 780ced0069..3500e5e16e 100644 --- a/etc/templates/compressibleInflowOutflow/README +++ b/etc/templates/compressibleInflowOutflow/README @@ -12,19 +12,13 @@ Background Mesh =============== + The user should establish the bounds of their CAD.obj file + The blockMeshDict file contains a backgroundMesh subditionary -+ Set xMin, xMax, etc to be beyond the CAD.obj bounds ++ For internal flows, where CAD.obj describes the external boundary, set xMin, + xMax, etc to be beyond the CAD.obj bounds ++ For external flows, the background mesh can define the external boundary by + uncommenting entries, e.g. left, in the boundary section of blockMeshDict + Set background mesh density with xCells, yCells, zCells + Run blockMesh -Background Mesh (alternative) -============================= -+ The user can adopt the background mesh patches in the mesh -+ For example, the background mesh can provide external patches of an external - flow -+ An alternative blockMeshDict file is set up for this: blockMeshDict.extPatches -+ Simply copy blockMeshDict.extPatches to blockMeshDict and edit inlet, outlet - patches accordingly - Castellated Mesh ================ + In the snappyHexMeshDict file, replace with the name of the inlet diff --git a/etc/templates/compressibleInflowOutflow/system/blockMeshDict b/etc/templates/compressibleInflowOutflow/system/blockMeshDict index 273d50fad2..a761d4fecb 100644 --- a/etc/templates/compressibleInflowOutflow/system/blockMeshDict +++ b/etc/templates/compressibleInflowOutflow/system/blockMeshDict @@ -59,6 +59,62 @@ edges boundary ( +// Uncomment below to define patches in background mesh +/* + left + { + type patch; + faces + ( + (0 3 7 4) + ); + } + + right + { + type patch; + faces + ( + (1 5 6 2) + ); + } + + bottom + { + type patch; + faces + ( + (0 1 2 3) + ); + } + + top + { + type patch; + faces + ( + (4 7 6 5) + ); + } + + back + { + type patch; + faces + ( + (0 4 5 1) + ); + } + + front + { + type patch; + faces + ( + (3 2 6 7) + ); + } +*/ ); mergePatchPairs diff --git a/etc/templates/compressibleInflowOutflow/system/snappyHexMeshDict b/etc/templates/compressibleInflowOutflow/system/snappyHexMeshDict index c8abb26721..0d578833f0 100644 --- a/etc/templates/compressibleInflowOutflow/system/snappyHexMeshDict +++ b/etc/templates/compressibleInflowOutflow/system/snappyHexMeshDict @@ -84,6 +84,7 @@ castellatedMeshControls locationInMesh (1e-5 1e-5 1e-5); // Offset from (0 0 0) to avoid // coinciding with face or edge + nCellsBetweenLevels 3; } snapControls diff --git a/etc/templates/inflowOutflow/README b/etc/templates/inflowOutflow/README index 3cac200bdc..7c2252a7ad 100644 --- a/etc/templates/inflowOutflow/README +++ b/etc/templates/inflowOutflow/README @@ -12,19 +12,13 @@ Background Mesh =============== + The user should establish the bounds of their CAD.obj file + The blockMeshDict file contains a backgroundMesh subditionary -+ Set xMin, xMax, etc to be beyond the CAD.obj bounds ++ For internal flows, where CAD.obj describes the external boundary, set xMin, + xMax, etc to be beyond the CAD.obj bounds ++ For external flows, the background mesh can define the external boundary by + uncommenting entries, e.g. left, in the boundary section of blockMeshDict + Set background mesh density with xCells, yCells, zCells + Run blockMesh -Background Mesh (alternative) -============================= -+ The user can adopt the background mesh patches in the mesh -+ For example, the background mesh can provide external patches of an external - flow -+ An alternative blockMeshDict file is set up for this: blockMeshDict.extPatches -+ Simply copy blockMeshDict.extPatches to blockMeshDict and edit inlet, outlet - patches accordingly - Castellated Mesh ================ + In the snappyHexMeshDict file, replace with the name of the inlet diff --git a/etc/templates/inflowOutflow/system/blockMeshDict b/etc/templates/inflowOutflow/system/blockMeshDict index 273d50fad2..a761d4fecb 100644 --- a/etc/templates/inflowOutflow/system/blockMeshDict +++ b/etc/templates/inflowOutflow/system/blockMeshDict @@ -59,6 +59,62 @@ edges boundary ( +// Uncomment below to define patches in background mesh +/* + left + { + type patch; + faces + ( + (0 3 7 4) + ); + } + + right + { + type patch; + faces + ( + (1 5 6 2) + ); + } + + bottom + { + type patch; + faces + ( + (0 1 2 3) + ); + } + + top + { + type patch; + faces + ( + (4 7 6 5) + ); + } + + back + { + type patch; + faces + ( + (0 4 5 1) + ); + } + + front + { + type patch; + faces + ( + (3 2 6 7) + ); + } +*/ ); mergePatchPairs diff --git a/etc/templates/inflowOutflow/system/snappyHexMeshDict b/etc/templates/inflowOutflow/system/snappyHexMeshDict index c8abb26721..0d578833f0 100644 --- a/etc/templates/inflowOutflow/system/snappyHexMeshDict +++ b/etc/templates/inflowOutflow/system/snappyHexMeshDict @@ -84,6 +84,7 @@ castellatedMeshControls locationInMesh (1e-5 1e-5 1e-5); // Offset from (0 0 0) to avoid // coinciding with face or edge + nCellsBetweenLevels 3; } snapControls diff --git a/etc/templates/inflowOutflowRotating/0/U b/etc/templates/inflowOutflowRotating/0/U index 159fe22463..e57a3d9a6d 100644 --- a/etc/templates/inflowOutflowRotating/0/U +++ b/etc/templates/inflowOutflowRotating/0/U @@ -14,7 +14,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -Uinlet (10 0 0); +Uinlet (0 0 10); dimensions [0 1 -1 0 0 0 0]; diff --git a/etc/templates/inflowOutflowRotating/README b/etc/templates/inflowOutflowRotating/README index b1b05eeb42..250b5a3312 100644 --- a/etc/templates/inflowOutflowRotating/README +++ b/etc/templates/inflowOutflowRotating/README @@ -12,12 +12,48 @@ Overview + The fixed.obj should contain an inlet and outlet region to create the relevant patches in the mesh -Meshing -======= -+ Meshing is setup as in the inflowOutflow template -+ See $FOAM_ETC/templates/inflowOutflow/README for details -+ For AMI, the AMI interface can be set up by running createBaffles which uses - the createBafflesDict file +Background Mesh +=============== ++ The blockMeshDict file contains a configuration for a cylindrical background + mesh aligned along the z-axis ++ The mesh includes a core box-shaped block and inner and outer cylinders ++ The backgroundMesh subdictionary includes key geometric parameters of the mesh ++ The inner cylinder relates to the rotatingZone.obj ++ The outer cyliner relates to the external boundary, e.g. fixed.obj ++ Set the radii of inner and outer cylinders to ~2% larger than respective OBJ + files ++ The background mesh can define the external boundary by uncommenting + entries, e.g. inlet, in the boundary section of blockMeshDict ++ Set background mesh density with boxCells, inCells, outCells and zCells ++ Run blockMesh ++ NOTE: An alternative blockMeshDict-box file exists if the user wants a regular + box-shaped background mesh, similar to set up in the inflowOutflow template + +Features +======== ++ Run surfaceFeatureExtract to extract features for explicit feature capturing + +Castellated Mesh +================ ++ In the snappyHexMeshDict file, replace with the name of the inlet + region in the fixed.obj file, if it defines the external boundary ++ Replace with the name of the outlet region ++ run snappyHexMesh to obtain a castellatedMesh ++ Review the mesh; modify refinement levels and regenerate the mesh as required + (levels are set in refinementSurfaces and refinementRegions) + +Snapped Mesh +============ ++ In snappyHexMeshDict, set castellatedMesh off; snap on; ++ Run the snapping phase of snappyHexMesh ++ Review the mesh + +Layers +====== ++ To add layers to the mesh along wall boundary patches... ++ Switch on addLayers; switch snap off; ++ Run snappyHexMesh ++ The number of layers can be changed by modifying nSurfaceLayers Initialisation ============== diff --git a/etc/templates/inflowOutflowRotating/system/blockMeshDict b/etc/templates/inflowOutflowRotating/system/blockMeshDict index 273d50fad2..6de435522b 100644 --- a/etc/templates/inflowOutflowRotating/system/blockMeshDict +++ b/etc/templates/inflowOutflowRotating/system/blockMeshDict @@ -14,51 +14,227 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Example configuration: +// - Cylindrical mesh along z-axis (0 < z < 10) +// - External boundary (fixed.obj) radius = 3 +// - Rotating zone (rotatingZone.obj) radius = 1 + backgroundMesh { - xMin -1; - xMax 1; - yMin -1; - yMax 1; - zMin -1; - zMax 1; - xCells 20; - yCells 20; - zCells 20; + radOut 3.06; // larger than fixed.obj by ~ 1/cos(45/boxCells) + radOutN -3.06; + radIn 1.02; // larger than rotatingZone.obj (see above) + radInN -1.02; + radBox 0.30; // ~30% of rotatingZone.obj + radBoxN -0.30; + + zMin 0; + zMax 10; // External boundary axial length + + boxCells 5; // Cells across inner box-shaped block + inCells 5; // Cells in radial direction, inner cylinder + outCells 8; // Cells in radial direction, outer cylinder + zCells 50; // Cells in axial direction + + outGrading 2.0; // Expansion ratio in outer region, radial direction +} + +geometry +{ + rotatingZone + { + type searchableCylinder; + point1 (0 0 -100); + point2 (0 0 100); + radius $:backgroundMesh.radIn; + } + + fixed + { + type searchableCylinder; + point1 (0 0 -100); + point2 (0 0 100); + radius $:backgroundMesh.radOut; + } } convertToMeters 1; vertices ( - ($:backgroundMesh.xMin $:backgroundMesh.yMin $:backgroundMesh.zMin) - ($:backgroundMesh.xMax $:backgroundMesh.yMin $:backgroundMesh.zMin) - ($:backgroundMesh.xMax $:backgroundMesh.yMax $:backgroundMesh.zMin) - ($:backgroundMesh.xMin $:backgroundMesh.yMax $:backgroundMesh.zMin) + ($:backgroundMesh.radBoxN $:backgroundMesh.radBoxN $:backgroundMesh.zMin) + ($:backgroundMesh.radBox $:backgroundMesh.radBoxN $:backgroundMesh.zMin) + ($:backgroundMesh.radBox $:backgroundMesh.radBox $:backgroundMesh.zMin) + ($:backgroundMesh.radBoxN $:backgroundMesh.radBox $:backgroundMesh.zMin) - ($:backgroundMesh.xMin $:backgroundMesh.yMin $:backgroundMesh.zMax) - ($:backgroundMesh.xMax $:backgroundMesh.yMin $:backgroundMesh.zMax) - ($:backgroundMesh.xMax $:backgroundMesh.yMax $:backgroundMesh.zMax) - ($:backgroundMesh.xMin $:backgroundMesh.yMax $:backgroundMesh.zMax) + project + ($:backgroundMesh.radInN $:backgroundMesh.radInN $:backgroundMesh.zMin) + (rotatingZone) + + project + ($:backgroundMesh.radIn $:backgroundMesh.radInN $:backgroundMesh.zMin) + (rotatingZone) + + project + ($:backgroundMesh.radIn $:backgroundMesh.radIn $:backgroundMesh.zMin) + (rotatingZone) + + project + ($:backgroundMesh.radInN $:backgroundMesh.radIn $:backgroundMesh.zMin) + (rotatingZone) + + project + ($:backgroundMesh.radOutN $:backgroundMesh.radOutN $:backgroundMesh.zMin) + (fixed) + + project + ($:backgroundMesh.radOut $:backgroundMesh.radOutN $:backgroundMesh.zMin) + (fixed) + + project + ($:backgroundMesh.radOut $:backgroundMesh.radOut $:backgroundMesh.zMin) + (fixed) + + project + ($:backgroundMesh.radOutN $:backgroundMesh.radOut $:backgroundMesh.zMin) + (fixed) + + ($:backgroundMesh.radBoxN $:backgroundMesh.radBoxN $:backgroundMesh.zMax) + ($:backgroundMesh.radBox $:backgroundMesh.radBoxN $:backgroundMesh.zMax) + ($:backgroundMesh.radBox $:backgroundMesh.radBox $:backgroundMesh.zMax) + ($:backgroundMesh.radBoxN $:backgroundMesh.radBox $:backgroundMesh.zMax) + + project + ($:backgroundMesh.radInN $:backgroundMesh.radInN $:backgroundMesh.zMax) + (rotatingZone) + + project + ($:backgroundMesh.radIn $:backgroundMesh.radInN $:backgroundMesh.zMax) + (rotatingZone) + + project + ($:backgroundMesh.radIn $:backgroundMesh.radIn $:backgroundMesh.zMax) + (rotatingZone) + + project + ($:backgroundMesh.radInN $:backgroundMesh.radIn $:backgroundMesh.zMax) + (rotatingZone) + + project + ($:backgroundMesh.radOutN $:backgroundMesh.radOutN $:backgroundMesh.zMax) + (fixed) + + project + ($:backgroundMesh.radOut $:backgroundMesh.radOutN $:backgroundMesh.zMax) + (fixed) + + project + ($:backgroundMesh.radOut $:backgroundMesh.radOut $:backgroundMesh.zMax) + (fixed) + + project + ($:backgroundMesh.radOutN $:backgroundMesh.radOut $:backgroundMesh.zMax) + (fixed) ); +boxMesh +($:backgroundMesh.boxCells $:backgroundMesh.boxCells $:backgroundMesh.zCells) +simpleGrading (1 1 1); + +inMesh +($:backgroundMesh.boxCells $:backgroundMesh.inCells $:backgroundMesh.zCells) +simpleGrading (1 1 1); + +outMesh +($:backgroundMesh.boxCells $:backgroundMesh.outCells $:backgroundMesh.zCells) +simpleGrading (1 $:backgroundMesh.outGrading 1); + blocks ( - hex (0 1 2 3 4 5 6 7) - ( - $:backgroundMesh.xCells - $:backgroundMesh.yCells - $:backgroundMesh.zCells - ) - simpleGrading (1 1 1) + hex (0 1 2 3 12 13 14 15) $boxMesh + + hex (1 0 4 5 13 12 16 17) $inMesh + hex (0 3 7 4 12 15 19 16) $inMesh + hex (2 1 5 6 14 13 17 18) $inMesh + hex (3 2 6 7 15 14 18 19) $inMesh + + hex (5 4 8 9 17 16 20 21) $outMesh + hex (4 7 11 8 16 19 23 20) $outMesh + hex (6 5 9 10 18 17 21 22) $outMesh + hex (7 6 10 11 19 18 22 23) $outMesh ); edges ( + project 4 5 (rotatingZone) + project 5 6 (rotatingZone) + project 6 7 (rotatingZone) + project 7 4 (rotatingZone) + project 16 17 (rotatingZone) + project 17 18 (rotatingZone) + project 18 19 (rotatingZone) + project 19 16 (rotatingZone) + + project 8 9 (fixed) + project 9 10 (fixed) + project 10 11 (fixed) + project 11 8 (fixed) + project 20 21 (fixed) + project 21 22 (fixed) + project 22 23 (fixed) + project 23 20 (fixed) ); boundary ( +// Uncomment below to define patches in background mesh +/* + inlet + { + type patch; + faces + ( + (0 1 2 3) + (0 4 5 1) + (1 5 6 2) + (2 6 7 3) + (3 7 4 0) + (4 8 9 5) + (5 9 10 6) + (6 10 11 7) + (7 11 8 4) + ); + } + + outlet + { + type patch; + faces + ( + (12 13 14 15) + (12 16 17 13) + (13 17 18 14) + (14 18 19 15) + (15 19 16 12) + (16 20 21 17) + (17 21 22 18) + (18 22 23 19) + (19 23 20 16) + ); + } + + walls + { + type wall; + faces + ( + (8 9 21 20) + (9 10 22 21) + (10 11 23 22) + (11 8 20 23) + ); + } +*/ ); mergePatchPairs diff --git a/etc/templates/compressibleInflowOutflow/system/blockMeshDict.extPatches b/etc/templates/inflowOutflowRotating/system/blockMeshDict-box similarity index 97% rename from etc/templates/compressibleInflowOutflow/system/blockMeshDict.extPatches rename to etc/templates/inflowOutflowRotating/system/blockMeshDict-box index dbba64bbb9..a761d4fecb 100644 --- a/etc/templates/compressibleInflowOutflow/system/blockMeshDict.extPatches +++ b/etc/templates/inflowOutflowRotating/system/blockMeshDict-box @@ -59,6 +59,8 @@ edges boundary ( +// Uncomment below to define patches in background mesh +/* left { type patch; @@ -112,6 +114,7 @@ boundary (3 2 6 7) ); } +*/ ); mergePatchPairs diff --git a/etc/templates/inflowOutflowRotating/system/blockMeshDict.extPatches b/etc/templates/inflowOutflowRotating/system/blockMeshDict.extPatches deleted file mode 100644 index dbba64bbb9..0000000000 --- a/etc/templates/inflowOutflowRotating/system/blockMeshDict.extPatches +++ /dev/null @@ -1,121 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: plus | -| \\ / A nd | Web: www.OpenFOAM.com | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - object blockMeshDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -backgroundMesh -{ - xMin -1; - xMax 1; - yMin -1; - yMax 1; - zMin -1; - zMax 1; - xCells 20; - yCells 20; - zCells 20; -} - -convertToMeters 1; - -vertices -( - ($:backgroundMesh.xMin $:backgroundMesh.yMin $:backgroundMesh.zMin) - ($:backgroundMesh.xMax $:backgroundMesh.yMin $:backgroundMesh.zMin) - ($:backgroundMesh.xMax $:backgroundMesh.yMax $:backgroundMesh.zMin) - ($:backgroundMesh.xMin $:backgroundMesh.yMax $:backgroundMesh.zMin) - - ($:backgroundMesh.xMin $:backgroundMesh.yMin $:backgroundMesh.zMax) - ($:backgroundMesh.xMax $:backgroundMesh.yMin $:backgroundMesh.zMax) - ($:backgroundMesh.xMax $:backgroundMesh.yMax $:backgroundMesh.zMax) - ($:backgroundMesh.xMin $:backgroundMesh.yMax $:backgroundMesh.zMax) -); - -blocks -( - hex (0 1 2 3 4 5 6 7) - ( - $:backgroundMesh.xCells - $:backgroundMesh.yCells - $:backgroundMesh.zCells - ) - simpleGrading (1 1 1) -); - -edges -( -); - -boundary -( - left - { - type patch; - faces - ( - (0 3 7 4) - ); - } - - right - { - type patch; - faces - ( - (1 5 6 2) - ); - } - - bottom - { - type patch; - faces - ( - (0 1 2 3) - ); - } - - top - { - type patch; - faces - ( - (4 7 6 5) - ); - } - - back - { - type patch; - faces - ( - (0 4 5 1) - ); - } - - front - { - type patch; - faces - ( - (3 2 6 7) - ); - } -); - -mergePatchPairs -( -); - -// ************************************************************************* // diff --git a/etc/templates/inflowOutflowRotating/system/snappyHexMeshDict b/etc/templates/inflowOutflowRotating/system/snappyHexMeshDict index 0dc1c3acc4..1fe915899d 100644 --- a/etc/templates/inflowOutflowRotating/system/snappyHexMeshDict +++ b/etc/templates/inflowOutflowRotating/system/snappyHexMeshDict @@ -112,11 +112,13 @@ castellatedMeshControls locationInMesh (1e-5 1e-5 1e-5); // Offset from (0 0 0) to avoid // coinciding with face or edge + nCellsBetweenLevels 3; } snapControls { explicitFeatureSnap true; + implicitFeatureSnap false; } addLayersControls diff --git a/src/Allwmake b/src/Allwmake index 501f286305..01aa91102e 100755 --- a/src/Allwmake +++ b/src/Allwmake @@ -30,7 +30,6 @@ wmake $targetType fileFormats wmake $targetType surfMesh wmake $targetType triSurface wmake $targetType meshTools -wmake $targetType edgeMesh # Decomposition methods needed by dummyThirdParty # (dummy metisDecomp, scotchDecomp etc) needed by e.g. meshTools diff --git a/src/OpenFOAM/db/dictionary/dictionary.C b/src/OpenFOAM/db/dictionary/dictionary.C index ea449f50e6..46d3fae44f 100644 --- a/src/OpenFOAM/db/dictionary/dictionary.C +++ b/src/OpenFOAM/db/dictionary/dictionary.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. ------------------------------------------------------------------------------- License @@ -753,6 +753,24 @@ Foam::dictionary Foam::dictionary::subOrEmptyDict } +const Foam::dictionary& Foam::dictionary::optionalSubDict +( + const word& keyword +) const +{ + const entry* entryPtr = lookupEntryPtr(keyword, false, true); + + if (entryPtr) + { + return entryPtr->dict(); + } + else + { + return *this; + } +} + + Foam::wordList Foam::dictionary::toc() const { wordList keys(size()); diff --git a/src/OpenFOAM/db/dictionary/dictionary.H b/src/OpenFOAM/db/dictionary/dictionary.H index 7870d1ab3f..81fdd99c79 100644 --- a/src/OpenFOAM/db/dictionary/dictionary.H +++ b/src/OpenFOAM/db/dictionary/dictionary.H @@ -419,6 +419,10 @@ public: const bool mustRead = false ) const; + //- Find and return a sub-dictionary if found + // otherwise return this dictionary + const dictionary& optionalSubDict(const word&) const; + //- Return the table of contents wordList toc() const; diff --git a/src/OpenFOAM/fields/FieldFields/FieldField/FieldFieldFunctionsM.C b/src/OpenFOAM/fields/FieldFields/FieldField/FieldFieldFunctionsM.C index a32972d21a..4160f382ab 100644 --- a/src/OpenFOAM/fields/FieldFields/FieldField/FieldFieldFunctionsM.C +++ b/src/OpenFOAM/fields/FieldFields/FieldField/FieldFieldFunctionsM.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -204,54 +204,6 @@ tmp> Func \ \ TEMPLATE \ void Func \ -( \ - FieldField& f, \ - const FieldField& f1, \ - const Type2& s \ -) \ -{ \ - forAll(f, i) \ - { \ - Func(f[i], f1[i], s); \ - } \ -} \ - \ -TEMPLATE \ -tmp> Func \ -( \ - const FieldField& f1, \ - const Type2& s \ -) \ -{ \ - tmp> tRes \ - ( \ - FieldField::NewCalculatedType(f1) \ - ); \ - Func(tRes.ref(), f1, s); \ - return tRes; \ -} \ - \ -TEMPLATE \ -tmp> Func \ -( \ - const tmp>& tf1, \ - const Type2& s \ -) \ -{ \ - tmp> tRes \ - ( \ - reuseTmpFieldField::New(tf1) \ - ); \ - Func(tRes.ref(), tf1(), s); \ - tf1.clear(); \ - return tRes; \ -} - - -#define BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func) \ - \ -TEMPLATE \ -void Func \ ( \ FieldField& f, \ const Type1& s, \ @@ -296,6 +248,54 @@ tmp> Func \ } +#define BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func) \ + \ +TEMPLATE \ +void Func \ +( \ + FieldField& f, \ + const FieldField& f1, \ + const Type2& s \ +) \ +{ \ + forAll(f, i) \ + { \ + Func(f[i], f1[i], s); \ + } \ +} \ + \ +TEMPLATE \ +tmp> Func \ +( \ + const FieldField& f1, \ + const Type2& s \ +) \ +{ \ + tmp> tRes \ + ( \ + FieldField::NewCalculatedType(f1) \ + ); \ + Func(tRes.ref(), f1, s); \ + return tRes; \ +} \ + \ +TEMPLATE \ +tmp> Func \ +( \ + const tmp>& tf1, \ + const Type2& s \ +) \ +{ \ + tmp> tRes \ + ( \ + reuseTmpFieldField::New(tf1) \ + ); \ + Func(tRes.ref(), tf1(), s); \ + tf1.clear(); \ + return tRes; \ +} + + #define BINARY_TYPE_FUNCTION(ReturnType, Type1, Type2, Func) \ BINARY_TYPE_FUNCTION_SF(ReturnType, Type1, Type2, Func) \ BINARY_TYPE_FUNCTION_FS(ReturnType, Type1, Type2, Func) diff --git a/src/OpenFOAM/matrices/scalarMatrices/SVD/SVD.C b/src/OpenFOAM/matrices/scalarMatrices/SVD/SVD.C index 8b090ff275..89105de655 100644 --- a/src/OpenFOAM/matrices/scalarMatrices/SVD/SVD.C +++ b/src/OpenFOAM/matrices/scalarMatrices/SVD/SVD.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -156,7 +156,7 @@ Foam::SVD::SVD(const scalarRectangularMatrix& A, const scalar minCondition) { if (i < Un-1) { - if (g != 0) + if (g*U_(i, l) != 0) { for (label j=l; j ( Ostream& os, - const Function1& de + const Function1& func ); //- Write in dictionary format diff --git a/src/TurbulenceModels/compressible/Make/files b/src/TurbulenceModels/compressible/Make/files index 53b83f60b9..c7b6100132 100644 --- a/src/TurbulenceModels/compressible/Make/files +++ b/src/TurbulenceModels/compressible/Make/files @@ -2,7 +2,6 @@ compressibleTurbulenceModel.C turbulentFluidThermoModels/turbulentFluidThermoModels.C BCs = turbulentFluidThermoModels/derivedFvPatchFields -$(BCs)/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C $(BCs)/temperatureCoupledBase/temperatureCoupledBase.C $(BCs)/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C $(BCs)/thermalBaffle1D/thermalBaffle1DFvPatchScalarFields.C diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C index ab1abe4657..3aa29ad806 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd. ------------------------------------------------------------------------------- License @@ -27,6 +27,9 @@ License #include "addToRunTimeSelectionTable.H" #include "fvPatchFieldMapper.H" #include "volFields.H" +#include "physicoChemicalConstants.H" + +using Foam::constant::physicoChemical::sigma; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -40,12 +43,11 @@ namespace Foam 3 >::names[] = { - "fixed_heat_flux", - "fixed_heat_transfer_coefficient", - "unknown" + "power", + "flux", + "coefficient" }; - -} // End namespace Foam +} const Foam::NamedEnum < @@ -65,19 +67,108 @@ externalWallHeatFluxTemperatureFvPatchScalarField : mixedFvPatchScalarField(p, iF), temperatureCoupledBase(patch(), "undefined", "undefined", "undefined-K"), - mode_(unknown), - q_(p.size(), 0.0), - h_(p.size(), 0.0), - Ta_(p.size(), 0.0), - QrPrevious_(p.size(), 0.0), - QrRelaxation_(1), - QrName_("undefined-Qr"), + mode_(fixedHeatFlux), + Q_(0), + relaxation_(1), + emissivity_(0), + qrRelaxation_(1), + qrName_("undefined-qr"), thicknessLayers_(), kappaLayers_() { - refValue() = 0.0; - refGrad() = 0.0; - valueFraction() = 1.0; + refValue() = 0; + refGrad() = 0; + valueFraction() = 1; +} + + +Foam::externalWallHeatFluxTemperatureFvPatchScalarField:: +externalWallHeatFluxTemperatureFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + mixedFvPatchScalarField(p, iF), + temperatureCoupledBase(patch(), dict), + mode_(operationModeNames.read(dict.lookup("mode"))), + Q_(0), + relaxation_(dict.lookupOrDefault("relaxation", 1)), + emissivity_(dict.lookupOrDefault("emissivity", 0)), + qrRelaxation_(dict.lookupOrDefault("qrRelaxation", 1)), + qrName_(dict.lookupOrDefault("qr", "none")), + thicknessLayers_(), + kappaLayers_() +{ + switch (mode_) + { + case fixedPower: + { + dict.lookup("Q") >> Q_; + + break; + } + case fixedHeatFlux: + { + q_ = scalarField("q", dict, p.size()); + + break; + } + case fixedHeatTransferCoeff: + { + h_ = scalarField("h", dict, p.size()); + Ta_ = scalarField("Ta", dict, p.size()); + + if (dict.found("thicknessLayers")) + { + dict.lookup("thicknessLayers") >> thicknessLayers_; + dict.lookup("kappaLayers") >> kappaLayers_; + + if (thicknessLayers_.size() != kappaLayers_.size()) + { + FatalIOErrorInFunction(dict) + << "\n number of layers for thicknessLayers and " + << "kappaLayers must be the same" + << "\n for patch " << p.name() + << " of field " << internalField().name() + << " in file " << internalField().objectPath() + << exit(FatalIOError); + } + } + + break; + } + } + + fvPatchScalarField::operator=(scalarField("value", dict, p.size())); + + if (qrName_ != "none") + { + if (dict.found("qrPrevious")) + { + qrPrevious_ = scalarField("qrPrevious", dict, p.size()); + } + else + { + qrPrevious_.setSize(p.size(), 0); + } + } + + if (dict.found("refValue")) + { + // Full restart + refValue() = scalarField("refValue", dict, p.size()); + refGrad() = scalarField("refGradient", dict, p.size()); + valueFraction() = scalarField("valueFraction", dict, p.size()); + } + else + { + // Start from user entered data. Assume fixedValue. + refValue() = *this; + refGrad() = 0; + valueFraction() = 1; + } } @@ -93,96 +184,38 @@ externalWallHeatFluxTemperatureFvPatchScalarField mixedFvPatchScalarField(ptf, p, iF, mapper), temperatureCoupledBase(patch(), ptf), mode_(ptf.mode_), - q_(ptf.q_, mapper), - h_(ptf.h_, mapper), - Ta_(ptf.Ta_, mapper), - QrPrevious_(ptf.QrPrevious_, mapper), - QrRelaxation_(ptf.QrRelaxation_), - QrName_(ptf.QrName_), + Q_(ptf.Q_), + relaxation_(ptf.relaxation_), + emissivity_(ptf.emissivity_), + qrRelaxation_(ptf.qrRelaxation_), + qrName_(ptf.qrName_), thicknessLayers_(ptf.thicknessLayers_), kappaLayers_(ptf.kappaLayers_) -{} - - -Foam::externalWallHeatFluxTemperatureFvPatchScalarField:: -externalWallHeatFluxTemperatureFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF, - const dictionary& dict -) -: - mixedFvPatchScalarField(p, iF), - temperatureCoupledBase(patch(), dict), - mode_(unknown), - q_(p.size(), 0.0), - h_(p.size(), 0.0), - Ta_(p.size(), 0.0), - QrPrevious_(p.size(), 0.0), - QrRelaxation_(dict.lookupOrDefault("relaxation", 1)), - QrName_(dict.lookupOrDefault("Qr", "none")), - thicknessLayers_(), - kappaLayers_() { - if (dict.found("q") && !dict.found("h") && !dict.found("Ta")) + switch (mode_) { - mode_ = fixedHeatFlux; - q_ = scalarField("q", dict, p.size()); - } - else if (dict.found("h") && dict.found("Ta") && !dict.found("q")) - { - mode_ = fixedHeatTransferCoeff; - h_ = scalarField("h", dict, p.size()); - Ta_ = scalarField("Ta", dict, p.size()); - if (dict.found("thicknessLayers")) - - if (dict.readIfPresent("thicknessLayers", thicknessLayers_)) + case fixedPower: { - dict.lookup("kappaLayers") >> kappaLayers_; + break; + } + case fixedHeatFlux: + { + q_.autoMap(mapper); - if (thicknessLayers_.size() != kappaLayers_.size()) - { - FatalIOErrorInFunction(dict) - << "\n number of layers for thicknessLayers and " - << "kappaLayers must be the same" - << "\n for patch " << p.name() - << " of field " << internalField().name() - << " in file " << internalField().objectPath() - << exit(FatalIOError); - } + break; + } + case fixedHeatTransferCoeff: + { + h_.autoMap(mapper); + Ta_.autoMap(mapper); + + break; } } - else - { - FatalErrorInFunction - << "\n patch type '" << p.type() - << "' either q or h and Ta were not found '" - << "\n for patch " << p.name() - << " of field " << internalField().name() - << " in file " << internalField().objectPath() - << exit(FatalError); - } - fvPatchScalarField::operator=(scalarField("value", dict, p.size())); - - if (dict.found("QrPrevious")) + if (qrName_ != "none") { - QrPrevious_ = scalarField("QrPrevious", dict, p.size()); - } - - if (dict.found("refValue")) - { - // Full restart - refValue() = scalarField("refValue", dict, p.size()); - refGrad() = scalarField("refGradient", dict, p.size()); - valueFraction() = scalarField("valueFraction", dict, p.size()); - } - else - { - // Start from user entered data. Assume fixedValue. - refValue() = *this; - refGrad() = 0.0; - valueFraction() = 1.0; + qrPrevious_.autoMap(mapper); } } @@ -190,41 +223,47 @@ externalWallHeatFluxTemperatureFvPatchScalarField Foam::externalWallHeatFluxTemperatureFvPatchScalarField:: externalWallHeatFluxTemperatureFvPatchScalarField ( - const externalWallHeatFluxTemperatureFvPatchScalarField& tppsf + const externalWallHeatFluxTemperatureFvPatchScalarField& ewhftpsf ) : - mixedFvPatchScalarField(tppsf), - temperatureCoupledBase(tppsf), - mode_(tppsf.mode_), - q_(tppsf.q_), - h_(tppsf.h_), - Ta_(tppsf.Ta_), - QrPrevious_(tppsf.QrPrevious_), - QrRelaxation_(tppsf.QrRelaxation_), - QrName_(tppsf.QrName_), - thicknessLayers_(tppsf.thicknessLayers_), - kappaLayers_(tppsf.kappaLayers_) + mixedFvPatchScalarField(ewhftpsf), + temperatureCoupledBase(ewhftpsf), + mode_(ewhftpsf.mode_), + Q_(ewhftpsf.Q_), + q_(ewhftpsf.q_), + h_(ewhftpsf.h_), + Ta_(ewhftpsf.Ta_), + relaxation_(ewhftpsf.relaxation_), + emissivity_(ewhftpsf.emissivity_), + qrPrevious_(ewhftpsf.qrPrevious_), + qrRelaxation_(ewhftpsf.qrRelaxation_), + qrName_(ewhftpsf.qrName_), + thicknessLayers_(ewhftpsf.thicknessLayers_), + kappaLayers_(ewhftpsf.kappaLayers_) {} Foam::externalWallHeatFluxTemperatureFvPatchScalarField:: externalWallHeatFluxTemperatureFvPatchScalarField ( - const externalWallHeatFluxTemperatureFvPatchScalarField& tppsf, + const externalWallHeatFluxTemperatureFvPatchScalarField& ewhftpsf, const DimensionedField& iF ) : - mixedFvPatchScalarField(tppsf, iF), - temperatureCoupledBase(patch(), tppsf), - mode_(tppsf.mode_), - q_(tppsf.q_), - h_(tppsf.h_), - Ta_(tppsf.Ta_), - QrPrevious_(tppsf.QrPrevious_), - QrRelaxation_(tppsf.QrRelaxation_), - QrName_(tppsf.QrName_), - thicknessLayers_(tppsf.thicknessLayers_), - kappaLayers_(tppsf.kappaLayers_) + mixedFvPatchScalarField(ewhftpsf, iF), + temperatureCoupledBase(patch(), ewhftpsf), + mode_(ewhftpsf.mode_), + Q_(ewhftpsf.Q_), + q_(ewhftpsf.q_), + h_(ewhftpsf.h_), + Ta_(ewhftpsf.Ta_), + relaxation_(ewhftpsf.relaxation_), + emissivity_(ewhftpsf.emissivity_), + qrPrevious_(ewhftpsf.qrPrevious_), + qrRelaxation_(ewhftpsf.qrRelaxation_), + qrName_(ewhftpsf.qrName_), + thicknessLayers_(ewhftpsf.thicknessLayers_), + kappaLayers_(ewhftpsf.kappaLayers_) {} @@ -236,10 +275,32 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::autoMap ) { mixedFvPatchScalarField::autoMap(m); - q_.autoMap(m); - h_.autoMap(m); - Ta_.autoMap(m); - QrPrevious_.autoMap(m); + + switch (mode_) + { + case fixedPower: + { + break; + } + case fixedHeatFlux: + { + q_.autoMap(m); + + break; + } + case fixedHeatTransferCoeff: + { + h_.autoMap(m); + Ta_.autoMap(m); + + break; + } + } + + if (qrName_ != "none") + { + qrPrevious_.autoMap(m); + } } @@ -251,13 +312,34 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::rmap { mixedFvPatchScalarField::rmap(ptf, addr); - const externalWallHeatFluxTemperatureFvPatchScalarField& tiptf = + const externalWallHeatFluxTemperatureFvPatchScalarField& ewhftpsf = refCast(ptf); - q_.rmap(tiptf.q_, addr); - h_.rmap(tiptf.h_, addr); - Ta_.rmap(tiptf.Ta_, addr); - QrPrevious_.rmap(tiptf.QrPrevious_, addr); + switch (mode_) + { + case fixedPower: + { + break; + } + case fixedHeatFlux: + { + q_.rmap(ewhftpsf.q_, addr); + + break; + } + case fixedHeatTransferCoeff: + { + h_.rmap(ewhftpsf.h_, addr); + Ta_.rmap(ewhftpsf.Ta_, addr); + + break; + } + } + + if (qrName_ != "none") + { + qrPrevious_.rmap(ewhftpsf.qrPrevious_, addr); + } } @@ -268,65 +350,114 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs() return; } - const scalarField Tp(*this); - scalarField hp(patch().size(), 0.0); + const scalarField& Tp(*this); - scalarField Qr(Tp.size(), 0.0); - if (QrName_ != "none") + scalarField qr(Tp.size(), 0); + if (qrName_ != "none") { - Qr = patch().lookupPatchField(QrName_); + qr = + qrRelaxation_ + *patch().lookupPatchField(qrName_) + + (1 - qrRelaxation_)*qrPrevious_; - Qr = QrRelaxation_*Qr + (1.0 - QrRelaxation_)*QrPrevious_; - QrPrevious_ = Qr; + qrPrevious_ = qr; } switch (mode_) { + case fixedPower: + { + refGrad() = (Q_/gSum(patch().magSf()) + qr)/kappa(Tp); + refValue() = 0; + valueFraction() = 0; + + break; + } case fixedHeatFlux: { - refGrad() = (q_ + Qr)/kappa(Tp); - refValue() = 0.0; - valueFraction() = 0.0; + refGrad() = (q_ + qr)/kappa(Tp); + refValue() = 0; + valueFraction() = 0; break; } case fixedHeatTransferCoeff: { - scalar totalSolidRes = 0.0; - if (thicknessLayers_.size() > 0) + scalar totalSolidRes = 0; + if (thicknessLayers_.size()) { forAll(thicknessLayers_, iLayer) { const scalar l = thicknessLayers_[iLayer]; - if (kappaLayers_[iLayer] > 0.0) + if (kappaLayers_[iLayer] > 0) { totalSolidRes += l/kappaLayers_[iLayer]; } } } - hp = 1.0/(1.0/h_ + totalSolidRes); + scalarField hp(1/(1/h_ + totalSolidRes)); - Qr /= Tp; - refGrad() = 0.0; - refValue() = hp*Ta_/(hp - Qr); - valueFraction() = - (hp - Qr)/((hp - Qr) + kappa(Tp)*patch().deltaCoeffs()); + scalarField hpTa(hp*Ta_); + + if (emissivity_ > 0) + { + // Evaluate the radiative flux to the environment + // from the surface temperature ... + if (totalSolidRes > 0) + { + // ... including the effect of the solid wall thermal + // resistance + scalarField TpLambda(h_/(h_ + 1/totalSolidRes)); + scalarField Ts(TpLambda*Tp + (1 - TpLambda)*Ta_); + scalarField lambdaTa4(pow4((1 - TpLambda)*Ta_)); + + hp += emissivity_*sigma.value()*(pow4(Ts) - lambdaTa4)/Tp; + hpTa += sigma.value()*(emissivity_*lambdaTa4 + pow4(Ta_)); + } + else + { + // ... if there is no solid wall thermal resistance use + // the current wall temperature + hp += emissivity_*sigma.value()*pow3(Tp); + hpTa += sigma.value()*pow4(Ta_); + } + } + + const scalarField kappaDeltaCoeffs + ( + this->kappa(Tp)*patch().deltaCoeffs() + ); + + refGrad() = 0; + + forAll(Tp, i) + { + if (qr[i] < 0) + { + const scalar hpmqr = hp[i] - qr[i]/Tp[i]; + + refValue()[i] = hpTa[i]/hpmqr; + valueFraction()[i] = hpmqr/(hpmqr + kappaDeltaCoeffs[i]); + } + else + { + refValue()[i] = (hpTa[i] + qr[i])/hp[i]; + valueFraction()[i] = hp[i]/(hp[i] + kappaDeltaCoeffs[i]); + } + } break; } - default: - { - FatalErrorInFunction - << "Illegal heat flux mode " << operationModeNames[mode_] - << exit(FatalError); - } } + valueFraction() = relaxation_*valueFraction() + (1 - relaxation_); + refValue() = relaxation_*refValue() + (1 - relaxation_)*Tp; + mixedFvPatchScalarField::updateCoeffs(); if (debug) { - scalar Q = gSum(kappa(Tp)*patch().magSf()*snGrad()); + const scalar Q = gSum(kappa(Tp)*patch().magSf()*snGrad()); Info<< patch().boundaryMesh().mesh().name() << ':' << patch().name() << ':' @@ -346,37 +477,68 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::write Ostream& os ) const { - mixedFvPatchScalarField::write(os); - temperatureCoupledBase::write(os); + fvPatchScalarField::write(os); - QrPrevious_.writeEntry("QrPrevious", os); - os.writeKeyword("Qr")<< QrName_ << token::END_STATEMENT << nl; - os.writeKeyword("relaxation")<< QrRelaxation_ - << token::END_STATEMENT << nl; + os.writeKeyword("mode") + << operationModeNames[mode_] << token::END_STATEMENT << nl; + temperatureCoupledBase::write(os); switch (mode_) { + case fixedPower: + { + os.writeKeyword("Q") + << Q_ << token::END_STATEMENT << nl; + break; + } case fixedHeatFlux: { q_.writeEntry("q", os); + break; } case fixedHeatTransferCoeff: { h_.writeEntry("h", os); Ta_.writeEntry("Ta", os); - thicknessLayers_.writeEntry("thicknessLayers", os); - kappaLayers_.writeEntry("kappaLayers", os); + + if (relaxation_ < 1) + { + os.writeKeyword("relaxation") + << relaxation_ << token::END_STATEMENT << nl; + } + + if (emissivity_ > 0) + { + os.writeKeyword("emissivity") + << emissivity_ << token::END_STATEMENT << nl; + } + + if (thicknessLayers_.size()) + { + thicknessLayers_.writeEntry("thicknessLayers", os); + kappaLayers_.writeEntry("kappaLayers", os); + } + break; } - default: - { - FatalErrorInFunction - << "Illegal heat flux mode " << operationModeNames[mode_] - << abort(FatalError); - } } + + os.writeKeyword("qr")<< qrName_ << token::END_STATEMENT << nl; + + if (qrName_ != "none") + { + os.writeKeyword("qrRelaxation") + << qrRelaxation_ << token::END_STATEMENT << nl; + + qrPrevious_.writeEntry("qrPrevious", os); + } + + refValue().writeEntry("refValue", os); + refGrad().writeEntry("refGradient", os); + valueFraction().writeEntry("valueFraction", os); + writeEntry("value", os); } diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.H b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.H index a253a040f4..c9d1d6d51f 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.H +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,37 +28,43 @@ Group grpThermoBoundaryConditions grpWallBoundaryConditions Description - This boundary condition supplies a heat flux condition for temperature - on an external wall. Optional thin thermal layer resistances can be - specified through thicknessLayers and kappaLayers entries for the - fixed heat transfer coefficient mode. + This boundary condition applies a heat flux condition to temperature + on an external wall in one of three modes: - The condition can operate in two modes: - - fixed heat transfer coefficient: supply h and Ta + - fixed power: supply Q - fixed heat flux: supply q + - fixed heat transfer coefficient: supply h and Ta where: \vartable - h | heat transfer coefficient [W/m^2/K] - Ta | ambient temperature [K] - q | heat flux [W/m^2] + Q | Power [W] + q | Heat flux [W/m^2] + h | Heat transfer coefficient [W/m^2/K] + Ta | Ambient temperature [K] \endvartable + For heat transfer coefficient mode optional thin thermal layer resistances + can be specified through thicknessLayers and kappaLayers entries. + The thermal conductivity \c kappa can either be retrieved from various possible sources, as detailed in the class temperatureCoupledBase. Usage \table - Property | Description | Required | Default value - q | heat flux [W/m^2] | yes* | - Ta | ambient temperature [K] | yes* | - h | heat transfer coefficient [W/m^2/K] | yes*| - thicknessLayers | list of thicknesses per layer [m] | yes | - kappaLayers | list of thermal conductivities per layer [W/m/K] | yes | - Qr | name of the radiative field | no | no - relaxation | relaxation factor for radiative field | no | 1 - kappaMethod | inherited from temperatureCoupledBase | inherited | - kappa | inherited from temperatureCoupledBase | inherited | + Property | Description | Required | Default value + mode | 'power', 'flux' or 'coefficient' | yes | + Q | Power [W] | for mode 'power' | + q | Heat flux [W/m^2] | for mode 'flux' | + h | Heat transfer coefficient [W/m^2/K] | for mode 'coefficent' | + Ta | Ambient temperature [K] | for mode 'coefficient' | + thicknessLayers | Layer thicknesses [m] | no | + kappaLayers | Layer thermal conductivities [W/m/K] | no | + relaxation | Relaxation for the wall temperature | no | 1 + emissivity | Surface emissivity for radiative flux to ambient | no | 0 + qr | Name of the radiative field | no | none + qrRelaxation | Relaxation factor for radiative field | no | 1 + kappaMethod | Inherited from temperatureCoupledBase | inherited | + kappa | Inherited from temperatureCoupledBase | inherited | \endtable Example of the boundary condition specification: @@ -66,24 +72,23 @@ Usage { type externalWallHeatFluxTemperature; - q uniform 1000; + + mode coefficient; + Ta uniform 300.0; h uniform 10.0; thicknessLayers (0.1 0.2 0.3 0.4); kappaLayers (1 2 3 4); - value uniform 300.0; - Qr none; - relaxation 1; - kappaMethod fluidThermo; - kappa none; + + kappaMethod fluidThermo; + + value $internalField; } \endverbatim - Note: - - Only supply \c h and \c Ta, or \c q in the dictionary (see above) - See also Foam::temperatureCoupledBase + Foam::mixedFvPatchScalarField SourceFiles externalWallHeatFluxTemperatureFvPatchScalarField.C @@ -117,9 +122,9 @@ public: //- Operation mode enumeration enum operationMode { + fixedPower, //!< Fixed heat flux fixedHeatFlux, //!< Fixed heat flux fixedHeatTransferCoeff, //!< Fixed heat transfer coefficient - unknown }; static const NamedEnum operationModeNames; @@ -132,23 +137,32 @@ private: //- Operation mode operationMode mode_; - //- Heat flux / [W/m2] + //- Heat power [W] + scalar Q_; + + //- Heat flux [W/m2] scalarField q_; - //- Heat transfer coefficient / [W/m2K] + //- Heat transfer coefficient [W/m2K] scalarField h_; - //- Ambient temperature / [K] + //- Ambient temperature [K] scalarField Ta_; - //- Chache Qr for relaxation - scalarField QrPrevious_; + //- Relaxation for the wall temperature (thermal inertia) + scalar relaxation_; - //- Relaxation for Qr - scalar QrRelaxation_; + //- Optional surface emissivity for radiative transfer to ambient + scalar emissivity_; + + //- Cache qr for relaxation + scalarField qrPrevious_; + + //- Relaxation for qr + scalar qrRelaxation_; //- Name of the radiative heat flux - const word QrName_; + const word qrName_; //- Thickness of layers scalarList thicknessLayers_; @@ -181,8 +195,8 @@ public: ); //- Construct by mapping given - // externalWallHeatFluxTemperatureFvPatchScalarField - // onto a new patch + // externalWallHeatFluxTemperatureFvPatchScalarField + // onto a new patch externalWallHeatFluxTemperatureFvPatchScalarField ( const externalWallHeatFluxTemperatureFvPatchScalarField&, diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C index 71c695e80d..6ed6e4f72a 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -53,9 +53,9 @@ thermalBaffle1DFvPatchScalarField Qs_(p.size()), solidDict_(), solidPtr_(nullptr), - QrPrevious_(p.size()), - QrRelaxation_(1), - QrName_("undefined-Qr") + qrPrevious_(p.size()), + qrRelaxation_(1), + qrName_("undefined-qr") {} @@ -77,9 +77,9 @@ thermalBaffle1DFvPatchScalarField Qs_(ptf.Qs_, mapper), solidDict_(ptf.solidDict_), solidPtr_(ptf.solidPtr_), - QrPrevious_(ptf.QrPrevious_, mapper), - QrRelaxation_(ptf.QrRelaxation_), - QrName_(ptf.QrName_) + qrPrevious_(ptf.qrPrevious_, mapper), + qrRelaxation_(ptf.qrRelaxation_), + qrName_(ptf.qrName_) {} @@ -100,9 +100,9 @@ thermalBaffle1DFvPatchScalarField Qs_(p.size(), 0), solidDict_(dict), solidPtr_(), - QrPrevious_(p.size(), 0.0), - QrRelaxation_(dict.lookupOrDefault("relaxation", 1)), - QrName_(dict.lookupOrDefault("Qr", "none")) + qrPrevious_(p.size(), 0.0), + qrRelaxation_(dict.lookupOrDefault("relaxation", 1)), + qrName_(dict.lookupOrDefault("qr", "none")) { fvPatchScalarField::operator=(scalarField("value", dict, p.size())); @@ -116,9 +116,9 @@ thermalBaffle1DFvPatchScalarField Qs_ = scalarField("Qs", dict, p.size()); } - if (dict.found("QrPrevious")) + if (dict.found("qrPrevious")) { - QrPrevious_ = scalarField("QrPrevious", dict, p.size()); + qrPrevious_ = scalarField("qrPrevious", dict, p.size()); } if (dict.found("refValue") && baffleActivated_) @@ -154,9 +154,9 @@ thermalBaffle1DFvPatchScalarField Qs_(ptf.Qs_), solidDict_(ptf.solidDict_), solidPtr_(ptf.solidPtr_), - QrPrevious_(ptf.QrPrevious_), - QrRelaxation_(ptf.QrRelaxation_), - QrName_(ptf.QrName_) + qrPrevious_(ptf.qrPrevious_), + qrRelaxation_(ptf.qrRelaxation_), + qrName_(ptf.qrName_) {} @@ -176,9 +176,9 @@ thermalBaffle1DFvPatchScalarField Qs_(ptf.Qs_), solidDict_(ptf.solidDict_), solidPtr_(ptf.solidPtr_), - QrPrevious_(ptf.QrPrevious_), - QrRelaxation_(ptf.QrRelaxation_), - QrName_(ptf.QrName_) + qrPrevious_(ptf.qrPrevious_), + qrRelaxation_(ptf.qrRelaxation_), + qrName_(ptf.qrName_) {} @@ -364,15 +364,15 @@ void thermalBaffle1DFvPatchScalarField::updateCoeffs() patch().template lookupPatchField(TName_); - scalarField Qr(Tp.size(), 0.0); + scalarField qr(Tp.size(), 0.0); - if (QrName_ != "none") + if (qrName_ != "none") { - Qr = patch().template lookupPatchField - (QrName_); + qr = patch().template lookupPatchField + (qrName_); - Qr = QrRelaxation_*Qr + (1.0 - QrRelaxation_)*QrPrevious_; - QrPrevious_ = Qr; + qr = qrRelaxation_*qr + (1.0 - qrRelaxation_)*qrPrevious_; + qrPrevious_ = qr; } tmp Ti = patchInternalField(); @@ -393,7 +393,7 @@ void thermalBaffle1DFvPatchScalarField::updateCoeffs() scalarField KDeltaSolid(kappas/baffleThickness()); - scalarField alpha(KDeltaSolid - Qr/Tp); + scalarField alpha(KDeltaSolid - qr/Tp); valueFraction() = alpha/(alpha + myKDelta); @@ -435,9 +435,9 @@ void thermalBaffle1DFvPatchScalarField::write(Ostream& os) const solid().write(os); } - QrPrevious_.writeEntry("QrPrevious", os); - os.writeKeyword("Qr")<< QrName_ << token::END_STATEMENT << nl; - os.writeKeyword("relaxation")<< QrRelaxation_ + qrPrevious_.writeEntry("qrPrevious", os); + os.writeKeyword("qr")<< qrName_ << token::END_STATEMENT << nl; + os.writeKeyword("relaxation")<< qrRelaxation_ << token::END_STATEMENT << nl; } diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.H b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.H index af6c701bc7..f9491806fe 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.H +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/thermalBaffle1D/thermalBaffle1DFvPatchScalarField.H @@ -31,8 +31,8 @@ Description This BC solves a steady 1D thermal baffle. The solid properties are specify as dictionary. Optionaly radiative heat - flux (Qr) can be incorporated into the balance. Some under-relaxation might - be needed on Qr. Baffle and solid properties need to be specified on the + flux (qr) can be incorporated into the balance. Some under-relaxation might + be needed on qr. Baffle and solid properties need to be specified on the master side of the baffle. Usage @@ -48,7 +48,7 @@ Usage thickness uniform 0.005; // thickness [m] Qs uniform 100; // heat flux [W/m2] - Qr none; + qr none; relaxation 1; // Solid thermo @@ -78,7 +78,7 @@ Usage type compressible::thermalBaffle1D; samplePatch ; - Qr none; + qr none; relaxation 1; } \endverbatim @@ -132,14 +132,14 @@ class thermalBaffle1DFvPatchScalarField //- Solid thermo mutable autoPtr solidPtr_; - //- Cache Qr for relaxation - scalarField QrPrevious_; + //- Cache qr for relaxation + scalarField qrPrevious_; - //- Relaxation for Qr - scalar QrRelaxation_; + //- Relaxation for qr + scalar qrRelaxation_; //- Name of the radiative heat flux in local region - const word QrName_; + const word qrName_; // Private members diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C deleted file mode 100644 index 786ceae3e9..0000000000 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C +++ /dev/null @@ -1,262 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 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 . - -\*---------------------------------------------------------------------------*/ - -#include "turbulentHeatFluxTemperatureFvPatchScalarField.H" -#include "addToRunTimeSelectionTable.H" -#include "fvPatchFieldMapper.H" -#include "volFields.H" - - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - // declare specialization within 'Foam' namespace - template<> - const char* NamedEnum - < - Foam::compressible:: - turbulentHeatFluxTemperatureFvPatchScalarField::heatSourceType, - 2 - >::names[] = - { - "power", - "flux" - }; -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - -namespace Foam -{ - -namespace compressible -{ - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -const NamedEnum -< - turbulentHeatFluxTemperatureFvPatchScalarField::heatSourceType, - 2 -> turbulentHeatFluxTemperatureFvPatchScalarField::heatSourceTypeNames_; - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -turbulentHeatFluxTemperatureFvPatchScalarField:: -turbulentHeatFluxTemperatureFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF -) -: - fixedGradientFvPatchScalarField(p, iF), - temperatureCoupledBase(patch(), "undefined", "undefined", "undefined-K"), - heatSource_(hsPower), - q_(p.size(), 0.0), - QrName_("undefinedQr") -{} - - -turbulentHeatFluxTemperatureFvPatchScalarField:: -turbulentHeatFluxTemperatureFvPatchScalarField -( - const turbulentHeatFluxTemperatureFvPatchScalarField& ptf, - const fvPatch& p, - const DimensionedField& iF, - const fvPatchFieldMapper& mapper -) -: - fixedGradientFvPatchScalarField(ptf, p, iF, mapper), - temperatureCoupledBase(patch(), ptf), - heatSource_(ptf.heatSource_), - q_(ptf.q_, mapper), - QrName_(ptf.QrName_) -{} - - -turbulentHeatFluxTemperatureFvPatchScalarField:: -turbulentHeatFluxTemperatureFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF, - const dictionary& dict -) -: - fixedGradientFvPatchScalarField(p, iF), - temperatureCoupledBase(patch(), dict), - heatSource_(heatSourceTypeNames_.read(dict.lookup("heatSource"))), - q_("q", dict, p.size()), - QrName_(dict.lookupOrDefault("Qr", "none")) -{ - if (dict.found("value") && dict.found("gradient")) - { - fvPatchField::operator=(Field("value", dict, p.size())); - gradient() = Field("gradient", dict, p.size()); - } - else - { - // Still reading so cannot yet evaluate. Make up a value. - fvPatchField::operator=(patchInternalField()); - gradient() = 0.0; - } -} - - -turbulentHeatFluxTemperatureFvPatchScalarField:: -turbulentHeatFluxTemperatureFvPatchScalarField -( - const turbulentHeatFluxTemperatureFvPatchScalarField& thftpsf -) -: - fixedGradientFvPatchScalarField(thftpsf), - temperatureCoupledBase(patch(), thftpsf), - heatSource_(thftpsf.heatSource_), - q_(thftpsf.q_), - QrName_(thftpsf.QrName_) -{} - - -turbulentHeatFluxTemperatureFvPatchScalarField:: -turbulentHeatFluxTemperatureFvPatchScalarField -( - const turbulentHeatFluxTemperatureFvPatchScalarField& thftpsf, - const DimensionedField& iF -) -: - fixedGradientFvPatchScalarField(thftpsf, iF), - temperatureCoupledBase(patch(), thftpsf), - heatSource_(thftpsf.heatSource_), - q_(thftpsf.q_), - QrName_(thftpsf.QrName_) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void turbulentHeatFluxTemperatureFvPatchScalarField::autoMap -( - const fvPatchFieldMapper& m -) -{ - fixedGradientFvPatchScalarField::autoMap(m); - q_.autoMap(m); -} - - -void turbulentHeatFluxTemperatureFvPatchScalarField::rmap -( - const fvPatchScalarField& ptf, - const labelList& addr -) -{ - fixedGradientFvPatchScalarField::rmap(ptf, addr); - - const turbulentHeatFluxTemperatureFvPatchScalarField& thftptf = - refCast - ( - ptf - ); - - q_.rmap(thftptf.q_, addr); -} - - -void turbulentHeatFluxTemperatureFvPatchScalarField::updateCoeffs() -{ - if (updated()) - { - return; - } - - const scalarField& Tp = *this; - - scalarField qr(this->size(), 0.0); - - //- Qr is negative going into the domain - if (QrName_ != "none") - { - qr = patch().lookupPatchField(QrName_); - } - - switch (heatSource_) - { - case hsPower: - { - const scalar Ap = gSum(patch().magSf()); - gradient() = (q_/Ap + qr)/kappa(Tp); - break; - } - case hsFlux: - { - gradient() = (q_ + qr)/kappa(Tp); - break; - } - default: - { - FatalErrorInFunction - << "Unknown heat source type. Valid types are: " - << heatSourceTypeNames_ << nl << exit(FatalError); - } - } - - fixedGradientFvPatchScalarField::updateCoeffs(); -} - - -void turbulentHeatFluxTemperatureFvPatchScalarField::write -( - Ostream& os -) const -{ - fixedGradientFvPatchScalarField::write(os); - os.writeKeyword("heatSource") << heatSourceTypeNames_[heatSource_] - << token::END_STATEMENT << nl; - temperatureCoupledBase::write(os); - q_.writeEntry("q", os); - os.writeKeyword("Qr")<< QrName_ << token::END_STATEMENT << nl; - writeEntry("value", os); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -makePatchTypeField -( - fvPatchScalarField, - turbulentHeatFluxTemperatureFvPatchScalarField -); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace compressible -} // End namespace Foam - - -// ************************************************************************* // diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C index f2629e6f40..e8fad80ee7 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd ------------------------------------------------------------------------------- License @@ -49,8 +49,8 @@ turbulentTemperatureRadCoupledMixedFvPatchScalarField mixedFvPatchScalarField(p, iF), temperatureCoupledBase(patch(), "undefined", "undefined", "undefined-K"), TnbrName_("undefined-Tnbr"), - QrNbrName_("undefined-QrNbr"), - QrName_("undefined-Qr"), + qrNbrName_("undefined-qrNbr"), + qrName_("undefined-qr"), thicknessLayers_(0), kappaLayers_(0), contactRes_(0), @@ -74,8 +74,8 @@ turbulentTemperatureRadCoupledMixedFvPatchScalarField mixedFvPatchScalarField(psf, p, iF, mapper), temperatureCoupledBase(patch(), psf), TnbrName_(psf.TnbrName_), - QrNbrName_(psf.QrNbrName_), - QrName_(psf.QrName_), + qrNbrName_(psf.qrNbrName_), + qrName_(psf.qrName_), thicknessLayers_(psf.thicknessLayers_), kappaLayers_(psf.kappaLayers_), contactRes_(psf.contactRes_), @@ -94,8 +94,8 @@ turbulentTemperatureRadCoupledMixedFvPatchScalarField mixedFvPatchScalarField(p, iF), temperatureCoupledBase(patch(), dict), TnbrName_(dict.lookupOrDefault("Tnbr", "T")), - QrNbrName_(dict.lookupOrDefault("QrNbr", "none")), - QrName_(dict.lookupOrDefault("Qr", "none")), + qrNbrName_(dict.lookupOrDefault("qrNbr", "none")), + qrName_(dict.lookupOrDefault("qr", "none")), thicknessLayers_(0), kappaLayers_(0), contactRes_(0.0), @@ -156,8 +156,8 @@ turbulentTemperatureRadCoupledMixedFvPatchScalarField mixedFvPatchScalarField(psf, iF), temperatureCoupledBase(patch(), psf), TnbrName_(psf.TnbrName_), - QrNbrName_(psf.QrNbrName_), - QrName_(psf.QrName_), + qrNbrName_(psf.qrNbrName_), + qrName_(psf.qrName_), thicknessLayers_(psf.thicknessLayers_), kappaLayers_(psf.kappaLayers_), contactRes_(psf.contactRes_), @@ -182,6 +182,7 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs() UPstream::msgType() = oldTag+1; // Get the coupling information from the mappedPatchBase + const label patchi = patch().index(); const mappedPatchBase& mpp = refCast(patch().patch()); const polyMesh& nbrMesh = mpp.sampleMesh(); @@ -219,17 +220,17 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs() scalarField KDelta(kappa(Tp)*patch().deltaCoeffs()); - scalarField Qr(Tp.size(), 0.0); - if (QrName_ != "none") + scalarField qr(Tp.size(), 0.0); + if (qrName_ != "none") { - Qr = patch().lookupPatchField(QrName_); + qr = patch().lookupPatchField(qrName_); } - scalarField QrNbr(Tp.size(), 0.0); - if (QrNbrName_ != "none") + scalarField qrNbr(Tp.size(), 0.0); + if (qrNbrName_ != "none") { - QrNbr = nbrPatch.lookupPatchField(QrNbrName_); - mpp.distribute(QrNbr); + qrNbr = nbrPatch.lookupPatchField(qrNbrName_); + mpp.distribute(qrNbr); } // inertia therm @@ -244,10 +245,15 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs() if (thermo) { + const scalarField& ppn = + thermo->p().boundaryField()[samplePatchi]; + const scalarField& Tpn = + thermo->T().boundaryField()[samplePatchi]; + mCpDtNbr = ( - thermo->Cp()().boundaryField()[nbrPatch.index()] - * thermo->rho()().boundaryField()[nbrPatch.index()] + thermo->Cp(ppn, Tpn, samplePatchi) + * thermo->rho(samplePatchi) / nbrPatch.deltaCoeffs()/dt ); @@ -268,10 +274,12 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs() if (thermo) { + const scalarField& pp = thermo->p().boundaryField()[patchi]; + mCpDt = ( - thermo->rho()().boundaryField()[patch().index()] - * thermo->Cp()().boundaryField()[patch().index()] + thermo->Cp(pp, Tp, patchi) + * thermo->rho(patchi) / patch().deltaCoeffs()/dt ); } @@ -288,21 +296,20 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs() this->internalField().name() ); - const fvPatchField& TpOld = - T.oldTime().boundaryField()[patch().index()]; + const fvPatchField& TpOld = T.oldTime().boundaryField()[patchi]; scalarField alpha(KDeltaNbr + mCpDt + mCpDtNbr); valueFraction() = alpha/(alpha + KDelta); scalarField c(KDeltaNbr*TcNbr + (mCpDt + mCpDtNbr)*TpOld); refValue() = c/alpha; - refGrad() = (Qr + QrNbr)/kappa(Tp); + refGrad() = (qr + qrNbr)/kappa(Tp); } else { valueFraction() = KDeltaNbr/(KDeltaNbr + KDelta); refValue() = TcNbr; - refGrad() = (Qr + QrNbr)/kappa(Tp); + refGrad() = (qr + qrNbr)/kappa(Tp); } mixedFvPatchScalarField::updateCoeffs(); @@ -337,8 +344,8 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::write { mixedFvPatchScalarField::write(os); os.writeKeyword("Tnbr")<< TnbrName_ << token::END_STATEMENT << nl; - os.writeKeyword("QrNbr")<< QrNbrName_ << token::END_STATEMENT << nl; - os.writeKeyword("Qr")<< QrName_ << token::END_STATEMENT << nl; + os.writeKeyword("qrNbr")<< qrNbrName_ << token::END_STATEMENT << nl; + os.writeKeyword("qr")<< qrName_ << token::END_STATEMENT << nl; os.writeEntry("thermalInertia", thermalInertia_); thicknessLayers_.writeEntry("thicknessLayers", os); diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.H b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.H index 1efecea9d0..a28a965bf1 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.H +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd ------------------------------------------------------------------------------- License @@ -38,8 +38,8 @@ Usage \table Property | Description | Required | Default value Tnbr | name of the field | no | T - QrNbr | name of the radiative flux in the nbr region | no | none - Qr | name of the radiative flux in this region | no | none + qrNbr | name of the radiative flux in the nbr region | no | none + qr | name of the radiative flux in this region | no | none thicknessLayers | list of thicknesses per layer [m] | no | kappaLayers | list of thermal conductivites per layer [W/m/K] | no | kappaMethod | inherited from temperatureCoupledBase | inherited | @@ -53,8 +53,8 @@ Usage { type compressible::turbulentTemperatureRadCoupledMixed; Tnbr T; - QrNbr Qr; // or none. Name of Qr field on neighbour region - Qr Qr; // or none. Name of Qr field on local region + qrNbr qr; // or none. Name of qr field on neighbour region + qr qr; // or none. Name of qr field on local region thicknessLayers (0.1 0.2 0.3 0.4); kappaLayers (1 2 3 4); thermalInertia false/true; @@ -103,10 +103,10 @@ class turbulentTemperatureRadCoupledMixedFvPatchScalarField const word TnbrName_; //- Name of the radiative heat flux in the neighbout region - const word QrNbrName_; + const word qrNbrName_; //- Name of the radiative heat flux in local region - const word QrName_; + const word qrName_; //- Thickness of layers scalarList thicknessLayers_; diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.H b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.H.orig similarity index 52% rename from src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.H rename to src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.H.orig index a19de4fff8..9b725409dc 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.H +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.H.orig @@ -2,8 +2,13 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | +<<<<<<< HEAD \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd +======= + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | +>>>>>>> d2a62df7c ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -22,12 +27,14 @@ License along with OpenFOAM. If not, see . Class - Foam::compressible::turbulentHeatFluxTemperatureFvPatchScalarField + Foam::compressible:: + turbulentTemperatureRadCoupledMixedFvPatchScalarField Description - Fixed heat boundary condition to specify temperature gradient. Input - heat source either specified in terms of an absolute power [W], or as a - flux [W/m^2]. + Mixed boundary condition for temperature and radiation heat transfer + to be used for in multiregion cases. Optional thin thermal layer + resistances can be specified through thicknessLayers and kappaLayers + entries. The thermal conductivity \c kappa can either be retrieved from various possible sources, as detailed in the class temperatureCoupledBase. @@ -35,43 +42,49 @@ Description Usage \table Property | Description | Required | Default value - heatSource | 'power' [W] or 'flux' [W/m^2] | yes | - q | heat power or flux field | yes | - Qr | name of the radiative flux field | yes | - value | initial temperature value | no | calculated - gradient | initial gradient value | no | 0.0 + Tnbr | name of the field | no | T + qrNbr | name of the radiative flux in the nbr region | no | none + qr | name of the radiative flux in this region | no | none + thicknessLayers | list of thicknesses per layer [m] | no | + kappaLayers | list of thermal conductivites per layer [W/m/K] | no | kappaMethod | inherited from temperatureCoupledBase | inherited | kappa | inherited from temperatureCoupledBase | inherited | + thermalInertia | Add thermal inertia to wall node | no | false \endtable - Note: If needed, both 'value' and 'gradient' must be defined to be used. - - Example usage: + Example of the boundary condition specification: \verbatim - hotWall + { - type compressible::turbulentHeatFluxTemperature; - heatSource flux; - q uniform 10; - kappaMethod fluidThermo; - kappa none; - Qr none; + type compressible::turbulentTemperatureRadCoupledMixed; + Tnbr T; + qrNbr qr; // or none. Name of qr field on neighbour region + qr qr; // or none. Name of qr field on local region + thicknessLayers (0.1 0.2 0.3 0.4); + kappaLayers (1 2 3 4); + thermalInertia false/true; + kappaMethod lookup; + kappa kappa; + value uniform 300; } \endverbatim + Needs to be on underlying mapped(Wall)FvPatch. + See also Foam::temperatureCoupledBase SourceFiles - turbulentHeatFluxTemperatureFvPatchScalarField.C + turbulentTemperatureRadCoupledMixedFvPatchScalarField.C \*---------------------------------------------------------------------------*/ -#ifndef turbulentHeatFluxTemperatureFvPatchScalarFields_H -#define turbulentHeatFluxTemperatureFvPatchScalarFields_H +#ifndef turbulentTemperatureRadCoupledMixedFvPatchScalarField_H +#define turbulentTemperatureRadCoupledMixedFvPatchScalarField_H -#include "fixedGradientFvPatchFields.H" +#include "mixedFvPatchFields.H" #include "temperatureCoupledBase.H" +#include "scalarList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -81,60 +94,55 @@ namespace compressible { /*---------------------------------------------------------------------------*\ - Class turbulentHeatFluxTemperatureFvPatchScalarField Declaration + Class turbulentTemperatureRadCoupledMixedFvPatchScalarField Declaration \*---------------------------------------------------------------------------*/ -class turbulentHeatFluxTemperatureFvPatchScalarField +class turbulentTemperatureRadCoupledMixedFvPatchScalarField : - public fixedGradientFvPatchScalarField, + public mixedFvPatchScalarField, public temperatureCoupledBase { -public: - - // Data types - - //- Enumeration listing the possible hest source input modes - enum heatSourceType - { - hsPower, - hsFlux - }; - - -private: - // Private data - //- Heat source type names - static const NamedEnum heatSourceTypeNames_; + //- Name of field on the neighbour region + const word TnbrName_; - //- Heat source type - heatSourceType heatSource_; + //- Name of the radiative heat flux in the neighbout region + const word qrNbrName_; - //- Heat power [W] or flux [W/m2] - scalarField q_; + //- Name of the radiative heat flux in local region + const word qrName_; - //- Name of radiative in flux field - word QrName_; + //- Thickness of layers + scalarList thicknessLayers_; + + //- Conductivity of layers + scalarList kappaLayers_; + + //- Total contact resistance + scalar contactRes_; + + //- Thermal inertia term + Switch thermalInertia_; public: //- Runtime type information - TypeName("compressible::turbulentHeatFluxTemperature"); + TypeName("compressible::turbulentTemperatureRadCoupledMixed"); // Constructors //- Construct from patch and internal field - turbulentHeatFluxTemperatureFvPatchScalarField + turbulentTemperatureRadCoupledMixedFvPatchScalarField ( const fvPatch&, const DimensionedField& ); //- Construct from patch, internal field and dictionary - turbulentHeatFluxTemperatureFvPatchScalarField + turbulentTemperatureRadCoupledMixedFvPatchScalarField ( const fvPatch&, const DimensionedField&, @@ -142,35 +150,33 @@ public: ); //- Construct by mapping given - // turbulentHeatFluxTemperatureFvPatchScalarField onto - // a new patch - turbulentHeatFluxTemperatureFvPatchScalarField + // turbulentTemperatureCoupledBaffleMixedFvPatchScalarField onto a + // new patch + turbulentTemperatureRadCoupledMixedFvPatchScalarField ( - const turbulentHeatFluxTemperatureFvPatchScalarField&, + const + turbulentTemperatureRadCoupledMixedFvPatchScalarField&, const fvPatch&, const DimensionedField&, const fvPatchFieldMapper& ); - //- Construct as copy - turbulentHeatFluxTemperatureFvPatchScalarField - ( - const turbulentHeatFluxTemperatureFvPatchScalarField& - ); - //- Construct and return a clone virtual tmp clone() const { return tmp ( - new turbulentHeatFluxTemperatureFvPatchScalarField(*this) + new turbulentTemperatureRadCoupledMixedFvPatchScalarField + ( + *this + ) ); } //- Construct as copy setting internal field reference - turbulentHeatFluxTemperatureFvPatchScalarField + turbulentTemperatureRadCoupledMixedFvPatchScalarField ( - const turbulentHeatFluxTemperatureFvPatchScalarField&, + const turbulentTemperatureRadCoupledMixedFvPatchScalarField&, const DimensionedField& ); @@ -182,7 +188,7 @@ public: { return tmp ( - new turbulentHeatFluxTemperatureFvPatchScalarField + new turbulentTemperatureRadCoupledMixedFvPatchScalarField ( *this, iF @@ -193,29 +199,11 @@ public: // Member functions - // Mapping functions + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); - //- Map (and resize as needed) from self given a mapping object - virtual void autoMap(const fvPatchFieldMapper&); - - //- Reverse map the given fvPatchField onto this fvPatchField - virtual void rmap - ( - const fvPatchScalarField&, - const labelList& - ); - - - // Evaluation functions - - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); - - - // I-O - - //- Write - virtual void write(Ostream&) const; + //- Write + virtual void write(Ostream&) const; }; diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C b/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C index c5cc7ebdb7..0ff6266737 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESModel/LESModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -32,7 +32,7 @@ void Foam::LESModel::printCoeffs(const word& type) { if (printCoeffs_) { - Info<< type << "Coeffs" << coeffDict_ << endl; + Info<< coeffDict_.dictName() << coeffDict_ << endl; } } @@ -67,7 +67,7 @@ Foam::LESModel::LESModel LESDict_(this->subOrEmptyDict("LES")), turbulence_(LESDict_.lookup("turbulence")), printCoeffs_(LESDict_.lookupOrDefault("printCoeffs", false)), - coeffDict_(LESDict_.subOrEmptyDict(type + "Coeffs")), + coeffDict_(LESDict_.optionalSubDict(type + "Coeffs")), kMin_ ( @@ -183,10 +183,7 @@ bool Foam::LESModel::read() LESDict_ <<= this->subDict("LES"); LESDict_.lookup("turbulence") >> turbulence_; - if (const dictionary* dictPtr = LESDict_.subDictPtr(type() + "Coeffs")) - { - coeffDict_ <<= *dictPtr; - } + coeffDict_ <<= LESDict_.optionalSubDict(type() + "Coeffs"); delta_().read(LESDict_); diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/IDDESDelta/IDDESDelta.C b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/IDDESDelta/IDDESDelta.C index f23ee3f528..c7e478ebce 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/IDDESDelta/IDDESDelta.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/IDDESDelta/IDDESDelta.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. ------------------------------------------------------------------------------- License @@ -151,7 +151,11 @@ Foam::LESModels::IDDESDelta::IDDESDelta ), Cw_ ( - dict.subDict(type() + "Coeffs").lookupOrDefault("Cw", 0.15) + dict.optionalSubDict(type() + "Coeffs").lookupOrDefault + ( + "Cw", + 0.15 + ) ) { calcDelta(); @@ -162,7 +166,7 @@ Foam::LESModels::IDDESDelta::IDDESDelta void Foam::LESModels::IDDESDelta::read(const dictionary& dict) { - const dictionary& coeffsDict(dict.subDict(type() + "Coeffs")); + const dictionary& coeffsDict(dict.optionalSubDict(type() + "Coeffs")); coeffsDict.readIfPresent("Cw", Cw_); diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/PrandtlDelta/PrandtlDelta.C b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/PrandtlDelta/PrandtlDelta.C index d2b9f762b4..f09e9c240b 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/PrandtlDelta/PrandtlDelta.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/PrandtlDelta/PrandtlDelta.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -67,13 +67,17 @@ Foam::LESModels::PrandtlDelta::PrandtlDelta ( name, turbulence, - dict.subDict(type() + "Coeffs") + dict.optionalSubDict(type() + "Coeffs") ) ), kappa_(dict.lookupOrDefault("kappa", 0.41)), Cdelta_ ( - dict.subDict(type() + "Coeffs").lookupOrDefault("Cdelta", 0.158) + dict.optionalSubDict(type() + "Coeffs").lookupOrDefault + ( + "Cdelta", + 0.158 + ) ) { calcDelta(); @@ -84,7 +88,7 @@ Foam::LESModels::PrandtlDelta::PrandtlDelta void Foam::LESModels::PrandtlDelta::read(const dictionary& dict) { - const dictionary& coeffDict(dict.subDict(type() + "Coeffs")); + const dictionary& coeffDict(dict.optionalSubDict(type() + "Coeffs")); geometricDelta_().read(coeffDict); dict.readIfPresent("kappa", kappa_); diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/cubeRootVolDelta/cubeRootVolDelta.C b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/cubeRootVolDelta/cubeRootVolDelta.C index 16bfdc9f32..5b88de32cd 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/cubeRootVolDelta/cubeRootVolDelta.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/cubeRootVolDelta/cubeRootVolDelta.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. ------------------------------------------------------------------------------- License @@ -94,7 +94,11 @@ Foam::LESModels::cubeRootVolDelta::cubeRootVolDelta LESdelta(name, turbulence), deltaCoeff_ ( - dict.subDict(type() + "Coeffs").lookupOrDefault("deltaCoeff", 1) + dict.optionalSubDict(type() + "Coeffs").lookupOrDefault + ( + "deltaCoeff", + 1 + ) ) { calcDelta(); @@ -105,7 +109,7 @@ Foam::LESModels::cubeRootVolDelta::cubeRootVolDelta void Foam::LESModels::cubeRootVolDelta::read(const dictionary& dict) { - dict.subDict(type() + "Coeffs").readIfPresent + dict.optionalSubDict(type() + "Coeffs").readIfPresent ( "deltaCoeff", deltaCoeff_ diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/maxDeltaxyz/maxDeltaxyz.C b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/maxDeltaxyz/maxDeltaxyz.C index 6aa84d132f..351d0fb11f 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/maxDeltaxyz/maxDeltaxyz.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/maxDeltaxyz/maxDeltaxyz.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. ------------------------------------------------------------------------------- License @@ -110,7 +110,11 @@ Foam::LESModels::maxDeltaxyz::maxDeltaxyz LESdelta(name, turbulence), deltaCoeff_ ( - dict.subDict(type() + "Coeffs").lookupOrDefault("deltaCoeff", 1) + dict.optionalSubDict(type() + "Coeffs").lookupOrDefault + ( + "deltaCoeff", + 1 + ) ) { calcDelta(); @@ -121,7 +125,7 @@ Foam::LESModels::maxDeltaxyz::maxDeltaxyz void Foam::LESModels::maxDeltaxyz::read(const dictionary& dict) { - const dictionary& coeffsDict(dict.subDict(type() + "Coeffs")); + const dictionary& coeffsDict(dict.optionalSubDict(type() + "Coeffs")); coeffsDict.readIfPresent("deltaCoeff", deltaCoeff_); diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/smoothDelta/smoothDelta.C b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/smoothDelta/smoothDelta.C index b887782911..a93225c735 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/smoothDelta/smoothDelta.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/smoothDelta/smoothDelta.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. ------------------------------------------------------------------------------- License @@ -156,12 +156,15 @@ Foam::LESModels::smoothDelta::smoothDelta ( "geometricDelta", turbulence, - dict.subDict(type() + "Coeffs") + dict.optionalSubDict(type() + "Coeffs") ) ), maxDeltaRatio_ ( - readScalar(dict.subDict(type() + "Coeffs").lookup("maxDeltaRatio")) + readScalar + ( + dict.optionalSubDict(type() + "Coeffs").lookup("maxDeltaRatio") + ) ) { calcDelta(); @@ -172,7 +175,7 @@ Foam::LESModels::smoothDelta::smoothDelta void Foam::LESModels::smoothDelta::read(const dictionary& dict) { - const dictionary& coeffsDict(dict.subDict(type() + "Coeffs")); + const dictionary& coeffsDict(dict.optionalSubDict(type() + "Coeffs")); geometricDelta_().read(coeffsDict); coeffsDict.lookup("maxDeltaRatio") >> maxDeltaRatio_; diff --git a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/vanDriestDelta/vanDriestDelta.C b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/vanDriestDelta/vanDriestDelta.C index 97effadd45..05b1774c2f 100644 --- a/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/vanDriestDelta/vanDriestDelta.C +++ b/src/TurbulenceModels/turbulenceModels/LES/LESdeltas/vanDriestDelta/vanDriestDelta.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -108,21 +108,29 @@ Foam::LESModels::vanDriestDelta::vanDriestDelta ( IOobject::groupName("geometricDelta", turbulence.U().group()), turbulence, - dict.subDict(type() + "Coeffs") + dict.optionalSubDict(type() + "Coeffs") ) ), kappa_(dict.lookupOrDefault("kappa", 0.41)), Aplus_ ( - dict.subDict(type() + "Coeffs").lookupOrDefault("Aplus", 26.0) + dict.optionalSubDict(type() + "Coeffs").lookupOrDefault + ( + "Aplus", + 26.0 + ) ), Cdelta_ ( - dict.subDict(type() + "Coeffs").lookupOrDefault("Cdelta", 0.158) + dict.optionalSubDict(type() + "Coeffs").lookupOrDefault + ( + "Cdelta", + 0.158 + ) ), calcInterval_ ( - dict.subDict(type() + "Coeffs").lookupOrDefault