From bbd6bfff22d63b065e258eccae4f074314970064 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Fri, 22 Apr 2016 14:21:50 +0100 Subject: [PATCH 001/581] foamCalcFunctions: Avoid the inclusion of fvCFD.H --- .../postProcessing/foamCalc/foamCalcApp.C | 4 ++- .../basic/addSubtract/writeAddSubtractValue.C | 8 ++++-- .../foamCalcFunctions/calcType/calcType.C | 26 +++++++------------ .../foamCalcFunctions/calcType/calcType.H | 7 +++-- .../field/components/writeComponentFields.C | 8 ++++-- .../field/div/writeDivField.C | 8 ++++-- .../field/interpolate/writeInterpolateField.C | 8 ++++-- .../field/mag/writeMagField.C | 8 ++++-- .../field/magGrad/writeMagGradField.C | 8 ++++-- .../field/magSqr/writeMagSqrField.C | 8 ++++-- .../field/randomise/writeRandomField.C | 8 ++++-- 11 files changed, 64 insertions(+), 37 deletions(-) diff --git a/applications/utilities/postProcessing/foamCalc/foamCalcApp.C b/applications/utilities/postProcessing/foamCalc/foamCalcApp.C index 0a24afc131..2ac25d8e5d 100644 --- a/applications/utilities/postProcessing/foamCalc/foamCalcApp.C +++ b/applications/utilities/postProcessing/foamCalc/foamCalcApp.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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -38,6 +38,8 @@ Description #include "timeSelector.H" #include "calcType.H" +using namespace Foam; + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main(int argc, char *argv[]) diff --git a/src/postProcessing/foamCalcFunctions/basic/addSubtract/writeAddSubtractValue.C b/src/postProcessing/foamCalcFunctions/basic/addSubtract/writeAddSubtractValue.C index 8bded09490..b1ec01bdd9 100644 --- a/src/postProcessing/foamCalcFunctions/basic/addSubtract/writeAddSubtractValue.C +++ b/src/postProcessing/foamCalcFunctions/basic/addSubtract/writeAddSubtractValue.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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,6 +23,10 @@ License \*---------------------------------------------------------------------------*/ +#include "volFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + template void Foam::calcTypes::addSubtract::writeAddSubtractValue ( @@ -86,4 +90,4 @@ void Foam::calcTypes::addSubtract::writeAddSubtractValue } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// ************************************************************************* // diff --git a/src/postProcessing/foamCalcFunctions/calcType/calcType.C b/src/postProcessing/foamCalcFunctions/calcType/calcType.C index 9aceab5da3..b78de6d993 100644 --- a/src/postProcessing/foamCalcFunctions/calcType/calcType.C +++ b/src/postProcessing/foamCalcFunctions/calcType/calcType.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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -27,9 +27,11 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -defineTypeNameAndDebug(calcType, 0); - -defineRunTimeSelectionTable(calcType, dictionary); +namespace Foam +{ + defineTypeNameAndDebug(calcType, 0); + defineRunTimeSelectionTable(calcType, dictionary); +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -47,9 +49,7 @@ Foam::calcType::~calcType() // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // void Foam::calcType::init() -{ - // Do nothing -} +{} void Foam::calcType::preCalc @@ -58,9 +58,7 @@ void Foam::calcType::preCalc const Time& runTime, const fvMesh& mesh ) -{ - // Do nothing -} +{} void Foam::calcType::calc @@ -69,9 +67,7 @@ void Foam::calcType::calc const Time& runTime, const fvMesh& mesh ) -{ - // Do nothing -} +{} void Foam::calcType::postCalc @@ -80,9 +76,7 @@ void Foam::calcType::postCalc const Time& runTime, const fvMesh& mesh ) -{ - // Do nothing -} +{} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // diff --git a/src/postProcessing/foamCalcFunctions/calcType/calcType.H b/src/postProcessing/foamCalcFunctions/calcType/calcType.H index 4519eb61a1..33ae4da26a 100644 --- a/src/postProcessing/foamCalcFunctions/calcType/calcType.H +++ b/src/postProcessing/foamCalcFunctions/calcType/calcType.H @@ -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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -42,11 +42,10 @@ SourceFiles #ifndef calcType_H #define calcType_H -#include "autoPtr.H" +#include "argList.H" +#include "fvMesh.H" #include "runTimeSelectionTables.H" -#include "fvCFD.H" - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam diff --git a/src/postProcessing/foamCalcFunctions/field/components/writeComponentFields.C b/src/postProcessing/foamCalcFunctions/field/components/writeComponentFields.C index 866952afa7..82b234f60f 100644 --- a/src/postProcessing/foamCalcFunctions/field/components/writeComponentFields.C +++ b/src/postProcessing/foamCalcFunctions/field/components/writeComponentFields.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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,6 +23,10 @@ License \*---------------------------------------------------------------------------*/ +#include "volFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + template void Foam::calcTypes::components::writeComponentFields ( @@ -62,4 +66,4 @@ void Foam::calcTypes::components::writeComponentFields } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// ************************************************************************* // diff --git a/src/postProcessing/foamCalcFunctions/field/div/writeDivField.C b/src/postProcessing/foamCalcFunctions/field/div/writeDivField.C index 75fa73f5ca..9cb87d180f 100644 --- a/src/postProcessing/foamCalcFunctions/field/div/writeDivField.C +++ b/src/postProcessing/foamCalcFunctions/field/div/writeDivField.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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,6 +23,10 @@ License \*---------------------------------------------------------------------------*/ +#include "fvcDiv.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + template void Foam::calcTypes::div::writeDivField ( @@ -55,4 +59,4 @@ void Foam::calcTypes::div::writeDivField } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// ************************************************************************* // diff --git a/src/postProcessing/foamCalcFunctions/field/interpolate/writeInterpolateField.C b/src/postProcessing/foamCalcFunctions/field/interpolate/writeInterpolateField.C index 87ae342696..31d4f45373 100644 --- a/src/postProcessing/foamCalcFunctions/field/interpolate/writeInterpolateField.C +++ b/src/postProcessing/foamCalcFunctions/field/interpolate/writeInterpolateField.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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,6 +23,10 @@ License \*---------------------------------------------------------------------------*/ +#include "surfaceInterpolate.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + template void Foam::calcTypes::interpolate::writeInterpolateField ( @@ -58,4 +62,4 @@ void Foam::calcTypes::interpolate::writeInterpolateField } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// ************************************************************************* // diff --git a/src/postProcessing/foamCalcFunctions/field/mag/writeMagField.C b/src/postProcessing/foamCalcFunctions/field/mag/writeMagField.C index 9246dd1f54..e33c0a9837 100644 --- a/src/postProcessing/foamCalcFunctions/field/mag/writeMagField.C +++ b/src/postProcessing/foamCalcFunctions/field/mag/writeMagField.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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,6 +23,10 @@ License \*---------------------------------------------------------------------------*/ +#include "fvcGrad.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + template void Foam::calcTypes::mag::writeMagField ( @@ -57,4 +61,4 @@ void Foam::calcTypes::mag::writeMagField } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// ************************************************************************* // diff --git a/src/postProcessing/foamCalcFunctions/field/magGrad/writeMagGradField.C b/src/postProcessing/foamCalcFunctions/field/magGrad/writeMagGradField.C index 1c47ad1f8e..cfc9ccc6cb 100644 --- a/src/postProcessing/foamCalcFunctions/field/magGrad/writeMagGradField.C +++ b/src/postProcessing/foamCalcFunctions/field/magGrad/writeMagGradField.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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,6 +23,10 @@ License \*---------------------------------------------------------------------------*/ +#include "fvcGrad.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + template void Foam::calcTypes::magGrad::writeMagGradField ( @@ -57,4 +61,4 @@ void Foam::calcTypes::magGrad::writeMagGradField } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// ************************************************************************* // diff --git a/src/postProcessing/foamCalcFunctions/field/magSqr/writeMagSqrField.C b/src/postProcessing/foamCalcFunctions/field/magSqr/writeMagSqrField.C index b61be63cb9..22a56292af 100644 --- a/src/postProcessing/foamCalcFunctions/field/magSqr/writeMagSqrField.C +++ b/src/postProcessing/foamCalcFunctions/field/magSqr/writeMagSqrField.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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,6 +23,10 @@ License \*---------------------------------------------------------------------------*/ +#include "volFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + template void Foam::calcTypes::magSqr::writeMagSqrField ( @@ -57,4 +61,4 @@ void Foam::calcTypes::magSqr::writeMagSqrField } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// ************************************************************************* // diff --git a/src/postProcessing/foamCalcFunctions/field/randomise/writeRandomField.C b/src/postProcessing/foamCalcFunctions/field/randomise/writeRandomField.C index 0c024aa136..df9beed0ef 100644 --- a/src/postProcessing/foamCalcFunctions/field/randomise/writeRandomField.C +++ b/src/postProcessing/foamCalcFunctions/field/randomise/writeRandomField.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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,6 +23,10 @@ License \*---------------------------------------------------------------------------*/ +#include "volFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + template void Foam::calcTypes::randomise::writeRandomField ( @@ -69,4 +73,4 @@ void Foam::calcTypes::randomise::writeRandomField } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// ************************************************************************* // From bbca1fd5e7a30009882dbcbeb751ac6dc5e48b13 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Fri, 22 Apr 2016 14:25:58 +0100 Subject: [PATCH 002/581] reactingTwoPhaseEulerFoam: Corrected kineticTheory frictional stress at walls Patch contributed by Juho Peltola, VTT The new JohnsonJacksonSchaefferFrictionalStress model is included and the LBend tutorial case to demonstrate the need for the changes to the frictional stress models. Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=2058 --- .../ThermalPhaseChangePhaseSystem.C | 4 +- .../Make/files | 1 + ...sonJacksonParticleSlipFvPatchVectorField.C | 10 +- .../JohnsonJacksonFrictionalStress.C | 23 +- .../JohnsonJacksonFrictionalStress.H | 8 +- .../JohnsonJacksonSchaefferFrictionalStress.C | 216 ++++++++++++++++++ .../JohnsonJacksonSchaefferFrictionalStress.H | 131 +++++++++++ .../Schaeffer/SchaefferFrictionalStress.C | 51 +++-- .../Schaeffer/SchaefferFrictionalStress.H | 8 +- .../frictionalStressModel.H | 9 +- .../kineticTheoryModel/kineticTheoryModel.C | 36 ++- .../kineticTheoryModel/kineticTheoryModel.H | 6 + .../RAS/LBend/0/T.gas | 48 ++++ .../RAS/LBend/0/T.solids | 47 ++++ .../RAS/LBend/0/Theta.solids | 52 +++++ .../RAS/LBend/0/U.gas | 48 ++++ .../RAS/LBend/0/U.solids | 51 +++++ .../RAS/LBend/0/alpha.solids | 45 ++++ .../RAS/LBend/0/alphat.gas | 48 ++++ .../RAS/LBend/0/alphat.solids | 47 ++++ .../RAS/LBend/0/epsilon.gas | 49 ++++ .../RAS/LBend/0/k.gas | 49 ++++ .../RAS/LBend/0/nut.gas | 47 ++++ .../RAS/LBend/0/nut.solids | 47 ++++ .../reactingTwoPhaseEulerFoam/RAS/LBend/0/p | 47 ++++ .../RAS/LBend/0/p_rgh | 51 +++++ .../RAS/LBend/constant/g | 22 ++ .../RAS/LBend/constant/phaseProperties | 119 ++++++++++ .../constant/thermophysicalProperties.gas | 53 +++++ .../constant/thermophysicalProperties.solids | 53 +++++ .../LBend/constant/turbulenceProperties.gas | 44 ++++ .../constant/turbulenceProperties.solids | 50 ++++ .../RAS/LBend/system/blockMeshDict | 128 +++++++++++ .../RAS/LBend/system/controlDict | 55 +++++ .../RAS/LBend/system/fvSchemes | 74 ++++++ .../RAS/LBend/system/fvSolution | 111 +++++++++ 36 files changed, 1839 insertions(+), 49 deletions(-) create mode 100644 applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.C create mode 100644 applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.H create mode 100644 tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/T.gas create mode 100644 tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/T.solids create mode 100644 tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/Theta.solids create mode 100644 tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/U.gas create mode 100644 tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/U.solids create mode 100644 tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/alpha.solids create mode 100644 tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/alphat.gas create mode 100644 tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/alphat.solids create mode 100644 tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/epsilon.gas create mode 100644 tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/k.gas create mode 100644 tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/nut.gas create mode 100644 tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/nut.solids create mode 100644 tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/p create mode 100644 tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/p_rgh create mode 100644 tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/constant/g create mode 100644 tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/constant/phaseProperties create mode 100644 tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/constant/thermophysicalProperties.gas create mode 100644 tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/constant/thermophysicalProperties.solids create mode 100644 tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/constant/turbulenceProperties.gas create mode 100644 tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/constant/turbulenceProperties.solids create mode 100644 tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/system/blockMeshDict create mode 100644 tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/system/controlDict create mode 100644 tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/system/fvSchemes create mode 100644 tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/system/fvSolution diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.C index 8950f3d958..ff1e0b0998 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/PhaseSystems/ThermalPhaseChangePhaseSystem/ThermalPhaseChangePhaseSystem.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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,8 +24,8 @@ License \*---------------------------------------------------------------------------*/ #include "ThermalPhaseChangePhaseSystem.H" -#include "fvCFD.H" #include "alphatPhaseChangeWallFunctionFvPatchScalarField.H" +#include "fvcVolumeIntegrate.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/Make/files b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/Make/files index 300e1902a9..fb9a8d1042 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/Make/files +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/Make/files @@ -31,6 +31,7 @@ kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStress kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C +kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.C kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleTheta/JohnsonJacksonParticleThetaFvPatchScalarField.C kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C index 4aa484cb5f..04715ecbe7 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/derivedFvPatchFields/JohnsonJacksonParticleSlip/JohnsonJacksonParticleSlipFvPatchVectorField.C @@ -190,6 +190,14 @@ void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::updateCoeffs() ) ); + const scalarField nuFric + ( + patch().lookupPatchField + ( + IOobject::groupName("nuFric", phased.name()) + ) + ); + word ThetaName(IOobject::groupName("Theta", phased.name())); const fvPatchScalarField& Theta @@ -222,7 +230,7 @@ void Foam::JohnsonJacksonParticleSlipFvPatchVectorField::updateCoeffs() *gs0 *specularityCoefficient_.value() *sqrt(3.0*Theta) - /max(6.0*nu*alphaMax.value(), SMALL) + /max(6.0*(nu - nuFric)*alphaMax.value(), SMALL) ); this->valueFraction() = c/(c + patch().deltaCoeffs()); 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 ab5fb531ea..ab6d3d354a 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-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -81,15 +81,16 @@ Foam::tmp Foam::kineticTheoryModels::frictionalStressModels::JohnsonJackson:: frictionalPressure ( - const volScalarField& alpha1, + const phaseModel& phase, const dimensionedScalar& alphaMinFriction, const dimensionedScalar& alphaMax ) const { + const volScalarField& alpha = phase; return - Fr_*pow(max(alpha1 - alphaMinFriction, scalar(0)), eta_) - /pow(max(alphaMax - alpha1, alphaDeltaMin_), p_); + Fr_*pow(max(alpha - alphaMinFriction, scalar(0)), eta_) + /pow(max(alphaMax - alpha, alphaDeltaMin_), p_); } @@ -97,24 +98,26 @@ Foam::tmp Foam::kineticTheoryModels::frictionalStressModels::JohnsonJackson:: frictionalPressurePrime ( - const volScalarField& alpha1, + const phaseModel& phase, const dimensionedScalar& alphaMinFriction, const dimensionedScalar& alphaMax ) const { + const volScalarField& alpha = phase; + return Fr_* ( - eta_*pow(max(alpha1 - alphaMinFriction, scalar(0)), eta_ - 1.0) - *(alphaMax-alpha1) - + p_*pow(max(alpha1 - alphaMinFriction, scalar(0)), eta_) - )/pow(max(alphaMax - alpha1, alphaDeltaMin_), p_ + 1.0); + eta_*pow(max(alpha - alphaMinFriction, scalar(0)), eta_ - 1.0) + *(alphaMax-alpha) + + p_*pow(max(alpha - alphaMinFriction, scalar(0)), eta_) + )/pow(max(alphaMax - alpha, alphaDeltaMin_), p_ + 1.0); } Foam::tmp Foam::kineticTheoryModels::frictionalStressModels::JohnsonJackson::nu ( - const volScalarField& alpha1, + const phaseModel& phase, const dimensionedScalar& alphaMinFriction, const dimensionedScalar& alphaMax, const volScalarField& pf, diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.H index 1fe92e7d0e..3013fc25ef 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.H @@ -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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -93,21 +93,21 @@ public: virtual tmp frictionalPressure ( - const volScalarField& alpha1, + const phaseModel& phase, const dimensionedScalar& alphaMinFriction, const dimensionedScalar& alphaMax ) const; virtual tmp frictionalPressurePrime ( - const volScalarField& alpha1, + const phaseModel& phase, const dimensionedScalar& alphaMinFriction, const dimensionedScalar& alphaMax ) const; virtual tmp nu ( - const volScalarField& alpha1, + const phaseModel& phase, const dimensionedScalar& alphaMinFriction, const dimensionedScalar& alphaMax, const volScalarField& pf, 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 new file mode 100644 index 0000000000..4f05634d6f --- /dev/null +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.C @@ -0,0 +1,216 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "JohnsonJacksonSchaefferFrictionalStress.H" +#include "addToRunTimeSelectionTable.H" +#include "mathematicalConstants.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ +namespace frictionalStressModels +{ + defineTypeNameAndDebug(JohnsonJacksonSchaeffer, 0); + + addToRunTimeSelectionTable + ( + frictionalStressModel, + JohnsonJacksonSchaeffer, + dictionary + ); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::frictionalStressModels:: +JohnsonJacksonSchaeffer::JohnsonJacksonSchaeffer +( + const dictionary& dict +) +: + frictionalStressModel(dict), + coeffDict_(dict.subDict(typeName + "Coeffs")), + Fr_("Fr", dimensionSet(1, -1, -2, 0, 0), coeffDict_), + eta_("eta", dimless, coeffDict_), + p_("p", dimless, coeffDict_), + phi_("phi", dimless, coeffDict_), + alphaDeltaMin_("alphaDeltaMin", dimless, coeffDict_) +{ + phi_ *= constant::mathematical::pi/180.0; +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::frictionalStressModels:: +JohnsonJacksonSchaeffer::~JohnsonJacksonSchaeffer() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp +Foam::kineticTheoryModels::frictionalStressModels:: +JohnsonJacksonSchaeffer::frictionalPressure +( + const phaseModel& phase, + const dimensionedScalar& alphaMinFriction, + const dimensionedScalar& alphaMax +) const +{ + const volScalarField& alpha = phase; + + return + Fr_*pow(max(alpha - alphaMinFriction, scalar(0)), eta_) + /pow(max(alphaMax - alpha, alphaDeltaMin_), p_); +} + + +Foam::tmp +Foam::kineticTheoryModels::frictionalStressModels:: +JohnsonJacksonSchaeffer::frictionalPressurePrime +( + const phaseModel& phase, + const dimensionedScalar& alphaMinFriction, + const dimensionedScalar& alphaMax +) const +{ + const volScalarField& alpha = phase; + + return Fr_* + ( + eta_*pow(max(alpha - alphaMinFriction, scalar(0)), eta_ - 1.0) + *(alphaMax-alpha) + + p_*pow(max(alpha - alphaMinFriction, scalar(0)), eta_) + )/pow(max(alphaMax - alpha, alphaDeltaMin_), p_ + 1.0); +} + + +Foam::tmp +Foam::kineticTheoryModels::frictionalStressModels:: +JohnsonJacksonSchaeffer::nu +( + const phaseModel& phase, + const dimensionedScalar& alphaMinFriction, + const dimensionedScalar& alphaMax, + const volScalarField& pf, + const volSymmTensorField& D +) const +{ + const volScalarField& alpha = phase; + const scalar I2Dsmall = 1.0e-15; + + tmp tnu + ( + new volScalarField + ( + IOobject + ( + "JohnsonJacksonSchaeffer:nu", + phase.mesh().time().timeName(), + phase.mesh(), + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + phase.mesh(), + dimensionedScalar("nu", dimensionSet(0, 2, -1, 0, 0), 0.0) + ) + ); + + volScalarField& nuf = tnu.ref(); + + forAll(D, celli) + { + if (alpha[celli] > alphaMinFriction.value()) + { + nuf[celli] = + 0.5*pf[celli]*sin(phi_.value()) + /( + sqrt + ( + 1.0/6.0 + *( + sqr(D[celli].xx() - D[celli].yy()) + + sqr(D[celli].yy() - D[celli].zz()) + + sqr(D[celli].zz() - D[celli].xx()) + ) + + sqr(D[celli].xy()) + sqr(D[celli].xz() + ) + + sqr(D[celli].yz())) + I2Dsmall + ); + } + } + + const fvPatchList& patches = phase.mesh().boundary(); + const volVectorField& U = phase.U(); + + forAll(patches, patchi) + { + if (!patches[patchi].coupled()) + { + nuf.boundaryField()[patchi] = + ( + pf.boundaryField()[patchi]*sin(phi_.value()) + /( + mag(U.boundaryField()[patchi].snGrad()) + + I2Dsmall + ) + ); + } + } + + // Correct coupled BCs + nuf.correctBoundaryConditions(); + + return tnu; +} + + +bool Foam::kineticTheoryModels::frictionalStressModels:: +JohnsonJacksonSchaeffer::read() +{ + coeffDict_ <<= dict_.subDict(typeName + "Coeffs"); + + Fr_.read(coeffDict_); + eta_.read(coeffDict_); + p_.read(coeffDict_); + + phi_.read(coeffDict_); + phi_ *= constant::mathematical::pi/180.0; + + alphaDeltaMin_.read(coeffDict_); + + return true; +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.H new file mode 100644 index 0000000000..2f8c971894 --- /dev/null +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.H @@ -0,0 +1,131 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::kineticTheoryModels::frictionalStressModels::JohnsonJacksonSchaeffer + +Description + +SourceFiles + JohnsonJacksonSchaefferFrictionalStress.C + +\*---------------------------------------------------------------------------*/ + +#ifndef JohnsonJacksonSchaeffer_H +#define JohnsonJacksonSchaeffer_H + +#include "frictionalStressModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ +namespace frictionalStressModels +{ + +/*---------------------------------------------------------------------------*\ + Class JohnsonJacksonSchaeffer Declaration +\*---------------------------------------------------------------------------*/ + +class JohnsonJacksonSchaeffer +: + public frictionalStressModel +{ + // Private data + + dictionary coeffDict_; + + //- Material constant for frictional normal stress + dimensionedScalar Fr_; + + //- Material constant for frictional normal stress + dimensionedScalar eta_; + + //- Material constant for frictional normal stress + dimensionedScalar p_; + + //- Angle of internal friction + dimensionedScalar phi_; + + //- Lower limit for (alphaMax - alpha1) + dimensionedScalar alphaDeltaMin_; + + +public: + + //- Runtime type information + TypeName("JohnsonJacksonSchaeffer"); + + + // Constructors + + //- Construct from components + JohnsonJacksonSchaeffer(const dictionary& dict); + + + //- Destructor + virtual ~JohnsonJacksonSchaeffer(); + + + // Member functions + + virtual tmp frictionalPressure + ( + const phaseModel& phase, + const dimensionedScalar& alphaMinFriction, + const dimensionedScalar& alphaMax + ) const; + + virtual tmp frictionalPressurePrime + ( + const phaseModel& phase, + const dimensionedScalar& alphaMinFriction, + const dimensionedScalar& alphaMax + ) const; + + virtual tmp nu + ( + const phaseModel& phase, + const dimensionedScalar& alphaMinFriction, + const dimensionedScalar& alphaMax, + const volScalarField& pf, + const volSymmTensorField& D + ) const; + + virtual bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace frictionalStressModels +} // End namespace kineticTheoryModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // 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 b88ec0923a..8c072802d1 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 @@ -74,14 +74,16 @@ Foam::tmp Foam::kineticTheoryModels::frictionalStressModels::Schaeffer:: frictionalPressure ( - const volScalarField& alpha1, + const phaseModel& phase, const dimensionedScalar& alphaMinFriction, const dimensionedScalar& alphaMax ) const { + const volScalarField& alpha = phase; + return dimensionedScalar("1e24", dimensionSet(1, -1, -2, 0, 0), 1e24) - *pow(Foam::max(alpha1 - alphaMinFriction, scalar(0)), 10.0); + *pow(Foam::max(alpha - alphaMinFriction, scalar(0)), 10.0); } @@ -89,31 +91,31 @@ Foam::tmp Foam::kineticTheoryModels::frictionalStressModels::Schaeffer:: frictionalPressurePrime ( - const volScalarField& alpha1, + const phaseModel& phase, const dimensionedScalar& alphaMinFriction, const dimensionedScalar& alphaMax ) const { + const volScalarField& alpha = phase; + return dimensionedScalar("1e25", dimensionSet(1, -1, -2, 0, 0), 1e25) - *pow(Foam::max(alpha1 - alphaMinFriction, scalar(0)), 9.0); + *pow(Foam::max(alpha - alphaMinFriction, scalar(0)), 9.0); } Foam::tmp Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::nu ( - const volScalarField& alpha1, + const phaseModel& phase, const dimensionedScalar& alphaMinFriction, const dimensionedScalar& alphaMax, const volScalarField& pf, const volSymmTensorField& D ) const { - const scalar I2Dsmall = 1.0e-15; + const volScalarField& alpha = phase; - // Creating nu assuming it should be 0 on the boundary which may not be - // true tmp tnu ( new volScalarField @@ -121,13 +123,13 @@ Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::nu IOobject ( "Schaeffer:nu", - alpha1.mesh().time().timeName(), - alpha1.mesh(), + phase.mesh().time().timeName(), + phase.mesh(), IOobject::NO_READ, IOobject::NO_WRITE, false ), - alpha1.mesh(), + phase.mesh(), dimensionedScalar("nu", dimensionSet(0, 2, -1, 0, 0), 0.0) ) ); @@ -136,16 +138,31 @@ Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::nu forAll(D, celli) { - if (alpha1[celli] > alphaMinFriction.value()) + if (alpha[celli] > alphaMinFriction.value()) { nuf[celli] = 0.5*pf[celli]*sin(phi_.value()) /( - sqrt(1.0/6.0*(sqr(D[celli].xx() - D[celli].yy()) - + sqr(D[celli].yy() - D[celli].zz()) - + sqr(D[celli].zz() - D[celli].xx())) - + sqr(D[celli].xy()) + sqr(D[celli].xz()) - + sqr(D[celli].yz())) + I2Dsmall + sqrt((1.0/3.0)*sqr(tr(D[celli])) - invariantII(D[celli])) + + SMALL + ); + } + } + + const fvPatchList& patches = phase.mesh().boundary(); + const volVectorField& U = phase.U(); + + forAll(patches, patchi) + { + if (!patches[patchi].coupled()) + { + nuf.boundaryField()[patchi] = + ( + pf.boundaryField()[patchi]*sin(phi_.value()) + /( + mag(U.boundaryField()[patchi].snGrad()) + + SMALL + ) ); } } diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.H index d4a304eb40..2b388df27a 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.H @@ -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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -81,21 +81,21 @@ public: virtual tmp frictionalPressure ( - const volScalarField& alpha1, + const phaseModel& phase, const dimensionedScalar& alphaMinFriction, const dimensionedScalar& alphaMax ) const; virtual tmp frictionalPressurePrime ( - const volScalarField& alpha1, + const phaseModel& phase, const dimensionedScalar& alphaMinFriction, const dimensionedScalar& alphaMax ) const; virtual tmp nu ( - const volScalarField& alpha1, + const phaseModel& phase, const dimensionedScalar& alphaMinFriction, const dimensionedScalar& alphaMax, const volScalarField& pf, diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.H index 923a1fce3f..20feced234 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.H @@ -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-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -36,6 +36,7 @@ SourceFiles #include "volFields.H" #include "dimensionedTypes.H" #include "runTimeSelectionTables.H" +#include "phaseModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -107,21 +108,21 @@ public: virtual tmp frictionalPressure ( - const volScalarField& alpha1, + const phaseModel& phase, const dimensionedScalar& alphaMinFriction, const dimensionedScalar& alphaMax ) const = 0; virtual tmp frictionalPressurePrime ( - const volScalarField& alpha1f, + const phaseModel& phase, const dimensionedScalar& alphaMinFriction, const dimensionedScalar& alphaMax ) const = 0; virtual tmp nu ( - const volScalarField& alpha1, + const phaseModel& phase, const dimensionedScalar& alphaMinFriction, const dimensionedScalar& alphaMax, const volScalarField& pf, diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C index f3b7d5da14..ff3be20ab1 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C @@ -111,6 +111,13 @@ Foam::RASModels::kineticTheoryModel::kineticTheoryModel coeffDict_ ), + maxNut_ + ( + "maxNut", + dimensionSet(0,2,-1,0,0), + coeffDict_.lookupOrDefault("maxNut",1000) + ), + Theta_ ( IOobject @@ -164,6 +171,20 @@ Foam::RASModels::kineticTheoryModel::kineticTheoryModel ), U.mesh(), dimensionedScalar("zero", dimensionSet(1, -1, -1, 0, 0), 0.0) + ), + + nuFric_ + ( + IOobject + ( + IOobject::groupName("nuFric", phase.name()), + U.time().timeName(), + U.mesh(), + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + U.mesh(), + dimensionedScalar("zero", dimensionSet(0, 2, -1, 0, 0), 0.0) ) { if (type == typeName) @@ -267,7 +288,7 @@ Foam::RASModels::kineticTheoryModel::pPrime() const ) + frictionalStressModel_->frictionalPressurePrime ( - alpha_, + phase_, alphaMinFriction_, alphaMax_ ) @@ -519,24 +540,25 @@ void Foam::RASModels::kineticTheoryModel::correct() ( frictionalStressModel_->frictionalPressure ( - alpha, + phase_, alphaMinFriction_, alphaMax_ ) ); - // Add frictional shear viscosity, Eq. 3.30, p. 52 - nut_ += frictionalStressModel_->nu + nuFric_ = frictionalStressModel_->nu ( - alpha, + phase_, alphaMinFriction_, alphaMax_, pf/rho, D ); - // Limit viscosity - nut_.min(100); + // Limit viscosity and add frictional viscosity + nut_.min(maxNut_); + nuFric_ = min(nuFric_, maxNut_ - nut_); + nut_ += nuFric_; } if (debug) diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H index d648de7bc1..03f323e519 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H @@ -120,6 +120,9 @@ class kineticTheoryModel //- Residual phase fraction dimensionedScalar residualAlpha_; + //- Maximum turbulent viscosity + dimensionedScalar maxNut_; + // Kinetic Theory Model Fields @@ -135,6 +138,9 @@ class kineticTheoryModel //- The granular "thermal" conductivity volScalarField kappa_; + //- The frictional viscosity + volScalarField nuFric_; + // Private Member Functions diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/T.gas b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/T.gas new file mode 100644 index 0000000000..b997ba8d87 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/T.gas @@ -0,0 +1,48 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object T.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 300; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform 300; + } + + outlet + { + type inletOutlet; + phi phi.gas; + inletValue uniform 300; + value uniform 300; + } + + "wall.*" + { + type zeroGradient; + } + + "frontAndBack.*" + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/T.solids b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/T.solids new file mode 100644 index 0000000000..f89c81a228 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/T.solids @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object T.solids; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 300; + +boundaryField +{ + inlet + { + type zeroGradient; + } + + outlet + { + type inletOutlet; + phi phi.solids; + inletValue uniform 300; + value uniform 300; + } + + "wall.*" + { + type zeroGradient; + } + + "frontAndBack.*" + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/Theta.solids b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/Theta.solids new file mode 100644 index 0000000000..15e7486302 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/Theta.solids @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object Theta.solids; +} +// ************************************************************************* // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0; + +referenceLevel 1e-4; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform 1e-4; + } + + outlet + { + type zeroGradient; + } + + "wall.*" + { + type JohnsonJacksonParticleTheta; + restitutionCoefficient 0.2; + specularityCoefficient 0.1; + muF 0.25; + sigma 2; + value uniform 1e-4; + } + + "frontAndBack.*" + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/U.gas b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/U.gas new file mode 100644 index 0000000000..c2eba7f790 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/U.gas @@ -0,0 +1,48 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + inlet + { + type fixedValue; + value uniform (0 0 0); + } + + outlet + { + type pressureInletOutletVelocity; + phi phi.gas; + value $internalField; + } + + "wall.*" + { + type fixedValue; + value uniform (0 0 0); + } + + "frontAndBack.*" + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/U.solids b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/U.solids new file mode 100644 index 0000000000..83efb2917f --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/U.solids @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U.solids; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + inlet + { + type fixedValue; + value uniform (0 -0.2 0); + } + + outlet + { + type fixedValue; + value uniform (0 0 0); + } + + "wall.*" + { + type JohnsonJacksonParticleSlip; + restitutionCoefficient 0.2; + specularityCoefficient 0.1; + muF 0.25; + sigma 2; + value uniform (0 0 0); + } + + "frontAndBack.*" + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/alpha.solids b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/alpha.solids new file mode 100644 index 0000000000..7b10e13ea3 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/alpha.solids @@ -0,0 +1,45 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object alpha.solids; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform 0.3; + } + + outlet + { + type zeroGradient; + } + + "wall.*" + { + type zeroGradient; + } + + "frontAndBack.*" + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/alphat.gas b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/alphat.gas new file mode 100644 index 0000000000..a427a3d220 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/alphat.gas @@ -0,0 +1,48 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object alphat.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type calculated; + value $internalField; + } + + outlet + { + type calculated; + value $internalField; + } + + "wall.*" + { + type compressible::alphatWallFunction; + Prt 0.85; + value $internalField; + } + + "frontAndBack.*" + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/alphat.solids b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/alphat.solids new file mode 100644 index 0000000000..629d9b81b2 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/alphat.solids @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object alphat.solids; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type calculated; + value $internalField; + } + + outlet + { + type calculated; + value $internalField; + } + + "wall.*" + { + type calculated; + value $internalField; + } + + "frontAndBack.*" + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/epsilon.gas b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/epsilon.gas new file mode 100644 index 0000000000..d71220e918 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/epsilon.gas @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object epsilon.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 1e-3; + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + + outlet + { + type inletOutlet; + phi phi.gas; + inletValue $internalField; + value $internalField; + } + + "wall.*" + { + type epsilonWallFunction; + value $internalField; + } + + "frontAndBack.*" + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/k.gas b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/k.gas new file mode 100644 index 0000000000..7b712450db --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/k.gas @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object k.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 1e-4; + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + + outlet + { + type inletOutlet; + phi phi.gas; + inletValue $internalField; + value $internalField; + } + + "wall.*" + { + type kqRWallFunction; + value $internalField; + } + + "frontAndBack.*" + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/nut.gas b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/nut.gas new file mode 100644 index 0000000000..48bbb42864 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/nut.gas @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object nut.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type calculated; + value $internalField; + } + + outlet + { + type calculated; + value $internalField; + } + + "wall.*" + { + type nutkWallFunction; + value $internalField; + } + + "frontAndBack.*" + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/nut.solids b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/nut.solids new file mode 100644 index 0000000000..978d789704 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/nut.solids @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object nut.solids; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type calculated; + value $internalField; + } + + outlet + { + type calculated; + value $internalField; + } + + "wall.*" + { + type calculated; + value $internalField; + } + + "frontAndBack.*" + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/p b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/p new file mode 100644 index 0000000000..2ab8e8cdcc --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/p @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 1e5; + +boundaryField +{ + inlet + { + type calculated; + value $internalField; + } + + outlet + { + type calculated; + value $internalField; + } + + "wall.*" + { + type calculated; + value $internalField; + } + + "frontAndBack.*" + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/p_rgh b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/p_rgh new file mode 100644 index 0000000000..0b84a87958 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/0/p_rgh @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p_rgh; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 1e5; + +boundaryField +{ + inlet + { + type fixedFluxPressure; + value $internalField; + } + + outlet + { + type prghTotalPressure; + p0 $internalField; + U U.gas; + phi phi.gas; + rho thermo:rho.gas; + value $internalField; + } + + "wall.*" + { + type fixedFluxPressure; + value $internalField; + } + + "frontAndBack.*" + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/constant/g b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/constant/g new file mode 100644 index 0000000000..e0ac2653b5 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/constant/g @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class uniformDimensionedVectorField; + location "constant"; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; +value ( 0 -9.81 0 ); + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/constant/phaseProperties b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/constant/phaseProperties new file mode 100644 index 0000000000..d53b4d7196 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/constant/phaseProperties @@ -0,0 +1,119 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object phaseProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +type heatAndMomentumTransferTwoPhaseSystem; + +phases (solids gas); + +solids +{ + type purePhaseModel; + + diameterModel constant; + + constantCoeffs + { + d 462e-6; + } + + residualAlpha 1e-5; +} + +gas +{ + type purePhaseModel; + + diameterModel constant; + constantCoeffs + { + d 1; + } + residualAlpha 1e-5; +} + +blending +{ + default + { + type none; + residualAlpha 1e-6; + continuousPhase gas; + } +} + +surfaceTension +( + (gas and solids) + { + type constant; + sigma 0; + } +); + +aspectRatio +( +); + +drag +( + (solids in gas) + { + type GidaspowErgunWenYu; + residualAlpha 1e-5; + residualRe 1e-5; + swarmCorrection + { + type none; + } + } +); + +virtualMass +( + (solids in gas) + { + type constantCoefficient; + Cvm 0; + } +); + +heatTransfer +( + (solids in gas) + { + type RanzMarshall; + residualAlpha 1e-4; + } +); + +lift +( +); + +wallLubrication +( +); + +turbulentDispersion +( +); + +// Minimum allowable pressure +pMin 10000; + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/constant/thermophysicalProperties.gas b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/constant/thermophysicalProperties.gas new file mode 100644 index 0000000000..a2a98f45f2 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/constant/thermophysicalProperties.gas @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalProperties.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo hConst; + equationOfState perfectGas; + specie specie; + energy sensibleEnthalpy; +} + +mixture +{ + specie + { + nMoles 1; + molWeight 28.9; + } + thermodynamics + { + Cp 1007; + Hf 0; + } + equationOfState + { + rho 1.2; + } + transport + { + mu 1.84e-05; + Pr 0.7; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/constant/thermophysicalProperties.solids b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/constant/thermophysicalProperties.solids new file mode 100644 index 0000000000..84dae4b716 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/constant/thermophysicalProperties.solids @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalProperties.solids; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + transport const; + thermo hConst; + equationOfState rhoConst; + specie specie; + energy sensibleEnthalpy; +} + +mixture +{ + specie + { + nMoles 1; + molWeight 100; + } + equationOfState + { + rho 2480; + } + thermodynamics + { + Cp 6000; + Hf 0; + } + transport + { + mu 0; + Pr 24.47; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/constant/turbulenceProperties.gas b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/constant/turbulenceProperties.gas new file mode 100644 index 0000000000..d92fbf9947 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/constant/turbulenceProperties.gas @@ -0,0 +1,44 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties.gas; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RAS; + +RAS +{ + RASModel kEpsilon; + + turbulence on; + printCoeffs on; +} + +LES +{ + LESModel Smagorinsky; + + turbulence on; + printCoeffs on; + + delta cubeRootVol; + + cubeRootVolCoeffs + { + deltaCoeff 1; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/constant/turbulenceProperties.solids b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/constant/turbulenceProperties.solids new file mode 100644 index 0000000000..04793a45c2 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/constant/turbulenceProperties.solids @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties.solids; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RAS; + +RAS +{ + RASModel kineticTheory; + + turbulence on; + printCoeffs on; + + kineticTheoryCoeffs + { + equilibrium off; + + e 0.8; + alphaMax 0.65; + alphaMinFriction 0.5; + residualAlpha 1e-6; + + viscosityModel Syamlal; + conductivityModel Syamlal; + granularPressureModel SyamlalRogersOBrien; + frictionalStressModel Schaeffer; + radialModel CarnahanStarling; + + SchaefferCoeffs + { + phi 36; + } + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/system/blockMeshDict b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/system/blockMeshDict new file mode 100644 index 0000000000..ebf2ada3b0 --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/system/blockMeshDict @@ -0,0 +1,128 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 1; + +vertices +( + ( 0.0 0.0 -0.01) + ( 0.04 0.0 -0.01) + ( 0.04 0.15 -0.01) + ( 0.0 0.15 -0.01) + ( 0.0 0.0 0.01) + ( 0.04 0.0 0.01) + ( 0.04 0.15 0.01) + ( 0.0 0.15 0.01) + + ( 0.04 0.0 -0.01) + ( 0.5 0.0 -0.01) + ( 0.5 0.04 -0.01) + ( 0.04 0.04 -0.01) + ( 0.04 0.0 0.01) + ( 0.5 0.0 0.01) + ( 0.5 0.04 0.01) + ( 0.04 0.04 0.01) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (16 60 1) simpleGrading (1 1 1) + hex (8 9 10 11 12 13 14 15) (180 16 1) simpleGrading (1 1 1) +); + +edges +( +); + +boundary +( + inlet + { + type patch; + faces + ( + (3 7 6 2) + ); + } + wall1 + { + type wall; + faces + ( + (0 4 7 3) + (1 5 4 0) + ); + } + wall_merge + { + type wall; + faces + ( + (2 6 5 1) + ); + } + frontAndBack1 + { + type empty; + faces + ( + (0 3 2 1) + (4 5 6 7) + ); + } + wall2 + { + type wall; + faces + ( + (11 15 14 10) + (9 13 12 8) + ); + } + wall_merge2 + { + type wall; + faces + ( + (8 12 15 11) + ); + } + outlet + { + type patch; + faces + ( + (10 14 13 9) + ); + } + frontAndBack2 + { + type empty; + faces + ( + (8 11 10 9) + (12 13 14 15) + ); + } + +); + +mergePatchPairs +( + (wall_merge wall_merge2) +); + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/system/controlDict b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/system/controlDict new file mode 100644 index 0000000000..f929ca081e --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/system/controlDict @@ -0,0 +1,55 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application reactingTwoPhaseEulerFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 2; + +deltaT 1e-4; + +writeControl adjustableRunTime; + +writeInterval 0.1; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 9; + +writeCompression compressed; + +timeFormat general; + +timePrecision 8; + +runTimeModifiable on; + +adjustTimeStep yes; + +maxCo 0.1; + +maxDeltaT 0.01; + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/system/fvSchemes b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/system/fvSchemes new file mode 100644 index 0000000000..293328da6c --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/system/fvSchemes @@ -0,0 +1,74 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; + + "div\(phi,alpha.*\)" Gauss vanLeer; + "div\(phir,alpha.*\)" Gauss vanLeer; + + "div\(alphaRhoPhi.*,U.*\)" Gauss limitedLinearV 1; + "div\(phi.*,U.*\)" Gauss limitedLinearV 1; + + "div\(alphaRhoPhi.*,(h|e).*\)" Gauss limitedLinear 1; + "div\(alphaRhoPhi.*,K.*\)" Gauss limitedLinear 1; + "div\(alphaPhi.*,p\)" Gauss limitedLinear 1; + + div(alphaRhoPhi.solids,Theta.solids) Gauss limitedLinear 1; + + "div\(alphaRhoPhi.*,(k|epsilon).*\)" Gauss limitedLinear 1; + + div((((alpha.gas*thermo:rho.gas)*nuEff.gas)*dev2(T(grad(U.gas))))) Gauss linear; + + div((((thermo:rho.solids*nut.solids)*dev2(T(grad(U.solids))))+(((thermo:rho.solids*lambda.solids)*div(phi.solids))*I))) Gauss linear; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; + p_rgh; + alpha.solids; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/system/fvSolution b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/system/fvSolution new file mode 100644 index 0000000000..10ff75d72c --- /dev/null +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/system/fvSolution @@ -0,0 +1,111 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + "alpha.*" + { + nAlphaCorr 2; + nAlphaSubCycles 1; + + implicitPhasePressure yes; + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-10; + relTol 0; + minIter 1; + } + + p_rgh + { + solver GAMG; + smoother DIC; + nPreSweeps 0; + nPostSweeps 2; + nFinestSweeps 2; + cacheAgglomeration true; + nCellsInCoarsestLevel 10; + processorAgglomerator procFaces; + nAgglomeratingCells 800; + agglomerator faceAreaPair; + mergeLevels 1; + tolerance 1e-8; + relTol 0.01; + } + + p_rghFinal + { + $p_rgh; + relTol 0; + } + + "U.*" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-7; + relTol 0; + minIter 1; + } + + "(h|e).*" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-8; + relTol 0; + minIter 1; + maxIter 10; + } + + "Theta.*" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-7; + relTol 0; + minIter 1; + } + + "(k|epsilon).*" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-5; + relTol 0; + minIter 1; + } +} + +PIMPLE +{ + nOuterCorrectors 3; + nCorrectors 1; + nNonOrthogonalCorrectors 0; + faceMomentum yes; +} + +relaxationFactors +{ + equations + { + ".*" 1; + } +} + + +// ************************************************************************* // From a78beef988501607ac5be1224c68379153e3b9de Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Fri, 22 Apr 2016 15:13:45 +0100 Subject: [PATCH 003/581] JohnsonJacksonSchaefferFrictionalStress: Updated I2D expression --- .../JohnsonJacksonSchaefferFrictionalStress.C | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) 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 4f05634d6f..91b49b30e0 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 @@ -126,7 +126,6 @@ JohnsonJacksonSchaeffer::nu ) const { const volScalarField& alpha = phase; - const scalar I2Dsmall = 1.0e-15; tmp tnu ( @@ -155,17 +154,8 @@ JohnsonJacksonSchaeffer::nu nuf[celli] = 0.5*pf[celli]*sin(phi_.value()) /( - sqrt - ( - 1.0/6.0 - *( - sqr(D[celli].xx() - D[celli].yy()) - + sqr(D[celli].yy() - D[celli].zz()) - + sqr(D[celli].zz() - D[celli].xx()) - ) - + sqr(D[celli].xy()) + sqr(D[celli].xz() - ) - + sqr(D[celli].yz())) + I2Dsmall + sqrt((1.0/3.0)*sqr(tr(D[celli])) - invariantII(D[celli])) + + SMALL ); } } @@ -182,7 +172,7 @@ JohnsonJacksonSchaeffer::nu pf.boundaryField()[patchi]*sin(phi_.value()) /( mag(U.boundaryField()[patchi].snGrad()) - + I2Dsmall + + SMALL ) ); } From 6a7c4aca5338c9904cb54332a5dcae01ecc23c4b Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Sat, 23 Apr 2016 10:03:40 +0100 Subject: [PATCH 004/581] thermoSingleLayer: Corrected handling of non-constant Cp --- .../thermoSingleLayer/thermoSingleLayer.C | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.C b/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.C index e1c65f2ad3..0c12d61582 100644 --- a/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.C +++ b/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.C @@ -81,7 +81,7 @@ wordList thermoSingleLayer::hsBoundaryTypes() bool thermoSingleLayer::read() { - // no additional properties to read + // No additional properties to read return kinematicSingleLayer::read(); } @@ -259,11 +259,13 @@ tmp thermoSingleLayer::q(volScalarField& hs) const { return ( - - fvm::Sp(htcs_->h()/Cp_, hs) - - htcs_->h()*(constant::standard::Tstd - TPrimary_) + // Heat-transfer to the primary region + - fvm::Sp(alpha_*htcs_->h()/Cp_, hs) + + alpha_*htcs_->h()*(hs/Cp_ - T_ + TPrimary_) - - fvm::Sp(htcw_->h()/Cp_, hs) - - htcw_->h()*(constant::standard::Tstd - Tw_) + // Heat-transfer to the wall + - fvm::Sp(alpha_*htcw_->h()/Cp_, hs) + + alpha_*htcw_->h()*(hs/Cp_ - T_ + Tw_) ); } @@ -283,15 +285,14 @@ void thermoSingleLayer::solveEnergy() + fvm::div(phi_, hs_) == - hsSp_ + - rhoSp_*hs_ + q(hs_) + radiation_->Shs() - // - fvm::SuSp(rhoSp_, hs_) - - rhoSp_*hs_ ); correctThermoFields(); - // evaluate viscosity from user-model + // Evaluate viscosity from user-model viscosity_->correct(pPrimary_, T_); } @@ -449,7 +450,7 @@ thermoSingleLayer::thermoSingleLayer ( IOobject ( - hsSp_.name(), // must have same name as hSp_ to enable mapping + hsSp_.name(), // Must have same name as hSp_ to enable mapping time().timeName(), primaryMesh(), IOobject::NO_READ, @@ -463,7 +464,7 @@ thermoSingleLayer::thermoSingleLayer ( IOobject ( - "T", // same name as T on primary region to enable mapping + "T", // Same name as T on primary region to enable mapping time().timeName(), regionMesh(), IOobject::NO_READ, @@ -562,7 +563,7 @@ thermoSingleLayer::thermoSingleLayer phi_ == phi0; - // evaluate viscosity from user-model + // Evaluate viscosity from user-model viscosity_->correct(pPrimary_, T_); } } @@ -612,8 +613,6 @@ void thermoSingleLayer::preEvolveRegion() InfoInFunction << endl; } -// correctHsForMappedT(); - kinematicSingleLayer::preEvolveRegion(); // Update phase change From 673e0d1704cdc1660238dfba6121b03e28ed0fff Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Sat, 23 Apr 2016 10:04:39 +0100 Subject: [PATCH 005/581] fireFoam: Added optional hydrostatic initialization of the pressure and density Also added the new prghTotalHydrostaticPressure p_rgh BC which uses the hydrostatic pressure field as the reference state for the far-field which provides much more accurate entrainment is large open domains typical of many fire simulations. The hydrostatic field solution is controlled by the optional entries in the fvSolution.PIMPLE dictionary, e.g. hydrostaticInitialization yes; nHydrostaticCorrectors 5; and the solver must also be specified for the hydrostatic p_rgh field ph_rgh e.g. ph_rgh { $p_rgh; } Suitable boundary conditions for ph_rgh cannot always be derived from those for p_rgh and so the ph_rgh is read to provide them. To avoid accuracy issues with IO, restart and post-processing the p_rgh and ph_rgh the option to specify a suitable reference pressure is provided via the optional pRef file in the constant directory, e.g. dimensions [1 -1 -2 0 0 0 0]; value 101325; which is used in the relationship between p_rgh and p: p = p_rgh + rho*gh + pRef; Note that if pRef is specified all pressure BC specifications in the p_rgh and ph_rgh files are relative to the reference to avoid round-off errors. For examples of suitable BCs for p_rgh and ph_rgh for a range of fireFoam cases please study the tutorials in tutorials/combustion/fireFoam/les which have all been updated. Henry G. Weller CFD Direct Ltd. --- .../combustion/fireFoam/createFields.H | 101 ++++----- .../solvers/combustion/fireFoam/fireFoam.C | 1 - .../solvers/combustion/fireFoam/pEqn.H | 9 +- .../solvers/combustion/fireFoam/phrghEqn.H | 62 ++++++ src/finiteVolume/Make/files | 1 + .../cfdTools/general/include/readpRef.H | 13 ++ .../basic/fixedValue/fixedValueFvPatchField.H | 2 +- ...talHydrostaticPressureFvPatchScalarField.C | 168 +++++++++++++++ ...talHydrostaticPressureFvPatchScalarField.H | 202 ++++++++++++++++++ .../prghTotalPressureFvPatchScalarField.H | 20 +- .../flameSpreadWaterSuppressionPanel/0/p_rgh | 20 +- .../flameSpreadWaterSuppressionPanel/Allclean | 2 +- .../flameSpreadWaterSuppressionPanel/Allrun | 4 +- .../constant/pRef | 21 ++ .../system/fvSolution | 8 + .../les/oppositeBurningPanels/0/p_rgh | 9 +- .../les/oppositeBurningPanels/Allclean | 1 + .../fireFoam/les/oppositeBurningPanels/Allrun | 2 + .../les/oppositeBurningPanels/constant/pRef | 21 ++ .../oppositeBurningPanels/system/fvSolution | 9 + .../fireFoam/les/smallPoolFire2D/0/p_rgh | 9 +- .../fireFoam/les/smallPoolFire2D/Allclean | 11 + .../fireFoam/les/smallPoolFire2D/Allrun | 2 + .../les/smallPoolFire2D/constant/pRef | 21 ++ .../les/smallPoolFire2D/system/fvSolution | 8 + .../fireFoam/les/smallPoolFire3D/0/p_rgh | 8 +- .../fireFoam/les/smallPoolFire3D/Allclean | 11 + .../fireFoam/les/smallPoolFire3D/Allrun | 3 + .../les/smallPoolFire3D/constant/pRef | 21 ++ .../les/smallPoolFire3D/system/fvSolution | 8 + 30 files changed, 673 insertions(+), 105 deletions(-) create mode 100644 applications/solvers/combustion/fireFoam/phrghEqn.H create mode 100644 src/finiteVolume/cfdTools/general/include/readpRef.H create mode 100644 src/finiteVolume/fields/fvPatchFields/derived/prghTotalHydrostaticPressure/prghTotalHydrostaticPressureFvPatchScalarField.C create mode 100644 src/finiteVolume/fields/fvPatchFields/derived/prghTotalHydrostaticPressure/prghTotalHydrostaticPressureFvPatchScalarField.H create mode 100644 tutorials/combustion/fireFoam/les/flameSpreadWaterSuppressionPanel/constant/pRef create mode 100644 tutorials/combustion/fireFoam/les/oppositeBurningPanels/constant/pRef create mode 100755 tutorials/combustion/fireFoam/les/smallPoolFire2D/Allclean create mode 100644 tutorials/combustion/fireFoam/les/smallPoolFire2D/constant/pRef create mode 100755 tutorials/combustion/fireFoam/les/smallPoolFire3D/Allclean create mode 100644 tutorials/combustion/fireFoam/les/smallPoolFire3D/constant/pRef diff --git a/applications/solvers/combustion/fireFoam/createFields.H b/applications/solvers/combustion/fireFoam/createFields.H index c5fcc21c90..ce621258cc 100644 --- a/applications/solvers/combustion/fireFoam/createFields.H +++ b/applications/solvers/combustion/fireFoam/createFields.H @@ -54,6 +54,9 @@ volVectorField U #include "compressibleCreatePhi.H" +#include "createMRF.H" + + Info<< "Creating turbulence model\n" << endl; autoPtr turbulence ( @@ -69,6 +72,55 @@ autoPtr turbulence // Set the turbulence into the combustion model combustion->setTurbulence(turbulence()); + +#include "readGravitationalAcceleration.H" +#include "readhRef.H" +#include "gh.H" +#include "readpRef.H" + +volScalarField p_rgh +( + IOobject + ( + "p_rgh", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh +); + +mesh.setFluxRequired(p_rgh.name()); + +#include "phrghEqn.H" + + +multivariateSurfaceInterpolationScheme::fieldTable fields; + +forAll(Y, i) +{ + fields.add(Y[i]); +} +fields.add(thermo.he()); + +IOdictionary additionalControlsDict +( + IOobject + ( + "additionalControls", + runTime.constant(), + mesh, + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE + ) +); + +Switch solvePrimaryRegion +( + additionalControlsDict.lookup("solvePrimaryRegion") +); + volScalarField dQ ( IOobject @@ -99,52 +151,3 @@ volScalarField dpdt Info<< "Creating field kinetic energy K\n" << endl; volScalarField K("K", 0.5*magSqr(U)); - - -#include "readGravitationalAcceleration.H" -#include "readhRef.H" -#include "gh.H" - - -volScalarField p_rgh -( - IOobject - ( - "p_rgh", - runTime.timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh -); - -// Force p_rgh to be consistent with p -p_rgh = p - rho*gh; - -mesh.setFluxRequired(p_rgh.name()); - -multivariateSurfaceInterpolationScheme::fieldTable fields; - -forAll(Y, i) -{ - fields.add(Y[i]); -} -fields.add(thermo.he()); - -IOdictionary additionalControlsDict -( - IOobject - ( - "additionalControls", - runTime.constant(), - mesh, - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE - ) -); - -Switch solvePrimaryRegion -( - additionalControlsDict.lookup("solvePrimaryRegion") -); diff --git a/applications/solvers/combustion/fireFoam/fireFoam.C b/applications/solvers/combustion/fireFoam/fireFoam.C index fd8e2a4357..3e1689f656 100644 --- a/applications/solvers/combustion/fireFoam/fireFoam.C +++ b/applications/solvers/combustion/fireFoam/fireFoam.C @@ -54,7 +54,6 @@ int main(int argc, char *argv[]) pimpleControl pimple(mesh); #include "createFields.H" - #include "createMRF.H" #include "createFvOptions.H" #include "createClouds.H" #include "createSurfaceFilmModel.H" diff --git a/applications/solvers/combustion/fireFoam/pEqn.H b/applications/solvers/combustion/fireFoam/pEqn.H index 7b5249d57e..0d42787fff 100644 --- a/applications/solvers/combustion/fireFoam/pEqn.H +++ b/applications/solvers/combustion/fireFoam/pEqn.H @@ -4,7 +4,7 @@ volScalarField rAU(1.0/UEqn.A()); surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); -surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf()); +surfaceScalarField phig("phig", -rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf()); surfaceScalarField phiHbyA ( @@ -25,9 +25,10 @@ while (pimple.correctNonOrthogonal()) { fvScalarMatrix p_rghEqn ( - fvc::ddt(psi, rho)*gh + fvm::ddt(psi, p_rgh) + + fvc::ddt(psi, rho)*gh + + fvc::ddt(psi)*pRef + fvc::div(phiHbyA) - + fvm::ddt(psi, p_rgh) - fvm::laplacian(rhorAUf, p_rgh) == parcels.Srho() @@ -46,7 +47,7 @@ while (pimple.correctNonOrthogonal()) } } -p = p_rgh + rho*gh; +p = p_rgh + rho*gh + pRef; #include "rhoEqn.H" #include "compressibleContinuityErrs.H" diff --git a/applications/solvers/combustion/fireFoam/phrghEqn.H b/applications/solvers/combustion/fireFoam/phrghEqn.H new file mode 100644 index 0000000000..3c5175f41f --- /dev/null +++ b/applications/solvers/combustion/fireFoam/phrghEqn.H @@ -0,0 +1,62 @@ +if (pimple.dict().lookupOrDefault("hydrostaticInitialization", false)) +{ + volScalarField& ph_rgh = regIOobject::store + ( + new volScalarField + ( + IOobject + ( + "ph_rgh", + "0", + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ), + mesh + ) + ); + + if (equal(runTime.value(), 0)) + { + p = ph_rgh + rho*gh + pRef; + thermo.correct(); + rho = thermo.rho(); + + label nCorr + ( + pimple.dict().lookupOrDefault