diff --git a/applications/solvers/combustion/fireFoam/Make/options b/applications/solvers/combustion/fireFoam/Make/options index cf5b4b0976..f1f6e1d951 100644 --- a/applications/solvers/combustion/fireFoam/Make/options +++ b/applications/solvers/combustion/fireFoam/Make/options @@ -24,8 +24,7 @@ EXE_INC = \ -I$(LIB_SRC)/regionModels/pyrolysisModels/lnInclude \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ - -I$(LIB_SRC)/ODE/lnInclude \ - -I$(LIB_SRC)/sampling/lnInclude + -I$(LIB_SRC)/ODE/lnInclude EXE_LIBS = \ @@ -48,5 +47,4 @@ EXE_LIBS = \ -lsurfaceFilmModels \ -lpyrolysisModels \ -llagrangianIntermediate \ - -lODE \ - -lsampling + -lODE diff --git a/applications/solvers/combustion/fireFoam/createPyrolysisModel.H b/applications/solvers/combustion/fireFoam/createPyrolysisModel.H index e5b8d4e457..4c93ad2c6a 100644 --- a/applications/solvers/combustion/fireFoam/createPyrolysisModel.H +++ b/applications/solvers/combustion/fireFoam/createPyrolysisModel.H @@ -1,6 +1,3 @@ Info<< "Creating pyrolysis model" << endl; -autoPtr pyrolysis -( - regionModels::pyrolysisModels::pyrolysisModel::New(mesh) -); +regionModels::pyrolysisModels::pyrolysisModelCollection pyrolysis(mesh); diff --git a/applications/solvers/combustion/fireFoam/fireFoam.C b/applications/solvers/combustion/fireFoam/fireFoam.C index 37ae08ec86..e95a4318c7 100644 --- a/applications/solvers/combustion/fireFoam/fireFoam.C +++ b/applications/solvers/combustion/fireFoam/fireFoam.C @@ -35,7 +35,7 @@ Description #include "turbulenceModel.H" #include "basicReactingCloud.H" #include "surfaceFilmModel.H" -#include "pyrolysisModel.H" +#include "pyrolysisModelCollection.H" #include "radiationModel.H" #include "SLGThermo.H" #include "solidChemistryModel.H" @@ -84,7 +84,7 @@ int main(int argc, char *argv[]) surfaceFilm.evolve(); - pyrolysis->evolve(); + pyrolysis.evolve(); if (solvePrimaryRegion) { diff --git a/applications/solvers/combustion/fireFoam/readPyrolysisTimeControls.H b/applications/solvers/combustion/fireFoam/readPyrolysisTimeControls.H index 95dc78ee5d..c8ba13c886 100644 --- a/applications/solvers/combustion/fireFoam/readPyrolysisTimeControls.H +++ b/applications/solvers/combustion/fireFoam/readPyrolysisTimeControls.H @@ -29,6 +29,6 @@ Description \*---------------------------------------------------------------------------*/ -scalar maxDi = pyrolysis->maxDiff(); +scalar maxDi = pyrolysis.maxDiff(); // ************************************************************************* // diff --git a/applications/solvers/combustion/fireFoam/solidRegionDiffusionNo.H b/applications/solvers/combustion/fireFoam/solidRegionDiffusionNo.H index 2d443c50bf..4aac1f390e 100644 --- a/applications/solvers/combustion/fireFoam/solidRegionDiffusionNo.H +++ b/applications/solvers/combustion/fireFoam/solidRegionDiffusionNo.H @@ -1 +1 @@ -scalar DiNum = pyrolysis->solidRegionDiffNo(); +scalar DiNum = pyrolysis.solidRegionDiffNo(); diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C b/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C index 2f40670abd..c65d8618f1 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C @@ -107,7 +107,7 @@ maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField if (dict.found("refValue") && dict.found("valueFraction")) { this->refValue() = vectorField("refValue", dict, p.size()); - this->valueFraction() = + this->valueFraction() = scalarField("valueFraction", dict, p.size()); } else diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C index 046da72269..94f3f54de4 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleFoam.C @@ -68,12 +68,6 @@ int main(int argc, char *argv[]) // --- Pressure-velocity PIMPLE corrector loop for (pimple.start(); pimple.loop(); pimple++) { - if (pimple.nOuterCorr() != 1) - { - p.storePrevIter(); - rho.storePrevIter(); - } - #include "UEqn.H" #include "hEqn.H" diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFLTSPimpleFoam/rhoPorousMRFLTSPimpleFoam.C b/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFLTSPimpleFoam/rhoPorousMRFLTSPimpleFoam.C index c4cdf7df01..66ffb08275 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFLTSPimpleFoam/rhoPorousMRFLTSPimpleFoam.C +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFLTSPimpleFoam/rhoPorousMRFLTSPimpleFoam.C @@ -79,12 +79,6 @@ int main(int argc, char *argv[]) // --- Pressure-velocity PIMPLE corrector loop for (pimple.start(); pimple.loop(); pimple++) { - if (pimple.nOuterCorr() != 1) - { - p.storePrevIter(); - rho.storePrevIter(); - } - turbulence->correct(); #include "UEqn.H" diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/rhoPorousMRFPimpleFoam.C b/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/rhoPorousMRFPimpleFoam.C index da5d3d886a..5bfbc84d56 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/rhoPorousMRFPimpleFoam.C +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/rhoPorousMRFPimpleFoam.C @@ -73,12 +73,6 @@ int main(int argc, char *argv[]) // --- Pressure-velocity PIMPLE corrector loop for (pimple.start(); pimple.loop(); pimple++) { - if (pimple.nOuterCorr() != 1) - { - p.storePrevIter(); - rho.storePrevIter(); - } - #include "UEqn.H" #include "hEqn.H" diff --git a/applications/solvers/compressible/rhoSimpleFoam/pEqn.H b/applications/solvers/compressible/rhoSimpleFoam/pEqn.H index 54af64c003..df120f6dea 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoSimpleFoam/pEqn.H @@ -26,7 +26,7 @@ if (simple.transonic()) ); // Relax the pressure equation to ensure diagonal-dominance - pEqn.relax(mesh.relaxationFactor("pEqn")); + pEqn.relax(mesh.equationRelaxationFactor("pEqn")); pEqn.setReference(pRefCell, pRefValue); diff --git a/applications/solvers/compressible/rhoSimpleFoam/rhoPorousMRFSimpleFoam/rhoPorousMRFSimpleFoam.C b/applications/solvers/compressible/rhoSimpleFoam/rhoPorousMRFSimpleFoam/rhoPorousMRFSimpleFoam.C index 1bfc7d795f..5273f50eaa 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/rhoPorousMRFSimpleFoam/rhoPorousMRFSimpleFoam.C +++ b/applications/solvers/compressible/rhoSimpleFoam/rhoPorousMRFSimpleFoam/rhoPorousMRFSimpleFoam.C @@ -59,9 +59,6 @@ int main(int argc, char *argv[]) { Info<< "Time = " << runTime.timeName() << nl << endl; - p.storePrevIter(); - rho.storePrevIter(); - // Pressure-velocity SIMPLE corrector { #include "UEqn.H" diff --git a/applications/solvers/compressible/rhoSimpleFoam/rhoSimpleFoam.C b/applications/solvers/compressible/rhoSimpleFoam/rhoSimpleFoam.C index 377734b7b4..454da31441 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/rhoSimpleFoam.C +++ b/applications/solvers/compressible/rhoSimpleFoam/rhoSimpleFoam.C @@ -55,9 +55,6 @@ int main(int argc, char *argv[]) { Info<< "Time = " << runTime.timeName() << nl << endl; - p.storePrevIter(); - rho.storePrevIter(); - // Pressure-velocity SIMPLE corrector { #include "UEqn.H" diff --git a/applications/solvers/compressible/rhoSimplecFoam/rhoSimplecFoam.C b/applications/solvers/compressible/rhoSimplecFoam/rhoSimplecFoam.C index 111530979f..278e689bc2 100644 --- a/applications/solvers/compressible/rhoSimplecFoam/rhoSimplecFoam.C +++ b/applications/solvers/compressible/rhoSimplecFoam/rhoSimplecFoam.C @@ -57,14 +57,6 @@ int main(int argc, char *argv[]) { Info<< "Time = " << runTime.timeName() << nl << endl; - p.storePrevIter(); - rho.storePrevIter(); - - if (!simple.transonic()) - { - rho.storePrevIter(); - } - // Velocity-pressure-enthalpy SIMPLEC corrector { #include "UEqn.H" diff --git a/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/buoyantBaffleSimpleFoam.C b/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/buoyantBaffleSimpleFoam.C index 67c1531e9c..1a5b66f0c7 100644 --- a/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/buoyantBaffleSimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantBaffleSimpleFoam/buoyantBaffleSimpleFoam.C @@ -58,9 +58,6 @@ int main(int argc, char *argv[]) { Info<< "Time = " << runTime.timeName() << nl << endl; - p_rgh.storePrevIter(); - rho.storePrevIter(); - // Pressure-velocity SIMPLE corrector { #include "UEqn.H" diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/buoyantBoussinesqPimpleFoam.C b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/buoyantBoussinesqPimpleFoam.C index 8d91f0f48b..c00c1fe8d8 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/buoyantBoussinesqPimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/buoyantBoussinesqPimpleFoam.C @@ -81,11 +81,6 @@ int main(int argc, char *argv[]) // --- Pressure-velocity PIMPLE corrector loop for (pimple.start(); pimple.loop(); pimple++) { - if (pimple.nOuterCorr() != 1) - { - p_rgh.storePrevIter(); - } - #include "UEqn.H" #include "TEqn.H" diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/buoyantBoussinesqSimpleFoam.C b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/buoyantBoussinesqSimpleFoam.C index aa8f0aa88e..a3d5c956fc 100644 --- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/buoyantBoussinesqSimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/buoyantBoussinesqSimpleFoam.C @@ -71,8 +71,6 @@ int main(int argc, char *argv[]) { Info<< "Time = " << runTime.timeName() << nl << endl; - p_rgh.storePrevIter(); - // Pressure-velocity SIMPLE corrector { #include "UEqn.H" diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C b/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C index 8b6dead722..4239771168 100644 --- a/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C @@ -74,11 +74,6 @@ int main(int argc, char *argv[]) // --- Pressure-velocity PIMPLE corrector loop for (pimple.start(); pimple.loop(); pimple++) { - if (pimple.nOuterCorr() != 1) - { - p_rgh.storePrevIter(); - } - #include "UEqn.H" #include "hEqn.H" diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C index fdb29b8026..cebe1207d8 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C @@ -56,9 +56,6 @@ int main(int argc, char *argv[]) { Info<< "Time = " << runTime.timeName() << nl << endl; - p_rgh.storePrevIter(); - rho.storePrevIter(); - // Pressure-velocity SIMPLE corrector { #include "UEqn.H" diff --git a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C index 47194e893f..fc6a37ea0f 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C +++ b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C @@ -59,9 +59,6 @@ int main(int argc, char *argv[]) { Info<< "Time = " << runTime.timeName() << nl << endl; - p_rgh.storePrevIter(); - rho.storePrevIter(); - // Pressure-velocity SIMPLE corrector { #include "UEqn.H" diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/Allwclean b/applications/solvers/heatTransfer/chtMultiRegionFoam/Allwclean index a4096c3fbe..c583a8de0a 100755 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/Allwclean +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/Allwclean @@ -2,7 +2,6 @@ cd ${0%/*} || exit 1 # run from this directory set -x -wclean libso coupledDerivedFvPatchFields wclean wclean chtMultiRegionSimpleFoam diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/Allwmake b/applications/solvers/heatTransfer/chtMultiRegionFoam/Allwmake index be40e0c4f4..f65ba1181b 100755 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/Allwmake +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/Allwmake @@ -2,7 +2,6 @@ cd ${0%/*} || exit 1 # run from this directory set -x -wmake libso coupledDerivedFvPatchFields wmake wmake chtMultiRegionSimpleFoam diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options b/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options index 84d0633333..2fcfff4126 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options @@ -19,5 +19,4 @@ EXE_LIBS = \ -lcompressibleLESModels \ -lmeshTools \ -lfiniteVolume \ - -lradiationModels \ - -lcoupledDerivedFvPatchFields + -lradiationModels diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/Make/options b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/Make/options index 0459735470..ef9d1fbc84 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/Make/options +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/Make/options @@ -20,5 +20,4 @@ EXE_LIBS = \ -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ -lcompressibleLESModels \ - -lradiationModels \ - -lcoupledDerivedFvPatchFields + -lradiationModels diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/Make/files b/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/Make/files deleted file mode 100644 index 8e2cf71dcc..0000000000 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C - -LIB = $(FOAM_LIBBIN)/libcoupledDerivedFvPatchFields diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/Make/options b/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/Make/options deleted file mode 100644 index 1cbced1cd3..0000000000 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/Make/options +++ /dev/null @@ -1,12 +0,0 @@ -EXE_INC = \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \ - -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude - -LIB_LIBS = \ - -lmeshTools \ - -lbasicThermophysicalModels \ - -lfiniteVolume \ - -lradiationModels diff --git a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointShapeOptimizationFoam.C b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointShapeOptimizationFoam.C index 0f0c65355f..1ba675c4bf 100644 --- a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointShapeOptimizationFoam.C +++ b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointShapeOptimizationFoam.C @@ -85,15 +85,13 @@ int main(int argc, char *argv[]) { Info<< "Time = " << runTime.timeName() << nl << endl; - p.storePrevIter(); - laminarTransport.lookup("lambda") >> lambda; //alpha += // mesh.relaxationFactor("alpha") // *(lambda*max(Ua & U, zeroSensitivity) - alpha); alpha += - mesh.relaxationFactor("alpha") + mesh.fieldRelaxationFactor("alpha") *(min(max(alpha + lambda*(Ua & U), zeroAlpha), alphaMax) - alpha); zeroCells(alpha, inletCells); @@ -148,8 +146,6 @@ int main(int argc, char *argv[]) U.correctBoundaryConditions(); } - pa.storePrevIter(); - // Adjoint Pressure-velocity SIMPLE corrector { // Adjoint Momentum predictor diff --git a/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/SRFPimpleFoam.C b/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/SRFPimpleFoam.C index ff12ed3f33..30725cd070 100644 --- a/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/SRFPimpleFoam.C +++ b/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/SRFPimpleFoam.C @@ -67,11 +67,6 @@ int main(int argc, char *argv[]) // --- Pressure-velocity PIMPLE corrector loop for (pimple.start(); pimple.loop(); pimple++) { - if (pimple.nOuterCorr() != 1) - { - p.storePrevIter(); - } - #include "UrelEqn.H" // --- PISO loop diff --git a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pimpleDyMFoam.C b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pimpleDyMFoam.C index 5e686a781a..55ee07dbc7 100644 --- a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pimpleDyMFoam.C +++ b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pimpleDyMFoam.C @@ -88,11 +88,6 @@ int main(int argc, char *argv[]) // --- Pressure-velocity PIMPLE corrector loop for (pimple.start(); pimple.loop(); pimple++) { - if (pimple.nOuterCorr() != 1) - { - p.storePrevIter(); - } - #include "UEqn.H" // --- PISO loop diff --git a/applications/solvers/incompressible/pimpleFoam/pimpleFoam.C b/applications/solvers/incompressible/pimpleFoam/pimpleFoam.C index 69cb3aaf70..e8b58bbea5 100644 --- a/applications/solvers/incompressible/pimpleFoam/pimpleFoam.C +++ b/applications/solvers/incompressible/pimpleFoam/pimpleFoam.C @@ -66,11 +66,6 @@ int main(int argc, char *argv[]) // --- Pressure-velocity PIMPLE corrector loop for (pimple.start(); pimple.loop(); pimple++) { - if (pimple.nOuterCorr() != 1) - { - p.storePrevIter(); - } - #include "UEqn.H" // --- PISO loop diff --git a/applications/solvers/incompressible/simpleFoam/MRFSimpleFoam/MRFSimpleFoam.C b/applications/solvers/incompressible/simpleFoam/MRFSimpleFoam/MRFSimpleFoam.C index 912b0a85de..c0cc824b49 100644 --- a/applications/solvers/incompressible/simpleFoam/MRFSimpleFoam/MRFSimpleFoam.C +++ b/applications/solvers/incompressible/simpleFoam/MRFSimpleFoam/MRFSimpleFoam.C @@ -60,8 +60,6 @@ int main(int argc, char *argv[]) { Info<< "Time = " << runTime.timeName() << nl << endl; - p.storePrevIter(); - // --- Pressure-velocity SIMPLE corrector { #include "UEqn.H" diff --git a/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/SRFSimpleFoam.C b/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/SRFSimpleFoam.C index 8ecf1cdf1d..7f1fef3946 100644 --- a/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/SRFSimpleFoam.C +++ b/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/SRFSimpleFoam.C @@ -56,8 +56,6 @@ int main(int argc, char *argv[]) { Info<< "Time = " << runTime.timeName() << nl << endl; - p.storePrevIter(); - // --- Pressure-velocity SIMPLE corrector { #include "UrelEqn.H" diff --git a/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/porousSimpleFoam.C b/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/porousSimpleFoam.C index bdeb2891c8..d4aaaf596a 100644 --- a/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/porousSimpleFoam.C +++ b/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/porousSimpleFoam.C @@ -58,8 +58,6 @@ int main(int argc, char *argv[]) { Info<< "Time = " << runTime.timeName() << nl << endl; - p.storePrevIter(); - // Pressure-velocity SIMPLE corrector { #include "UEqn.H" diff --git a/applications/solvers/incompressible/simpleFoam/simpleFoam.C b/applications/solvers/incompressible/simpleFoam/simpleFoam.C index c578a27bf6..ebfd10bba2 100644 --- a/applications/solvers/incompressible/simpleFoam/simpleFoam.C +++ b/applications/solvers/incompressible/simpleFoam/simpleFoam.C @@ -54,8 +54,6 @@ int main(int argc, char *argv[]) { Info<< "Time = " << runTime.timeName() << nl << endl; - p.storePrevIter(); - // --- Pressure-velocity SIMPLE corrector { #include "UEqn.H" diff --git a/applications/solvers/incompressible/simpleFoam/windSimpleFoam/windSimpleFoam.C b/applications/solvers/incompressible/simpleFoam/windSimpleFoam/windSimpleFoam.C index b06649b603..d3a8bcda19 100644 --- a/applications/solvers/incompressible/simpleFoam/windSimpleFoam/windSimpleFoam.C +++ b/applications/solvers/incompressible/simpleFoam/windSimpleFoam/windSimpleFoam.C @@ -58,8 +58,6 @@ int main(int argc, char *argv[]) { Info<< "Time = " << runTime.timeName() << nl << endl; - p.storePrevIter(); - // Pressure-velocity SIMPLE corrector { #include "UEqn.H" diff --git a/applications/solvers/lagrangian/LTSReactingParcelFoam/LTSReactingParcelFoam.C b/applications/solvers/lagrangian/LTSReactingParcelFoam/LTSReactingParcelFoam.C index fc08c9e5ef..dc642e7c72 100644 --- a/applications/solvers/lagrangian/LTSReactingParcelFoam/LTSReactingParcelFoam.C +++ b/applications/solvers/lagrangian/LTSReactingParcelFoam/LTSReactingParcelFoam.C @@ -89,11 +89,6 @@ int main(int argc, char *argv[]) // --- Pressure-velocity PIMPLE corrector loop for (pimple.start(); pimple.loop(); pimple++) { - if (pimple.nOuterCorr() != 1) - { - p.storePrevIter(); - } - turbulence->correct(); #include "UEqn.H" diff --git a/applications/solvers/lagrangian/LTSReactingParcelFoam/Make/options b/applications/solvers/lagrangian/LTSReactingParcelFoam/Make/options index 36e9c44270..30c3b5d6a1 100644 --- a/applications/solvers/lagrangian/LTSReactingParcelFoam/Make/options +++ b/applications/solvers/lagrangian/LTSReactingParcelFoam/Make/options @@ -20,7 +20,6 @@ EXE_INC = \ -I$(LIB_SRC)/ODE/lnInclude \ -I$(LIB_SRC)/regionModels/regionModel/lnInclude \ -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ - -I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/combustionModels/lnInclude EXE_LIBS = \ @@ -45,5 +44,4 @@ EXE_LIBS = \ -lODE \ -lregionModels \ -lsurfaceFilmModels \ - -lsampling \ -lcombustionModels diff --git a/applications/solvers/lagrangian/coalChemistryFoam/Make/options b/applications/solvers/lagrangian/coalChemistryFoam/Make/options index e8a8718373..21461569f8 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/Make/options +++ b/applications/solvers/lagrangian/coalChemistryFoam/Make/options @@ -20,7 +20,6 @@ EXE_INC = \ -I$(LIB_SRC)/regionModels/regionModel/lnInclude \ -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ -I$(LIB_SRC)/ODE/lnInclude \ - -I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/combustionModels/lnInclude \ -I$(FOAM_SOLVERS)/combustion/reactingFoam @@ -48,5 +47,4 @@ EXE_LIBS = \ -lregionModels \ -lsurfaceFilmModels \ -lODE \ - -lsampling \ -lcombustionModels diff --git a/applications/solvers/lagrangian/icoUncoupledKinematicParcelDyMFoam/Make/options b/applications/solvers/lagrangian/icoUncoupledKinematicParcelDyMFoam/Make/options index 0786933541..f7bb7d2f2d 100644 --- a/applications/solvers/lagrangian/icoUncoupledKinematicParcelDyMFoam/Make/options +++ b/applications/solvers/lagrangian/icoUncoupledKinematicParcelDyMFoam/Make/options @@ -14,8 +14,7 @@ EXE_INC = \ -I$(LIB_SRC)/regionModels/regionModel/lnInclude \ -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ - -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ - -I$(LIB_SRC)/sampling/lnInclude + -I$(LIB_SRC)/dynamicFvMesh/lnInclude EXE_LIBS = \ @@ -34,5 +33,4 @@ EXE_LIBS = \ -lsurfaceFilmModels \ -ldynamicMesh \ -ldynamicFvMesh \ - -ltopoChangerFvMesh \ - -lsampling + -ltopoChangerFvMesh diff --git a/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/Make/options b/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/Make/options index 58d80278f8..9986f9f78b 100644 --- a/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/Make/options +++ b/applications/solvers/lagrangian/icoUncoupledKinematicParcelFoam/Make/options @@ -11,8 +11,7 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/regionModels/regionModel/lnInclude \ - -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ - -I$(LIB_SRC)/sampling/lnInclude + -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude EXE_LIBS = \ -llagrangian \ @@ -27,5 +26,4 @@ EXE_LIBS = \ -lfiniteVolume \ -lmeshTools \ -lregionModels \ - -lsurfaceFilmModels \ - -lsampling + -lsurfaceFilmModels diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/Make/options b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/Make/options index 1abdd72178..edcc596b79 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/Make/options +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/Make/options @@ -20,7 +20,6 @@ EXE_INC = \ -I$(LIB_SRC)/ODE/lnInclude \ -I$(LIB_SRC)/regionModels/regionModel/lnInclude \ -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ - -I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/combustionModels/lnInclude \ -I$(FOAM_SOLVERS)/combustion/reactingFoam @@ -47,5 +46,4 @@ EXE_LIBS = \ -lODE \ -lregionModels \ -lsurfaceFilmModels \ - -lsampling \ -lcombustionModels diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/Make/options b/applications/solvers/lagrangian/reactingParcelFilmFoam/Make/options index 3f762b6bd0..5a1c428566 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/Make/options +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/Make/options @@ -19,7 +19,6 @@ EXE_INC = \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ -I$(LIB_SRC)/ODE/lnInclude \ - -I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/combustionModels/lnInclude \ -I$(FOAM_SOLVERS)/combustion/reactingFoam @@ -42,5 +41,4 @@ EXE_LIBS = \ -lsurfaceFilmModels \ -llagrangianIntermediate \ -lODE \ - -lsampling \ -lcombustionModels diff --git a/applications/solvers/lagrangian/reactingParcelFoam/Make/options b/applications/solvers/lagrangian/reactingParcelFoam/Make/options index e406727104..d632e22f58 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/Make/options +++ b/applications/solvers/lagrangian/reactingParcelFoam/Make/options @@ -19,7 +19,6 @@ EXE_INC = \ -I$(LIB_SRC)/ODE/lnInclude \ -I$(LIB_SRC)/regionModels/regionModel/lnInclude \ -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ - -I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/combustionModels/lnInclude \ -I$(FOAM_SOLVERS)/combustion/reactingFoam @@ -46,5 +45,4 @@ EXE_LIBS = \ -lODE \ -lregionModels \ -lsurfaceFilmModels \ - -lsampling \ -lcombustionModels diff --git a/applications/solvers/lagrangian/sprayFoam/Make/options b/applications/solvers/lagrangian/sprayFoam/Make/options index f4c66f06f9..f9cb15cc2f 100644 --- a/applications/solvers/lagrangian/sprayFoam/Make/options +++ b/applications/solvers/lagrangian/sprayFoam/Make/options @@ -20,7 +20,6 @@ EXE_INC = \ -I$(LIB_SRC)/ODE/lnInclude \ -I$(LIB_SRC)/regionModels/regionModel/lnInclude \ -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ - -I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/combustionModels/lnInclude \ -I$(FOAM_SOLVERS)/lagrangian/reactingParcelFoam @@ -48,5 +47,4 @@ EXE_LIBS = \ -lODE \ -lregionModels \ -lsurfaceFilmModels \ - -lsampling \ -lcombustionModels diff --git a/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/Make/options b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/Make/options index 7a7ddc0432..d302015a31 100644 --- a/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/Make/options +++ b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/Make/options @@ -9,8 +9,7 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/regionModels/regionModel/lnInclude \ - -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ - -I$(LIB_SRC)/sampling/lnInclude + -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude EXE_LIBS = \ -llagrangian \ @@ -25,5 +24,4 @@ EXE_LIBS = \ -lfiniteVolume \ -lmeshTools \ -lregionModels \ - -lsurfaceFilmModels \ - -lsampling + -lsurfaceFilmModels diff --git a/applications/solvers/multiphase/bubbleFoam/bubbleFoam.C b/applications/solvers/multiphase/bubbleFoam/bubbleFoam.C index f6c3e9c3d7..0d095d3648 100644 --- a/applications/solvers/multiphase/bubbleFoam/bubbleFoam.C +++ b/applications/solvers/multiphase/bubbleFoam/bubbleFoam.C @@ -70,11 +70,6 @@ int main(int argc, char *argv[]) // --- Pressure-velocity PIMPLE corrector loop for (pimple.start(); pimple.loop(); pimple++) { - if (pimple.nOuterCorr() != 1) - { - p.storePrevIter(); - } - #include "alphaEqn.H" #include "liftDragCoeffs.H" #include "UEqns.H" diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/Make/options b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/Make/options index b3674343d2..16ce2e3674 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/Make/options +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/Make/options @@ -8,7 +8,6 @@ EXE_INC = \ -Iaveraging EXE_LIBS = \ - -L$(FOAM_USER_LIBBIN) \ -lincompressibleTransportModels \ -lcompressiblePhaseModel \ -lcompressibleEulerianInterfacialModels \ diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/compressibleTwoPhaseEulerFoam.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/compressibleTwoPhaseEulerFoam.C index cec5cbf313..c764472cb7 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/compressibleTwoPhaseEulerFoam.C +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/compressibleTwoPhaseEulerFoam.C @@ -79,11 +79,6 @@ int main(int argc, char *argv[]) // --- Pressure-velocity PIMPLE corrector loop for (pimple.start(); pimple.loop(); pimple++) { - if (pimple.nOuterCorr() != 1) - { - p.storePrevIter(); - } - #include "alphaEqn.H" #include "kEpsilon.H" #include "interfacialCoeffs.H" diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/interfacialModels/Make/files b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/interfacialModels/Make/files index da6c3aeaa6..43c0f9b2a9 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/interfacialModels/Make/files +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/interfacialModels/Make/files @@ -12,4 +12,4 @@ heatTransferModels/heatTransferModel/heatTransferModel.C heatTransferModels/heatTransferModel/newHeatTransferModel.C heatTransferModels/RanzMarshall/RanzMarshall.C -LIB = $(FOAM_USER_LIBBIN)/libcompressibleEulerianInterfacialModels +LIB = $(FOAM_LIBBIN)/libcompressibleEulerianInterfacialModels diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/Make/files b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/Make/files index 2273f88cfb..d8b7d88442 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/Make/files +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/kineticTheoryModels/Make/files @@ -30,4 +30,4 @@ frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C -LIB = $(FOAM_USER_LIBBIN)/libcompressibleKineticTheoryModel +LIB = $(FOAM_LIBBIN)/libcompressibleKineticTheoryModel diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/pEqn.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/pEqn.H index bbb8765e14..ea3e825448 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/pEqn.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/pEqn.H @@ -84,23 +84,12 @@ + (alpha2/rho2)*pEqnComp2() ) + pEqnIncomp, - mesh.solver - ( - p.select(pimple.finalInnerIter(corr, nonOrth)) - /* - ( - oCorr == pimple.nOuterCorr()-1 - && corr == nCorr-1 - && nonOrth == nNonOrthCorr - ) - */ - ) + mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth))) ); if (nonOrth == pimple.nNonOrthCorr()) { surfaceScalarField mSfGradp = pEqnIncomp.flux()/Dp; - phi1 += rAlphaAU1f*mSfGradp/fvc::interpolate(rho1); phi2 += rAlphaAU2f*mSfGradp/fvc::interpolate(rho2); phi = alpha1f*phi1 + alpha2f*phi2; diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/Make/files b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/Make/files index 0b9cff82b0..c465aaa454 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/Make/files +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/phaseModel/Make/files @@ -4,4 +4,4 @@ diameterModels/diameterModel/newDiameterModel.C diameterModels/constantDiameter/constantDiameter.C diameterModels/isothermalDiameter/isothermalDiameter.C -LIB = $(FOAM_USER_LIBBIN)/libcompressiblePhaseModel +LIB = $(FOAM_LIBBIN)/libcompressiblePhaseModel diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/readTwoPhaseEulerFoamControls.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/readTwoPhaseEulerFoamControls.H index eec13762cc..9767d7c845 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/readTwoPhaseEulerFoamControls.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/readTwoPhaseEulerFoamControls.H @@ -1,4 +1,3 @@ #include "readTimeControls.H" int nAlphaCorr(readInt(pimple.dict().lookup("nAlphaCorr"))); - Switch correctAlpha(pimple.dict().lookup("correctAlpha")); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/Allwclean b/applications/solvers/multiphase/multiphaseEulerFoam/Allwclean new file mode 100755 index 0000000000..191aa8e312 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/Allwclean @@ -0,0 +1,11 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory +set -x + +wclean libso phaseModel +wclean libso multiphaseSystem +wclean libso interfacialModels +wclean libso kineticTheoryModels +wclean + +# ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/Allwmake b/applications/solvers/multiphase/multiphaseEulerFoam/Allwmake new file mode 100755 index 0000000000..8f1133699c --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/Allwmake @@ -0,0 +1,11 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory +set -x + +wmake libso phaseModel +wmake libso interfacialModels +wmake libso multiphaseSystem +wmake libso kineticTheoryModels +wmake + +# ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/CourantNo.H b/applications/solvers/multiphase/multiphaseEulerFoam/CourantNo.H new file mode 100644 index 0000000000..4bfc58978e --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/CourantNo.H @@ -0,0 +1,51 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Global + CourantNo + +Description + Calculates and outputs the mean and maximum Courant Numbers. + +\*---------------------------------------------------------------------------*/ + +scalar CoNum = 0.0; +scalar meanCoNum = 0.0; + +if (mesh.nInternalFaces()) +{ + scalarField sumPhi + ( + fvc::surfaceSum(mag(phi))().internalField() + ); + + CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue(); + + meanCoNum = + 0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue(); +} + +Info<< "Courant Number mean: " << meanCoNum + << " max: " << CoNum << endl; + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/CourantNos.H b/applications/solvers/multiphase/multiphaseEulerFoam/CourantNos.H new file mode 100644 index 0000000000..9bd18a9fcc --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/CourantNos.H @@ -0,0 +1,12 @@ +# include "CourantNo.H" + +// { +// scalar UrCoNum = 0.5*gMax +// ( +// fvc::surfaceSum(mag(phi1 - phi2))().internalField()/mesh.V().field() +// )*runTime.deltaTValue(); + +// Info<< "Max Ur Courant Number = " << UrCoNum << endl; + +// CoNum = max(CoNum, UrCoNum); +// } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/DDtU.H b/applications/solvers/multiphase/multiphaseEulerFoam/DDtU.H new file mode 100644 index 0000000000..f0f5bad356 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/DDtU.H @@ -0,0 +1,9 @@ +forAllIter(PtrDictionary, fluid.phases(), iter) +{ + phaseModel& phase = iter(); + + phase.DDtU() = + fvc::ddt(phase.U()) + + fvc::div(phase.phi(), phase.U()) + - fvc::div(phase.phi())*phase.U(); +} diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/Make/files b/applications/solvers/multiphase/multiphaseEulerFoam/Make/files new file mode 100644 index 0000000000..f71c44324a --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/Make/files @@ -0,0 +1,3 @@ +multiphaseEulerFoam.C + +EXE = $(FOAM_APPBIN)/multiphaseEulerFoam diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/Make/options b/applications/solvers/multiphase/multiphaseEulerFoam/Make/options new file mode 100644 index 0000000000..8fc20e8623 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/Make/options @@ -0,0 +1,24 @@ +EXE_INC = \ + -IphaseModel/lnInclude \ + -ImultiphaseSystem/lnInclude \ + /*-IkineticTheoryModels/lnInclude*/ \ + -IinterfacialModels/lnInclude \ + -I$(LIB_SRC)/transportModels \ + -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ + -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ + -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ + -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ + -I$(LIB_SRC)/turbulenceModels \ + -I$(LIB_SRC)/turbulenceModels/incompressible/LES/LESModel \ + -I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude + +EXE_LIBS = \ + -lmultiphaseSystem \ + -lcompressibleMultiPhaseModel \ + -linterfaceProperties \ + -lincompressibleTransportModels \ + -lcompressibleMultiphaseEulerianInterfacialModels \ + /*-lcompressibleKineticTheoryModel*/ \ + -lincompressibleLESModels \ + -lfiniteVolume diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/TEqns.H b/applications/solvers/multiphase/multiphaseEulerFoam/TEqns.H new file mode 100644 index 0000000000..26015141d2 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/TEqns.H @@ -0,0 +1,38 @@ +{ + volScalarField kByCp1("kByCp1", alpha1*(k1/Cp1/rho1 + sqr(Ct)*nut2/Prt)); + volScalarField kByCp2("kByCp2", alpha2*(k2/Cp2/rho2 + nut2/Prt)); + + fvScalarMatrix T1Eqn + ( + fvm::ddt(alpha1, T1) + + fvm::div(alphaPhi1, T1) + - fvm::Sp(fvc::ddt(alpha1) + fvc::div(alphaPhi1), T1) + - fvm::laplacian(kByCp1, T1) + == + heatTransferCoeff*T2/Cp1/rho1 + - fvm::Sp(heatTransferCoeff/Cp1/rho1, T1) + + alpha1*Dp1Dt/Cp1/rho1 + ); + + fvScalarMatrix T2Eqn + ( + fvm::ddt(alpha2, T2) + + fvm::div(alphaPhi2, T2) + - fvm::Sp(fvc::ddt(alpha2) + fvc::div(alphaPhi2), T2) + - fvm::laplacian(kByCp2, T2) + == + heatTransferCoeff*T1/Cp2/rho2 + - fvm::Sp(heatTransferCoeff/Cp2/rho2, T2) + + alpha2*Dp2Dt/Cp2/rho2 + ); + + T1Eqn.relax(); + T1Eqn.solve(); + + T2Eqn.relax(); + T2Eqn.solve(); + + // Update compressibilities + psi1 = 1.0/(R1*T1); + psi2 = 1.0/(R2*T2); +} diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/UEqns.H b/applications/solvers/multiphase/multiphaseEulerFoam/UEqns.H new file mode 100644 index 0000000000..1ee149c48e --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/UEqns.H @@ -0,0 +1,40 @@ +PtrList UEqns(fluid.phases().size()); +autoPtr dragCoeffs(fluid.dragCoeffs()); + +int phasei = 0; +forAllIter(PtrDictionary, fluid.phases(), iter) +{ + phaseModel& phase = iter(); + const volScalarField& alpha = phase; + volVectorField& U = phase.U(); + + volScalarField nuEff(sgsModel->nut() + iter().nu()); + + UEqns.set + ( + phasei, + new fvVectorMatrix + ( + (scalar(1) + fluid.Cvm(phase)/phase.rho())* + ( + fvm::ddt(alpha, U) + + fvm::div(phase.phiAlpha(), U) + - fvm::Sp(fvc::ddt(alpha) + fvc::div(phase.phiAlpha()), U) + ) + - fvm::laplacian(alpha*nuEff, U) + - fvc::div + ( + alpha*(nuEff*dev(T(fvc::grad(U))) /*- ((2.0/3.0)*I)*k*/), + "div(Rc)" + ) + == + - fvm::Sp(fluid.dragCoeff(phase, dragCoeffs())/phase.rho(), U) + //- (alpha*phase.rho())*fluid.lift(phase) + + (alpha/phase.rho())*fluid.Svm(phase) + ) + ); + mrfZones.addCoriolis(alpha, UEqns[phasei]); + UEqns[phasei].relax(); + + phasei++; +} diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/alphaEqnComp.H b/applications/solvers/multiphase/multiphaseEulerFoam/alphaEqnComp.H new file mode 100644 index 0000000000..f0ebde6332 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/alphaEqnComp.H @@ -0,0 +1,105 @@ +surfaceScalarField alphaPhi1("alphaPhi1", phi1); +surfaceScalarField alphaPhi2("alphaPhi2", phi2); + +{ + word scheme("div(phi,alpha1)"); + word schemer("div(phir,alpha1)"); + + surfaceScalarField phic("phic", phi); + surfaceScalarField phir("phir", phi1 - phi2); + + if (g0.value() > 0.0) + { + surfaceScalarField alpha1f = fvc::interpolate(alpha1); + surfaceScalarField phipp = ppMagf*fvc::snGrad(alpha1)*mesh.magSf(); + phir += phipp; + phic += fvc::interpolate(alpha1)*phipp; + } + + for (int acorr=0; acorr 0.0 && alpha1[celli] > 0.0) + { + Sp[celli] -= dgdt[celli]*alpha1[celli]; + Su[celli] += dgdt[celli]*alpha1[celli]; + } + else if (dgdt[celli] < 0.0 && alpha1[celli] < 1.0) + { + Sp[celli] += dgdt[celli]*(1.0 - alpha1[celli]); + } + } + + + fvScalarMatrix alpha1Eqn + ( + fvm::ddt(alpha1) + + fvm::div(phic, alpha1, scheme) + + fvm::div(-fvc::flux(-phir, alpha2, schemer), alpha1, schemer) + == + fvm::Sp(Sp, alpha1) + Su + ); + + if (g0.value() > 0.0) + { + ppMagf = rU1Af*fvc::interpolate + ( + (1.0/(rho1*(alpha1 + scalar(0.0001)))) + *g0*min(exp(preAlphaExp*(alpha1 - alphaMax)), expMax) + ); + + alpha1Eqn -= fvm::laplacian + ( + (fvc::interpolate(alpha1) + scalar(0.0001))*ppMagf, + alpha1, + "laplacian(alphaPpMag,alpha1)" + ); + } + + alpha1Eqn.relax(); + alpha1Eqn.solve(); + + //***HGW temporary boundedness-fix pending the introduction of MULES + alpha1 = max(min(alpha1, 1.0), 0.0); + + #include "packingLimiter.H" + + alphaPhi1 = alpha1Eqn.flux(); + alphaPhi2 = phi - alphaPhi1; + alpha2 = scalar(1) - alpha1; + + Info<< "Dispersed phase volume fraction = " + << alpha1.weightedAverage(mesh.V()).value() + << " Min(alpha1) = " << min(alpha1).value() + << " Max(alpha1) = " << max(alpha1).value() + << endl; + } +} + +rho = alpha1*rho1 + alpha2*rho2; diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/correctPhi.H b/applications/solvers/multiphase/multiphaseEulerFoam/correctPhi.H new file mode 100644 index 0000000000..92c8676225 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/correctPhi.H @@ -0,0 +1,54 @@ +{ + #include "continuityErrs.H" + + wordList pcorrTypes + ( + p.boundaryField().size(), + zeroGradientFvPatchScalarField::typeName + ); + + forAll (p.boundaryField(), i) + { + if (p.boundaryField()[i].fixesValue()) + { + pcorrTypes[i] = fixedValueFvPatchScalarField::typeName; + } + } + + volScalarField pcorr + ( + IOobject + ( + "pcorr", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionedScalar("pcorr", p.dimensions(), 0.0), + pcorrTypes + ); + + dimensionedScalar rAUf("(1|A(U))", dimTime/rho.dimensions(), 1.0); + + adjustPhi(phi, U, pcorr); + + for (int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++) + { + fvScalarMatrix pcorrEqn + ( + fvm::laplacian(rAUf, pcorr) == fvc::div(phi) + ); + + pcorrEqn.setReference(pRefCell, pRefValue); + pcorrEqn.solve(); + + if (nonOrth == pimple.nNonOrthCorr()) + { + phi -= pcorrEqn.flux(); + } + } + + #include "continuityErrs.H" +} diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/createFields.H b/applications/solvers/multiphase/multiphaseEulerFoam/createFields.H new file mode 100644 index 0000000000..6b859f068f --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/createFields.H @@ -0,0 +1,85 @@ + #include "readGravitationalAcceleration.H" + + Info<< "Reading field p\n" << endl; + volScalarField p + ( + IOobject + ( + "p", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + volVectorField U + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedVector("U", dimVelocity, vector::zero) + ); + + surfaceScalarField phi + ( + IOobject + ( + "phi", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedScalar("phi", dimArea*dimVelocity, 0) + ); + + multiphaseSystem fluid(mesh, phi); + + forAllIter(PtrDictionary, fluid.phases(), iter) + { + phaseModel& phase = iter(); + const volScalarField& alpha = phase; + + U += alpha*phase.U(); + phi += fvc::interpolate(alpha)*phase.phi(); + } + + // dimensionedScalar pMin + // ( + // "pMin", + // dimPressure, + // fluid.lookup("pMin") + // ); + + volScalarField rho + ( + IOobject + ( + "rho", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + fluid.rho() + ); + + label pRefCell = 0; + scalar pRefValue = 0.0; + setRefCell(p, mesh.solutionDict().subDict("PIMPLE"), pRefCell, pRefValue); + + singlePhaseTransportModel laminarTransport(U, phi); + + autoPtr sgsModel + ( + incompressible::LESModel::New(U, phi, laminarTransport) + ); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/createMRFZones.H b/applications/solvers/multiphase/multiphaseEulerFoam/createMRFZones.H new file mode 100644 index 0000000000..161446a8e6 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/createMRFZones.H @@ -0,0 +1,2 @@ + MRFZones mrfZones(mesh); + mrfZones.correctBoundaryVelocity(U); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCoeffs.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCoeffs.H new file mode 100644 index 0000000000..436b68a2f2 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialCoeffs.H @@ -0,0 +1,80 @@ +volScalarField dragCoeff +( + IOobject + ( + "dragCoeff", + runTime.timeName(), + mesh + ), + mesh, + dimensionedScalar("dragCoeff", dimensionSet(1, -3, -1, 0, 0), 0) +); + +volVectorField liftForce +( + IOobject + ( + "liftForce", + runTime.timeName(), + mesh + ), + mesh, + dimensionedVector("liftForce", dimensionSet(1, -2, -2, 0, 0), vector::zero) +); + +volScalarField heatTransferCoeff +( + IOobject + ( + "heatTransferCoeff", + runTime.timeName(), + mesh + ), + mesh, + dimensionedScalar("heatTransferCoeff", dimensionSet(1, -1, -3, -1, 0), 0) +); + +{ + volVectorField Ur = U1 - U2; + volScalarField magUr = mag(Ur); + + if (dispersedPhase == "1") + { + dragCoeff = drag1->K(magUr); + heatTransferCoeff = heatTransfer1->K(magUr); + } + else if (dispersedPhase == "2") + { + dragCoeff = drag2->K(magUr); + heatTransferCoeff = heatTransfer2->K(magUr); + } + else if (dispersedPhase == "both") + { + dragCoeff = + ( + alpha2*drag1->K(magUr) + + alpha1*drag2->K(magUr) + ); + + heatTransferCoeff = + ( + alpha2*heatTransfer1->K(magUr) + + alpha1*heatTransfer2->K(magUr) + ); + } + else + { + FatalErrorIn(args.executable()) + << "dispersedPhase: " << dispersedPhase << " is incorrect" + << exit(FatalError); + } + + volScalarField alphaCoeff + ( + (alpha1 + minInterfaceAlpha)*(alpha2 + minInterfaceAlpha) + ); + dragCoeff *= alphaCoeff; + heatTransferCoeff *= alphaCoeff; + + liftForce = Cl*(alpha1*rho1 + alpha2*rho2)*(Ur ^ fvc::curl(U)); +} diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/Make/files b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/Make/files new file mode 100644 index 0000000000..43869fde40 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/Make/files @@ -0,0 +1,16 @@ +dragModels/dragModel/dragModel.C +dragModels/dragModel/newDragModel.C +dragModels/Ergun/Ergun.C +dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C +dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C +dragModels/SchillerNaumann/SchillerNaumann.C +dragModels/Gibilaro/Gibilaro.C +dragModels/WenYu/WenYu.C +dragModels/SyamlalOBrien/SyamlalOBrien.C +dragModels/blended/blended.C + +heatTransferModels/heatTransferModel/heatTransferModel.C +heatTransferModels/heatTransferModel/newHeatTransferModel.C +heatTransferModels/RanzMarshall/RanzMarshall.C + +LIB = $(FOAM_LIBBIN)/libcompressibleMultiphaseEulerianInterfacialModels diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/Make/options b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/Make/options new file mode 100644 index 0000000000..42c2cb54c9 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/Make/options @@ -0,0 +1,6 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I../phaseModel/lnInclude + +LIB_LIBS = \ + -lphaseModel diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C new file mode 100644 index 0000000000..589f4a4e81 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C @@ -0,0 +1,82 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "Ergun.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace dragModels +{ + defineTypeNameAndDebug(Ergun, 0); + + addToRunTimeSelectionTable + ( + dragModel, + Ergun, + dictionary + ); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::dragModels::Ergun::Ergun +( + const dictionary& interfaceDict, + const phaseModel& phase1, + const phaseModel& phase2 +) +: + dragModel(interfaceDict, phase1, phase2) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::dragModels::Ergun::~Ergun() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp Foam::dragModels::Ergun::K +( + const volScalarField& Ur +) const +{ + volScalarField beta(max(phase2_, scalar(1.0e-6))); + + return + 150.0*phase1_*phase2_.nu()*phase2_.rho() + /sqr(beta*phase1_.d()) + + 1.75*phase2_.rho()*Ur/(beta*phase1_.d()); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.H new file mode 100644 index 0000000000..8efc5d4ce8 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.H @@ -0,0 +1,95 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::dragModels::Ergun + +Description + H, Enwald, E. Peirano, A-E Almstedt + 'Eulerian Two-Phase Flow Theory Applied to Fluidization' + Int. J. Multiphase Flow, Vol. 22, Suppl, pp. 21-66 (1996) + Eq. 104, p. 42 + +SourceFiles + Ergun.C + +\*---------------------------------------------------------------------------*/ + +#ifndef Ergun_H +#define Ergun_H + +#include "dragModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace dragModels +{ + +/*---------------------------------------------------------------------------*\ + Class Ergun Declaration +\*---------------------------------------------------------------------------*/ + +class Ergun +: + public dragModel +{ + +public: + + //- Runtime type information + TypeName("Ergun"); + + + // Constructors + + //- Construct from components + Ergun + ( + const dictionary& interfaceDict, + const phaseModel& phase1, + const phaseModel& phase2 + ); + + + //- Destructor + virtual ~Ergun(); + + + // Member Functions + + tmp K(const volScalarField& Ur) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace dragModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C new file mode 100644 index 0000000000..767d2e34fe --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C @@ -0,0 +1,81 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "Gibilaro.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace dragModels +{ + defineTypeNameAndDebug(Gibilaro, 0); + + addToRunTimeSelectionTable + ( + dragModel, + Gibilaro, + dictionary + ); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::dragModels::Gibilaro::Gibilaro +( + const dictionary& interfaceDict, + const phaseModel& phase1, + const phaseModel& phase2 +) +: + dragModel(interfaceDict, phase1, phase2) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::dragModels::Gibilaro::~Gibilaro() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp Foam::dragModels::Gibilaro::K +( + const volScalarField& Ur +) const +{ + volScalarField beta(max(phase2_, scalar(1.0e-6))); + volScalarField bp(pow(beta, -2.8)); + volScalarField Re(max(beta*Ur*phase1_.d()/phase2_.nu(), scalar(1.0e-3))); + + return (17.3/Re + scalar(0.336))*phase2_.rho()*Ur*bp/phase1_.d(); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.H new file mode 100644 index 0000000000..c6c0e3c88d --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.H @@ -0,0 +1,95 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::dragModels::Gibilaro + +Description + H, Enwald, E. Peirano, A-E Almstedt + 'Eulerian Two-Phase Flow Theory Applied to Fluidization' + Int. J. Multiphase Flow, Vol. 22, Suppl, pp. 21-66 (1996) + Eq. 106, p. 43 + +SourceFiles + Gibilaro.C + +\*---------------------------------------------------------------------------*/ + +#ifndef Gibilaro_H +#define Gibilaro_H + +#include "dragModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace dragModels +{ + +/*---------------------------------------------------------------------------*\ + Class Gibilaro Declaration +\*---------------------------------------------------------------------------*/ + +class Gibilaro +: + public dragModel +{ + +public: + + //- Runtime type information + TypeName("Gibilaro"); + + + // Constructors + + //- Construct from components + Gibilaro + ( + const dictionary& interfaceDict, + const phaseModel& phase1, + const phaseModel& phase2 + ); + + + //- Destructor + virtual ~Gibilaro(); + + + // Member Functions + + tmp K(const volScalarField& Ur) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace dragModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C new file mode 100644 index 0000000000..e34f219ebc --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C @@ -0,0 +1,109 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "GidaspowErgunWenYu.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace dragModels +{ + defineTypeNameAndDebug(GidaspowErgunWenYu, 0); + + addToRunTimeSelectionTable + ( + dragModel, + GidaspowErgunWenYu, + dictionary + ); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::dragModels::GidaspowErgunWenYu::GidaspowErgunWenYu +( + const dictionary& interfaceDict, + const phaseModel& phase1, + const phaseModel& phase2 +) +: + dragModel(interfaceDict, phase1, phase2) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::dragModels::GidaspowErgunWenYu::~GidaspowErgunWenYu() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp Foam::dragModels::GidaspowErgunWenYu::K +( + const volScalarField& Ur +) const +{ + volScalarField beta(max(phase2_, scalar(1.0e-6))); + volScalarField d = phase1_.d(); + volScalarField bp(pow(beta, -2.65)); + volScalarField Re(max(Ur*d/phase2_.nu(), scalar(1.0e-3))); + + volScalarField Cds(24.0*(1.0 + 0.15*pow(Re, 0.687))/Re); + + forAll(Re, celli) + { + if (Re[celli] > 1000.0) + { + Cds[celli] = 0.44; + } + } + + // Wen and Yu (1966) + tmp tKWenYu = 0.75*Cds*phase2_.rho()*Ur*bp/d; + volScalarField& KWenYu = tKWenYu(); + + // Ergun + forAll (beta, cellj) + { + if (beta[cellj] <= 0.8) + { + KWenYu[cellj] = + 150.0*phase1_[cellj]*phase2_.nu().value()*phase2_.rho().value() + /sqr(beta[cellj]*d[cellj]) + + 1.75*phase2_.rho().value()*Ur[cellj] + /(beta[cellj]*d[cellj]); + } + } + + return tKWenYu; +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.H new file mode 100644 index 0000000000..3e1812fbbb --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.H @@ -0,0 +1,93 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::dragModels::GidaspowErgunWenYu + +Description + D. Gidaspow, Multiphase flow and fluidization, + Academic Press, New York, 1994. + +SourceFiles + GidaspowErgunWenYu.C + +\*---------------------------------------------------------------------------*/ + +#ifndef GidaspowErgunWenYu_H +#define GidaspowErgunWenYu_H + +#include "dragModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace dragModels +{ + +/*---------------------------------------------------------------------------*\ + Class GidaspowErgunWenYu Declaration +\*---------------------------------------------------------------------------*/ + +class GidaspowErgunWenYu +: + public dragModel +{ + +public: + + //- Runtime type information + TypeName("GidaspowErgunWenYu"); + + + // Constructors + + //- Construct from components + GidaspowErgunWenYu + ( + const dictionary& interfaceDict, + const phaseModel& phase1, + const phaseModel& phase2 + ); + + + //- Destructor + virtual ~GidaspowErgunWenYu(); + + + // Member Functions + + tmp K(const volScalarField& Ur) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace dragModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C new file mode 100644 index 0000000000..ecd25eb386 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C @@ -0,0 +1,91 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "GidaspowSchillerNaumann.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace dragModels +{ + defineTypeNameAndDebug(GidaspowSchillerNaumann, 0); + + addToRunTimeSelectionTable + ( + dragModel, + GidaspowSchillerNaumann, + dictionary + ); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::dragModels::GidaspowSchillerNaumann::GidaspowSchillerNaumann +( + const dictionary& interfaceDict, + const phaseModel& phase1, + const phaseModel& phase2 +) +: + dragModel(interfaceDict, phase1, phase2) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::dragModels::GidaspowSchillerNaumann::~GidaspowSchillerNaumann() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp Foam::dragModels::GidaspowSchillerNaumann::K +( + const volScalarField& Ur +) const +{ + volScalarField beta(max(phase2_, scalar(1e-6))); + volScalarField bp(pow(beta, -2.65)); + + volScalarField Re(max(beta*Ur*phase1_.d()/phase2_.nu(), scalar(1.0e-3))); + volScalarField Cds(24.0*(scalar(1) + 0.15*pow(Re, 0.687))/Re); + + forAll(Re, celli) + { + if (Re[celli] > 1000.0) + { + Cds[celli] = 0.44; + } + } + + return 0.75*Cds*phase2_.rho()*Ur*bp/phase1_.d(); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.H new file mode 100644 index 0000000000..d7c316536b --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.H @@ -0,0 +1,102 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::dragModels::GidaspowSchillerNaumann + +Description + H, Enwald, E. Peirano, A-E Almstedt + 'Eulerian Two-Phase Flow Theory Applied to Fluidization' + Int. J. Multiphase Flow, Vol. 22, Suppl, pp. 21-66 (1996) + Eq. 86-87, p. 40 + + This is identical to the Wen and Yu, Rowe model Table 3.6 p.56 in + the Ph.D. thesis of Berend van Wachem + 'Derivation, Implementation and Validation + of + Computer Simulation Models + for Gas-Solid Fluidized Beds' + +SourceFiles + GidaspowSchillerNaumann.C + +\*---------------------------------------------------------------------------*/ + +#ifndef GidaspowSchillerNaumann_H +#define GidaspowSchillerNaumann_H + +#include "dragModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace dragModels +{ + +/*---------------------------------------------------------------------------*\ + Class GidaspowSchillerNaumann Declaration +\*---------------------------------------------------------------------------*/ + +class GidaspowSchillerNaumann +: + public dragModel +{ + +public: + + //- Runtime type information + TypeName("GidaspowSchillerNaumann"); + + + // Constructors + + //- Construct from components + GidaspowSchillerNaumann + ( + const dictionary& interfaceDict, + const phaseModel& phase1, + const phaseModel& phase2 + ); + + + //- Destructor + virtual ~GidaspowSchillerNaumann(); + + + // Member Functions + + tmp K(const volScalarField& Ur) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace dragModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.C new file mode 100644 index 0000000000..3259b5d0e0 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.C @@ -0,0 +1,88 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "SchillerNaumann.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace dragModels +{ + defineTypeNameAndDebug(SchillerNaumann, 0); + + addToRunTimeSelectionTable + ( + dragModel, + SchillerNaumann, + dictionary + ); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::dragModels::SchillerNaumann::SchillerNaumann +( + const dictionary& interfaceDict, + const phaseModel& phase1, + const phaseModel& phase2 +) +: + dragModel(interfaceDict, phase1, phase2) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::dragModels::SchillerNaumann::~SchillerNaumann() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp Foam::dragModels::SchillerNaumann::K +( + const volScalarField& Ur +) const +{ + volScalarField Re(max(Ur*phase1_.d()/phase2_.nu(), scalar(1.0e-3))); + volScalarField Cds(24.0*(scalar(1) + 0.15*pow(Re, 0.687))/Re); + + forAll(Re, celli) + { + if (Re[celli] > 1000.0) + { + Cds[celli] = 0.44; + } + } + + return 0.75*Cds*phase2_.rho()*Ur/phase1_.d(); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.H new file mode 100644 index 0000000000..33d291d6bb --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.H @@ -0,0 +1,91 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::dragModels::SchillerNaumann + +Description + +SourceFiles + SchillerNaumann.C + +\*---------------------------------------------------------------------------*/ + +#ifndef SchillerNaumann_H +#define SchillerNaumann_H + +#include "dragModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace dragModels +{ + +/*---------------------------------------------------------------------------*\ + Class SchillerNaumann Declaration +\*---------------------------------------------------------------------------*/ + +class SchillerNaumann +: + public dragModel +{ + +public: + + //- Runtime type information + TypeName("SchillerNaumann"); + + + // Constructors + + //- Construct from components + SchillerNaumann + ( + const dictionary& interfaceDict, + const phaseModel& phase1, + const phaseModel& phase2 + ); + + + //- Destructor + virtual ~SchillerNaumann(); + + + // Member Functions + + tmp K(const volScalarField& Ur) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace dragModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.C new file mode 100644 index 0000000000..736be885e0 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.C @@ -0,0 +1,101 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "SyamlalOBrien.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace dragModels +{ + defineTypeNameAndDebug(SyamlalOBrien, 0); + + addToRunTimeSelectionTable + ( + dragModel, + SyamlalOBrien, + dictionary + ); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::dragModels::SyamlalOBrien::SyamlalOBrien +( + const dictionary& interfaceDict, + const phaseModel& phase1, + const phaseModel& phase2 +) +: + dragModel(interfaceDict, phase1, phase2) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::dragModels::SyamlalOBrien::~SyamlalOBrien() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp Foam::dragModels::SyamlalOBrien::K +( + const volScalarField& Ur +) const +{ + volScalarField beta(max(phase2_, scalar(1.0e-6))); + volScalarField A(pow(beta, 4.14)); + volScalarField B(0.8*pow(beta, 1.28)); + + forAll (beta, celli) + { + if (beta[celli] > 0.85) + { + B[celli] = pow(beta[celli], 2.65); + } + } + + volScalarField Re(max(Ur*phase1_.d()/phase2_.nu(), scalar(1.0e-3))); + + volScalarField Vr + ( + 0.5* + ( + A - 0.06*Re + sqrt(sqr(0.06*Re) + 0.12*Re*(2.0*B - A) + sqr(A)) + ) + ); + + volScalarField Cds(sqr(0.63 + 4.8*sqrt(Vr/Re))); + + return 0.75*Cds*phase2_.rho()*Ur/(phase1_.d()*sqr(Vr)); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.H new file mode 100644 index 0000000000..05aaa96480 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.H @@ -0,0 +1,94 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::dragModels::SyamlalOBrien + +Description + Syamlal, M., Rogers, W. and O'Brien, T. J. (1993) MFIX documentation, + Theory Guide. Technical Note DOE/METC-94/1004. Morgantown, West Virginia, + USA. + +SourceFiles + SyamlalOBrien.C + +\*---------------------------------------------------------------------------*/ + +#ifndef SyamlalOBrien_H +#define SyamlalOBrien_H + +#include "dragModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace dragModels +{ + +/*---------------------------------------------------------------------------*\ + Class SyamlalOBrien Declaration +\*---------------------------------------------------------------------------*/ + +class SyamlalOBrien +: + public dragModel +{ + +public: + + //- Runtime type information + TypeName("SyamlalOBrien"); + + + // Constructors + + //- Construct from components + SyamlalOBrien + ( + const dictionary& interfaceDict, + const phaseModel& phase1, + const phaseModel& phase2 + ); + + + //- Destructor + virtual ~SyamlalOBrien(); + + + // Member Functions + + tmp K(const volScalarField& Ur) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace dragModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.C new file mode 100644 index 0000000000..6cfc119c1c --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.C @@ -0,0 +1,91 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "WenYu.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace dragModels +{ + defineTypeNameAndDebug(WenYu, 0); + + addToRunTimeSelectionTable + ( + dragModel, + WenYu, + dictionary + ); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::dragModels::WenYu::WenYu +( + const dictionary& interfaceDict, + const phaseModel& phase1, + const phaseModel& phase2 +) +: + dragModel(interfaceDict, phase1, phase2) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::dragModels::WenYu::~WenYu() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp Foam::dragModels::WenYu::K +( + const volScalarField& Ur +) const +{ + volScalarField beta(max(phase2_, scalar(1.0e-6))); + volScalarField bp(pow(beta, -2.65)); + + volScalarField Re(max(Ur*phase1_.d()/phase2_.nu(), scalar(1.0e-3))); + volScalarField Cds(24.0*(scalar(1) + 0.15*pow(Re, 0.687))/Re); + + forAll(Re, celli) + { + if (Re[celli] > 1000.0) + { + Cds[celli] = 0.44; + } + } + + return 0.75*Cds*phase2_.rho()*Ur*bp/phase1_.d(); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.H new file mode 100644 index 0000000000..ba326510e5 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.H @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::dragModels::WenYu + +Description + H, Enwald, E. Peirano, A-E Almstedt + 'Eulerian Two-Phase Flow Theory Applied to Fluidization' + Int. J. Multiphase Flow, Vol. 22, Suppl, pp. 21-66 (1996) + Eq. 86-87, p. 40 + + This is identical to the Wen and Yu, Rowe model Table 3.6 p.56 in + the Ph.D. thesis of Berend van Wachem + 'Derivation, Implementation and Validation + of + Computer Simulation Models + for Gas-Solid Fluidized Beds' + + NB: The difference between the Gidaspow-version is the void-fraction + in the Re-number + +SourceFiles + WenYu.C + +\*---------------------------------------------------------------------------*/ + +#ifndef WenYu_H +#define WenYu_H + +#include "dragModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace dragModels +{ + +/*---------------------------------------------------------------------------*\ + Class WenYu Declaration +\*---------------------------------------------------------------------------*/ + +class WenYu +: + public dragModel +{ + +public: + + //- Runtime type information + TypeName("WenYu"); + + + // Constructors + + //- Construct from components + WenYu + ( + const dictionary& interfaceDict, + const phaseModel& phase1, + const phaseModel& phase2 + ); + + + //- Destructor + virtual ~WenYu(); + + + // Member Functions + + tmp K(const volScalarField& Ur) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace dragModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/blended/blended.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/blended/blended.C new file mode 100644 index 0000000000..49b2a01e0e --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/blended/blended.C @@ -0,0 +1,79 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "blended.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace dragModels +{ + defineTypeNameAndDebug(blended, 0); + + addToRunTimeSelectionTable + ( + dragModel, + blended, + dictionary + ); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::dragModels::blended::blended +( + const dictionary& interfaceDict, + const phaseModel& phase1, + const phaseModel& phase2 +) +: + dragModel(interfaceDict, phase1, phase2), + dragModel1_(New(interfaceDict.subDict(phase1.name()), phase1, phase2)), + dragModel2_(New(interfaceDict.subDict(phase2.name()), phase2, phase1)) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::dragModels::blended::~blended() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp Foam::dragModels::blended::K +( + const volScalarField& Ur +) const +{ + return phase2()*dragModel1_->K(Ur) + phase1()*dragModel2_->K(Ur); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/blended/blended.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/blended/blended.H new file mode 100644 index 0000000000..6836a228ef --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/blended/blended.H @@ -0,0 +1,99 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::dragModels::blended + +Description + Blends two drag models based on the phase fractions to handle + phase-inversion. + +SourceFiles + blended.C + +\*---------------------------------------------------------------------------*/ + +#ifndef blended_H +#define blended_H + +#include "dragModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace dragModels +{ + +/*---------------------------------------------------------------------------*\ + Class blended Declaration +\*---------------------------------------------------------------------------*/ + +class blended +: + public dragModel +{ + // Private data + + // The two drag models to be blended + autoPtr dragModel1_; + autoPtr dragModel2_; + + +public: + + //- Runtime type information + TypeName("blended"); + + + // Constructors + + //- Construct from components + blended + ( + const dictionary& interfaceDict, + const phaseModel& phase1, + const phaseModel& phase2 + ); + + + //- Destructor + virtual ~blended(); + + + // Member Functions + + tmp K(const volScalarField& Ur) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace dragModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/dragModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/dragModel.C new file mode 100644 index 0000000000..f3ec039684 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/dragModel.C @@ -0,0 +1,64 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "dragModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(dragModel, 0); + defineRunTimeSelectionTable(dragModel, dictionary); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::dragModel::dragModel +( + const dictionary& interfaceDict, + const phaseModel& phase1, + const phaseModel& phase2 +) +: + interfaceDict_(interfaceDict), + phase1_(phase1), + phase2_(phase2), + residualDrag_ + ( + "residualDrag", + dimensionSet(1, -3, -1, 0, 0), + interfaceDict.lookup("residualDrag") + ) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::dragModel::~dragModel() +{} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/dragModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/dragModel.H new file mode 100644 index 0000000000..37413d83e4 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/dragModel.H @@ -0,0 +1,145 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::dragModel + +Description + +SourceFiles + dragModel.C + newDragModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef dragModel_H +#define dragModel_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "dictionary.H" +#include "phaseModel.H" +#include "runTimeSelectionTables.H" + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class dragModel Declaration +\*---------------------------------------------------------------------------*/ + +class dragModel +{ +protected: + + // Protected data + + const dictionary& interfaceDict_; + const phaseModel& phase1_; + const phaseModel& phase2_; + dimensionedScalar residualDrag_; + +public: + + //- Runtime type information + TypeName("dragModel"); + + + // Declare runtime construction + + declareRunTimeSelectionTable + ( + autoPtr, + dragModel, + dictionary, + ( + const dictionary& interfaceDict, + const phaseModel& phase1, + const phaseModel& phase2 + ), + (interfaceDict, phase1, phase2) + ); + + + // Constructors + + dragModel + ( + const dictionary& interfaceDict, + const phaseModel& phase1, + const phaseModel& phase2 + ); + + + //- Destructor + virtual ~dragModel(); + + + // Selectors + + static autoPtr New + ( + const dictionary& interfaceDict, + const phaseModel& phase1, + const phaseModel& phase2 + ); + + + // Member Functions + + const phaseModel& phase1() const + { + return phase1_; + } + + const phaseModel& phase2() const + { + return phase2_; + } + + const dimensionedScalar& residualDrag() const + { + return residualDrag_; + } + + //- the dragfunction K used in the momentum eq. + // ddt(alpha*rhoa*Ua) + ... = ... alpha*beta*K*(Ua-Ub) + // ddt(beta*rhob*Ub) + ... = ... alpha*beta*K*(Ub-Ua) + // ********************************** NB ! ***************************** + // for numerical reasons alpha and beta has been + // extracted from the dragFunction K, + // so you MUST divide K by alpha*beta when implemnting the drag function + // ********************************** NB ! ***************************** + virtual tmp K(const volScalarField& Ur) const = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C new file mode 100644 index 0000000000..72542bc01b --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C @@ -0,0 +1,61 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "dragModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +Foam::autoPtr Foam::dragModel::New +( + const dictionary& interfaceDict, + const phaseModel& phase1, + const phaseModel& phase2 +) +{ + word dragModelType(interfaceDict.lookup("type")); + + Info << "Selecting dragModel for phase " + << phase1.name() + << ": " + << dragModelType << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(dragModelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorIn("dragModel::New") + << "Unknown dragModelType type " + << dragModelType << endl << endl + << "Valid dragModel types are : " << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return cstrIter()(interfaceDict, phase1, phase2); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.C new file mode 100644 index 0000000000..34a945690a --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.C @@ -0,0 +1,83 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "RanzMarshall.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace heatTransferModels +{ + defineTypeNameAndDebug(RanzMarshall, 0); + + addToRunTimeSelectionTable + ( + heatTransferModel, + RanzMarshall, + dictionary + ); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::heatTransferModels::RanzMarshall::RanzMarshall +( + const dictionary& interfaceDict, + const volScalarField& alpha, + const phaseModel& phase1, + const phaseModel& phase2 +) +: + heatTransferModel(interfaceDict, alpha, phase1, phase2) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::heatTransferModels::RanzMarshall::~RanzMarshall() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp Foam::heatTransferModels::RanzMarshall::K +( + const volScalarField& Ur +) const +{ + volScalarField Re = max(Ur*phase1_.d()/phase2_.nu(), scalar(1.0e-3)); + dimensionedScalar Prb = + phase2_.rho()*phase2_.nu()*phase2_.Cp()/phase2_.kappa(); + volScalarField Nu = scalar(2) + 0.6*sqrt(Re)*cbrt(Prb); + + return 6.0*phase2_.kappa()*Nu/sqr(phase1_.d()); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.H new file mode 100644 index 0000000000..0013e3f1d1 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.H @@ -0,0 +1,92 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::heatTransferModels::RanzMarshall + +Description + +SourceFiles + RanzMarshall.C + +\*---------------------------------------------------------------------------*/ + +#ifndef RanzMarshall_H +#define RanzMarshall_H + +#include "heatTransferModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace heatTransferModels +{ + +/*---------------------------------------------------------------------------*\ + Class RanzMarshall Declaration +\*---------------------------------------------------------------------------*/ + +class RanzMarshall +: + public heatTransferModel +{ + +public: + + //- Runtime type information + TypeName("RanzMarshall"); + + + // Constructors + + //- Construct from components + RanzMarshall + ( + const dictionary& interfaceDict, + const volScalarField& alpha, + const phaseModel& phase1, + const phaseModel& phase2 + ); + + + //- Destructor + virtual ~RanzMarshall(); + + + // Member Functions + + tmp K(const volScalarField& Ur) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace heatTransferModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.C new file mode 100644 index 0000000000..810adfe415 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.C @@ -0,0 +1,60 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "heatTransferModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(heatTransferModel, 0); + defineRunTimeSelectionTable(heatTransferModel, dictionary); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::heatTransferModel::heatTransferModel +( + const dictionary& interfaceDict, + const volScalarField& alpha, + const phaseModel& phase1, + const phaseModel& phase2 +) +: + interfaceDict_(interfaceDict), + alpha_(alpha), + phase1_(phase1), + phase2_(phase2) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::heatTransferModel::~heatTransferModel() +{} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.H new file mode 100644 index 0000000000..e4871f2c51 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.H @@ -0,0 +1,135 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::heatTransferModel + +Description + +SourceFiles + heatTransferModel.C + newHeatTransferModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef heatTransferModel_H +#define heatTransferModel_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "dictionary.H" +#include "phaseModel.H" +#include "runTimeSelectionTables.H" + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class heatTransferModel Declaration +\*---------------------------------------------------------------------------*/ + +class heatTransferModel +{ +protected: + + // Protected data + + const dictionary& interfaceDict_; + const volScalarField& alpha_; + const phaseModel& phase1_; + const phaseModel& phase2_; + + +public: + + //- Runtime type information + TypeName("heatTransferModel"); + + + // Declare runtime construction + + declareRunTimeSelectionTable + ( + autoPtr, + heatTransferModel, + dictionary, + ( + const dictionary& interfaceDict, + const volScalarField& alpha, + const phaseModel& phase1, + const phaseModel& phase2 + ), + (interfaceDict, alpha, phase1, phase2) + ); + + + // Constructors + + heatTransferModel + ( + const dictionary& interfaceDict, + const volScalarField& alpha, + const phaseModel& phase1, + const phaseModel& phase2 + ); + + + //- Destructor + virtual ~heatTransferModel(); + + + // Selectors + + static autoPtr New + ( + const dictionary& interfaceDict, + const volScalarField& alpha, + const phaseModel& phase1, + const phaseModel& phase2 + ); + + + // Member Functions + + //- the heat-transfer function K used in the enthalpy eq. + // ddt(alpha*rhoa*ha) + ... = ... alpha*beta*K*(Ta - Tb) + // ddt(beta*rhob*hb) + ... = ... alpha*beta*K*(Tb - Ta) + // ********************************** NB ! ***************************** + // for numerical reasons alpha and beta has been + // extracted from the heat-transfer function K, + // so you MUST divide K by alpha*beta when implementing the + // heat-transfer function + // ********************************** NB ! ***************************** + virtual tmp K(const volScalarField& Ur) const = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C new file mode 100644 index 0000000000..b14f3821bf --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C @@ -0,0 +1,65 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "heatTransferModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +Foam::autoPtr Foam::heatTransferModel::New +( + const dictionary& interfaceDict, + const volScalarField& alpha, + const phaseModel& phase1, + const phaseModel& phase2 +) +{ + word heatTransferModelType + ( + interfaceDict.lookup("heatTransferModel" + phase1.name()) + ); + + Info<< "Selecting heatTransferModel for phase " + << phase1.name() + << ": " + << heatTransferModelType << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(heatTransferModelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorIn("heatTransferModel::New") + << "Unknown heatTransferModelType type " + << heatTransferModelType << endl << endl + << "Valid heatTransferModel types are : " << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return cstrIter()(interfaceDict, alpha, phase1, phase2); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/Make/files b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/Make/files new file mode 100644 index 0000000000..ab4aa2f7af --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/Make/files @@ -0,0 +1,33 @@ +kineticTheoryModel/kineticTheoryModel.C + +viscosityModel/viscosityModel/viscosityModel.C +viscosityModel/viscosityModel/newViscosityModel.C +viscosityModel/Gidaspow/GidaspowViscosity.C +viscosityModel/Syamlal/SyamlalViscosity.C +viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C +viscosityModel/none/noneViscosity.C + +conductivityModel/conductivityModel/conductivityModel.C +conductivityModel/conductivityModel/newConductivityModel.C +conductivityModel/Gidaspow/GidaspowConductivity.C +conductivityModel/Syamlal/SyamlalConductivity.C +conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C + +radialModel/radialModel/radialModel.C +radialModel/radialModel/newRadialModel.C +radialModel/CarnahanStarling/CarnahanStarlingRadial.C +radialModel/Gidaspow/GidaspowRadial.C +radialModel/LunSavage/LunSavageRadial.C +radialModel/SinclairJackson/SinclairJacksonRadial.C + +granularPressureModel/granularPressureModel/granularPressureModel.C +granularPressureModel/granularPressureModel/newGranularPressureModel.C +granularPressureModel/Lun/LunPressure.C +granularPressureModel/SyamlalRogersOBrien/SyamlalRogersOBrienPressure.C + +frictionalStressModel/frictionalStressModel/frictionalStressModel.C +frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C +frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C +frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C + +LIB = $(FOAM_LIBBIN)/libcompressibleMultiphaseKineticTheoryModel diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/Make/options b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/Make/options new file mode 100644 index 0000000000..2fcce9913d --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/Make/options @@ -0,0 +1,5 @@ +EXE_INC = \ + -I$(LIB_SRC)/foam/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I../phaseModel/lnInclude \ + -I../interfacialModels/lnInclude diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.C b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.C new file mode 100644 index 0000000000..0a2ac036b3 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.C @@ -0,0 +1,93 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "GidaspowConductivity.H" +#include "mathematicalConstants.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ +namespace conductivityModels +{ + defineTypeNameAndDebug(Gidaspow, 0); + + addToRunTimeSelectionTable + ( + conductivityModel, + Gidaspow, + dictionary + ); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::conductivityModels::Gidaspow::Gidaspow +( + const dictionary& dict +) +: + conductivityModel(dict) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::conductivityModels::Gidaspow::~Gidaspow() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp +Foam::kineticTheoryModels::conductivityModels::Gidaspow::kappa +( + const volScalarField& alpha, + const volScalarField& Theta, + const volScalarField& g0, + const dimensionedScalar& rhoa, + const volScalarField& da, + const dimensionedScalar& e +) const +{ + const scalar sqrtPi = sqrt(constant::mathematical::pi); + + return rhoa*da*sqrt(Theta)* + ( + 2.0*sqr(alpha)*g0*(1.0 + e)/sqrtPi + + (9.0/8.0)*sqrtPi*g0*0.5*(1.0 + e)*sqr(alpha) + + (15.0/16.0)*sqrtPi*alpha + + (25.0/64.0)*sqrtPi/((1.0 + e)*g0) + ); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.H b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.H new file mode 100644 index 0000000000..b6c55696ce --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/conductivityModel/Gidaspow/GidaspowConductivity.H @@ -0,0 +1,97 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::conductivityModels::Gidaspow + +Description + +SourceFiles + Gidaspow.C + +\*---------------------------------------------------------------------------*/ + +#ifndef Gidaspow_H +#define Gidaspow_H + +#include "conductivityModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ +namespace conductivityModels +{ + +/*---------------------------------------------------------------------------*\ + Class Gidaspow Declaration +\*---------------------------------------------------------------------------*/ + +class Gidaspow +: + public conductivityModel +{ + +public: + + //- Runtime type information + TypeName("Gidaspow"); + + + // Constructors + + //- Construct from components + Gidaspow(const dictionary& dict); + + + //- Destructor + virtual ~Gidaspow(); + + + // Member Functions + + tmp kappa + ( + const volScalarField& alpha, + const volScalarField& Theta, + const volScalarField& g0, + const dimensionedScalar& rhoa, + const volScalarField& da, + const dimensionedScalar& e + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace conductivityModels +} // End namespace kineticTheoryModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C new file mode 100644 index 0000000000..cc9ac56cfd --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C @@ -0,0 +1,104 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "HrenyaSinclairConductivity.H" +#include "mathematicalConstants.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ +namespace conductivityModels +{ + defineTypeNameAndDebug(HrenyaSinclair, 0); + + addToRunTimeSelectionTable + ( + conductivityModel, + HrenyaSinclair, + dictionary + ); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::conductivityModels::HrenyaSinclair::HrenyaSinclair +( + const dictionary& dict +) +: + conductivityModel(dict), + coeffsDict_(dict.subDict(typeName + "Coeffs")), + L_(coeffsDict_.lookup("L")) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::conductivityModels::HrenyaSinclair:: +~HrenyaSinclair() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp +Foam::kineticTheoryModels::conductivityModels::HrenyaSinclair::kappa +( + const volScalarField& alpha, + const volScalarField& Theta, + const volScalarField& g0, + const dimensionedScalar& rhoa, + const volScalarField& da, + const dimensionedScalar& e +) const +{ + const scalar sqrtPi = sqrt(constant::mathematical::pi); + + volScalarField lamda + ( + scalar(1) + da/(6.0*sqrt(2.0)*(alpha + scalar(1.0e-5)))/L_ + ); + + return rhoa*da*sqrt(Theta)* + ( + 2.0*sqr(alpha)*g0*(1.0 + e)/sqrtPi + + (9.0/8.0)*sqrtPi*0.25*sqr(1.0 + e)*(2.0*e - 1.0)*sqr(alpha) + /(49.0/16.0 - 33.0*e/16.0) + + (15.0/16.0)*sqrtPi*alpha*(0.5*sqr(e) + 0.25*e - 0.75 + lamda) + /((49.0/16.0 - 33.0*e/16.0)*lamda) + + (25.0/64.0)*sqrtPi + /((1.0 + e)*(49.0/16.0 - 33.0*e/16.0)*lamda*g0) + ); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.H b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.H new file mode 100644 index 0000000000..3a635724b3 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.H @@ -0,0 +1,102 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::conductivityModels::HrenyaSinclair + +Description + +SourceFiles + HrenyaSinclair.C + +\*---------------------------------------------------------------------------*/ + +#ifndef HrenyaSinclair_H +#define HrenyaSinclair_H + +#include "conductivityModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ +namespace conductivityModels +{ + +/*---------------------------------------------------------------------------*\ + Class HrenyaSinclair Declaration +\*---------------------------------------------------------------------------*/ + +class HrenyaSinclair +: + public conductivityModel +{ + + dictionary coeffsDict_; + + //- characteristic length of geometry + dimensionedScalar L_; + +public: + + //- Runtime type information + TypeName("HrenyaSinclair"); + + + // Constructors + + //- Construct from components + HrenyaSinclair(const dictionary& dict); + + + //- Destructor + virtual ~HrenyaSinclair(); + + + // Member Functions + + tmp kappa + ( + const volScalarField& alpha, + const volScalarField& Theta, + const volScalarField& g0, + const dimensionedScalar& rhoa, + const volScalarField& da, + const dimensionedScalar& e + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace conductivityModels +} // End namespace kineticTheoryModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.C b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.C new file mode 100644 index 0000000000..4d99b686a4 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.C @@ -0,0 +1,93 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "SyamlalConductivity.H" +#include "mathematicalConstants.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ +namespace conductivityModels +{ + defineTypeNameAndDebug(Syamlal, 0); + + addToRunTimeSelectionTable + ( + conductivityModel, + Syamlal, + dictionary + ); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::conductivityModels::Syamlal::Syamlal +( + const dictionary& dict +) +: + conductivityModel(dict) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::conductivityModels::Syamlal::~Syamlal() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp +Foam::kineticTheoryModels::conductivityModels::Syamlal::kappa +( + const volScalarField& alpha, + const volScalarField& Theta, + const volScalarField& g0, + const dimensionedScalar& rhoa, + const volScalarField& da, + const dimensionedScalar& e +) const +{ + const scalar sqrtPi = sqrt(constant::mathematical::pi); + + return rhoa*da*sqrt(Theta)* + ( + 2.0*sqr(alpha)*g0*(1.0 + e)/sqrtPi + + (9.0/8.0)*sqrtPi*g0*0.25*sqr(1.0 + e)*(2.0*e - 1.0)*sqr(alpha) + /(49.0/16.0 - 33.0*e/16.0) + + (15.0/32.0)*sqrtPi*alpha/(49.0/16.0 - 33.0*e/16.0) + ); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.H b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.H new file mode 100644 index 0000000000..e25c8f51e6 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/conductivityModel/Syamlal/SyamlalConductivity.H @@ -0,0 +1,97 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::conductivityModels::Syamlal + +Description + +SourceFiles + Syamlal.C + +\*---------------------------------------------------------------------------*/ + +#ifndef Syamlal_H +#define Syamlal_H + +#include "conductivityModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ +namespace conductivityModels +{ + +/*---------------------------------------------------------------------------*\ + Class Syamlal Declaration +\*---------------------------------------------------------------------------*/ + +class Syamlal +: + public conductivityModel +{ + +public: + + //- Runtime type information + TypeName("Syamlal"); + + + // Constructors + + //- Construct from components + Syamlal(const dictionary& dict); + + + //- Destructor + virtual ~Syamlal(); + + + // Member Functions + + tmp kappa + ( + const volScalarField& alpha, + const volScalarField& Theta, + const volScalarField& g0, + const dimensionedScalar& rhoa, + const volScalarField& da, + const dimensionedScalar& e + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace conductivityModels +} // End namespace kineticTheoryModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.C new file mode 100644 index 0000000000..145f10e218 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.C @@ -0,0 +1,58 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "conductivityModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ + defineTypeNameAndDebug(conductivityModel, 0); + + defineRunTimeSelectionTable(conductivityModel, dictionary); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::conductivityModel::conductivityModel +( + const dictionary& dict +) +: + dict_(dict) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::conductivityModel::~conductivityModel() +{} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.H new file mode 100644 index 0000000000..4f872bbd3c --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModel.H @@ -0,0 +1,128 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::conductivityModel + +SourceFiles + conductivityModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef conductivityModel_H +#define conductivityModel_H + +#include "dictionary.H" +#include "volFields.H" +#include "dimensionedTypes.H" +#include "runTimeSelectionTables.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ + +/*---------------------------------------------------------------------------*\ + Class conductivityModel Declaration +\*---------------------------------------------------------------------------*/ + +class conductivityModel +{ + // Private member functions + + //- Disallow default bitwise copy construct + conductivityModel(const conductivityModel&); + + //- Disallow default bitwise assignment + void operator=(const conductivityModel&); + + +protected: + + // Protected data + + const dictionary& dict_; + + +public: + + //- Runtime type information + TypeName("conductivityModel"); + + // Declare runtime constructor selection table + declareRunTimeSelectionTable + ( + autoPtr, + conductivityModel, + dictionary, + ( + const dictionary& dict + ), + (dict) + ); + + + // Constructors + + //- Construct from components + conductivityModel(const dictionary& dict); + + + // Selectors + + static autoPtr New + ( + const dictionary& dict + ); + + + //- Destructor + virtual ~conductivityModel(); + + + // Member Functions + + virtual tmp kappa + ( + const volScalarField& alpha, + const volScalarField& Theta, + const volScalarField& g0, + const dimensionedScalar& rhoa, + const volScalarField& da, + const dimensionedScalar& e + ) const = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace kineticTheoryModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C new file mode 100644 index 0000000000..21aa88ec66 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C @@ -0,0 +1,59 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "conductivityModel.H" + +// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // + +Foam::autoPtr +Foam::kineticTheoryModels::conductivityModel::New +( + const dictionary& dict +) +{ + word conductivityModelType(dict.lookup("conductivityModel")); + + Info<< "Selecting conductivityModel " + << conductivityModelType << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(conductivityModelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalError + << "conductivityModel::New(const dictionary&) : " << endl + << " unknown conductivityModelType type " + << conductivityModelType + << ", constructor not in hash table" << endl << endl + << " Valid conductivityModelType types are :" << endl; + Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); + } + + return autoPtr(cstrIter()(dict)); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C new file mode 100644 index 0000000000..15c820874a --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C @@ -0,0 +1,124 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "JohnsonJacksonFrictionalStress.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ +namespace frictionalStressModels +{ + defineTypeNameAndDebug(JohnsonJackson, 0); + + addToRunTimeSelectionTable + ( + frictionalStressModel, + JohnsonJackson, + dictionary + ); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::frictionalStressModels::JohnsonJackson:: +JohnsonJackson +( + const dictionary& dict +) +: + frictionalStressModel(dict) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::frictionalStressModels::JohnsonJackson:: +~JohnsonJackson() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp +Foam::kineticTheoryModels::frictionalStressModels::JohnsonJackson:: +frictionalPressure +( + const volScalarField& alpha, + const dimensionedScalar& alphaMinFriction, + const dimensionedScalar& alphaMax, + const dimensionedScalar& Fr, + const dimensionedScalar& eta, + const dimensionedScalar& p +) const +{ + + return + Fr*pow(max(alpha - alphaMinFriction, scalar(0)), eta) + /pow(max(alphaMax - alpha, scalar(5.0e-2)), p); +} + + +Foam::tmp +Foam::kineticTheoryModels::frictionalStressModels::JohnsonJackson:: +frictionalPressurePrime +( + const volScalarField& alpha, + const dimensionedScalar& alphaMinFriction, + const dimensionedScalar& alphaMax, + const dimensionedScalar& Fr, + const dimensionedScalar& eta, + const dimensionedScalar& p +) const +{ + 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, scalar(5.0e-2)), p + 1.0); +} + + +Foam::tmp +Foam::kineticTheoryModels::frictionalStressModels::JohnsonJackson::muf +( + const volScalarField& alpha, + const dimensionedScalar& alphaMax, + const volScalarField& pf, + const volSymmTensorField& D, + const dimensionedScalar& phi +) const +{ + return dimensionedScalar("0.5", dimTime, 0.5)*pf*sin(phi); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.H b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.H new file mode 100644 index 0000000000..ace67f54d1 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.H @@ -0,0 +1,116 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::JohnsonJackson + +Description + +SourceFiles + JohnsonJacksonFrictionalStress.C + +\*---------------------------------------------------------------------------*/ + +#ifndef JohnsonJackson_H +#define JohnsonJackson_H + +#include "frictionalStressModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ +namespace frictionalStressModels +{ + +/*---------------------------------------------------------------------------*\ + Class JohnsonJackson Declaration +\*---------------------------------------------------------------------------*/ + +class JohnsonJackson +: + public frictionalStressModel +{ + +public: + + //- Runtime type information + TypeName("JohnsonJackson"); + + + // Constructors + + //- Construct from components + JohnsonJackson(const dictionary& dict); + + + //- Destructor + virtual ~JohnsonJackson(); + + + // Member functions + + virtual tmp frictionalPressure + ( + const volScalarField& alpha, + const dimensionedScalar& alphaMinFriction, + const dimensionedScalar& alphaMax, + const dimensionedScalar& Fr, + const dimensionedScalar& eta, + const dimensionedScalar& p + ) const; + + virtual tmp frictionalPressurePrime + ( + const volScalarField& alpha, + const dimensionedScalar& alphaMinFriction, + const dimensionedScalar& alphaMax, + const dimensionedScalar& Fr, + const dimensionedScalar& eta, + const dimensionedScalar& p + ) const; + + virtual tmp muf + ( + const volScalarField& alpha, + const dimensionedScalar& alphaMax, + const volScalarField& pf, + const volSymmTensorField& D, + const dimensionedScalar& phi + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace frictionalStressModels +} // End namespace kineticTheoryModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C new file mode 100644 index 0000000000..4320bbad35 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C @@ -0,0 +1,156 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "SchaefferFrictionalStress.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ +namespace frictionalStressModels +{ + defineTypeNameAndDebug(Schaeffer, 0); + + addToRunTimeSelectionTable + ( + frictionalStressModel, + Schaeffer, + dictionary + ); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::Schaeffer +( + const dictionary& dict +) +: + frictionalStressModel(dict) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::~Schaeffer() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp +Foam::kineticTheoryModels::frictionalStressModels::Schaeffer:: +frictionalPressure +( + const volScalarField& alpha, + const dimensionedScalar& alphaMinFriction, + const dimensionedScalar& alphaMax, + const dimensionedScalar& Fr, + const dimensionedScalar& eta, + const dimensionedScalar& p +) const +{ + return + dimensionedScalar("1e24", dimensionSet(1, -1, -2, 0, 0), 1e24) + *pow(Foam::max(alpha - alphaMinFriction, scalar(0)), 10.0); +} + + +Foam::tmp +Foam::kineticTheoryModels::frictionalStressModels::Schaeffer:: +frictionalPressurePrime +( + const volScalarField& alpha, + const dimensionedScalar& alphaMinFriction, + const dimensionedScalar& alphaMax, + const dimensionedScalar& Fr, + const dimensionedScalar& eta, + const dimensionedScalar& p +) const +{ + return + dimensionedScalar("1e25", dimensionSet(1, -1, -2, 0, 0), 1e25) + *pow(Foam::max(alpha - alphaMinFriction, scalar(0)), 9.0); +} + + +Foam::tmp +Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::muf +( + const volScalarField& alpha, + const dimensionedScalar& alphaMax, + const volScalarField& pf, + const volSymmTensorField& D, + const dimensionedScalar& phi +) const +{ + const scalar I2Dsmall = 1.0e-15; + + // Creating muf assuming it should be 0 on the boundary which may not be + // true + tmp tmuf + ( + new volScalarField + ( + IOobject + ( + "muf", + alpha.mesh().time().timeName(), + alpha.mesh() + ), + alpha.mesh(), + dimensionedScalar("muf", dimensionSet(1, -1, -1, 0, 0), 0.0) + ) + ); + + volScalarField& muff = tmuf(); + + forAll (D, celli) + { + if (alpha[celli] > alphaMax.value() - 5e-2) + { + muff[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 + ); + } + } + + return tmuf; +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.H b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.H new file mode 100644 index 0000000000..ec517774a1 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.H @@ -0,0 +1,116 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::Schaeffer + +Description + +SourceFiles + SchaefferFrictionalStress.C + +\*---------------------------------------------------------------------------*/ + +#ifndef Schaeffer_H +#define Schaeffer_H + +#include "frictionalStressModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ +namespace frictionalStressModels +{ + +/*---------------------------------------------------------------------------*\ + Class Schaeffer Declaration +\*---------------------------------------------------------------------------*/ + +class Schaeffer +: + public frictionalStressModel +{ + +public: + + //- Runtime type information + TypeName("Schaeffer"); + + + // Constructors + + //- Construct from components + Schaeffer(const dictionary& dict); + + + //- Destructor + virtual ~Schaeffer(); + + + // Member functions + + virtual tmp frictionalPressure + ( + const volScalarField& alpha, + const dimensionedScalar& alphaMinFriction, + const dimensionedScalar& alphaMax, + const dimensionedScalar& Fr, + const dimensionedScalar& eta, + const dimensionedScalar& p + ) const; + + virtual tmp frictionalPressurePrime + ( + const volScalarField& alpha, + const dimensionedScalar& alphaMinFriction, + const dimensionedScalar& alphaMax, + const dimensionedScalar& Fr, + const dimensionedScalar& n, + const dimensionedScalar& p + ) const; + + virtual tmp muf + ( + const volScalarField& alpha, + const dimensionedScalar& alphaMax, + const volScalarField& pf, + const volSymmTensorField& D, + const dimensionedScalar& phi + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace frictionalStressModels +} // End namespace kineticTheoryModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.C new file mode 100644 index 0000000000..3b59e3615f --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.C @@ -0,0 +1,58 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "frictionalStressModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ + defineTypeNameAndDebug(frictionalStressModel, 0); + + defineRunTimeSelectionTable(frictionalStressModel, dictionary); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::frictionalStressModel::frictionalStressModel +( + const dictionary& dict +) +: + dict_(dict) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::frictionalStressModel::~frictionalStressModel() +{} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.H new file mode 100644 index 0000000000..aa5983d5d2 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModel.H @@ -0,0 +1,147 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::frictionalStressModel + +SourceFiles + frictionalStressModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef frictionalStressModel_H +#define frictionalStressModel_H + +#include "dictionary.H" +#include "volFields.H" +#include "dimensionedTypes.H" +#include "runTimeSelectionTables.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ + +/*---------------------------------------------------------------------------*\ + Class frictionalStressModel Declaration +\*---------------------------------------------------------------------------*/ + +class frictionalStressModel +{ + // Private member functions + + //- Disallow default bitwise copy construct + frictionalStressModel(const frictionalStressModel&); + + //- Disallow default bitwise assignment + void operator=(const frictionalStressModel&); + + +protected: + + // Protected data + + const dictionary& dict_; + + +public: + + //- Runtime type information + TypeName("frictionalStressModel"); + + // Declare runtime constructor selection table + declareRunTimeSelectionTable + ( + autoPtr, + frictionalStressModel, + dictionary, + ( + const dictionary& dict + ), + (dict) + ); + + + // Constructors + + //- Construct from components + frictionalStressModel(const dictionary& dict); + + + // Selectors + + static autoPtr New + ( + const dictionary& dict + ); + + + //- Destructor + virtual ~frictionalStressModel(); + + + // Member Functions + + virtual tmp frictionalPressure + ( + const volScalarField& alpha, + const dimensionedScalar& alphaMinFriction, + const dimensionedScalar& alphaMax, + const dimensionedScalar& Fr, + const dimensionedScalar& eta, + const dimensionedScalar& p + ) const = 0; + + virtual tmp frictionalPressurePrime + ( + const volScalarField& alphaf, + const dimensionedScalar& alphaMinFriction, + const dimensionedScalar& alphaMax, + const dimensionedScalar& Fr, + const dimensionedScalar& eta, + const dimensionedScalar& p + ) const = 0; + + virtual tmp muf + ( + const volScalarField& alpha, + const dimensionedScalar& alphaMax, + const volScalarField& pf, + const volSymmTensorField& D, + const dimensionedScalar& phi + ) const = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace kineticTheoryModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C new file mode 100644 index 0000000000..4067c154fb --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C @@ -0,0 +1,60 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "frictionalStressModel.H" + +// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // + +Foam::autoPtr +Foam::kineticTheoryModels::frictionalStressModel::New +( + const dictionary& dict +) +{ + word frictionalStressModelType(dict.lookup("frictionalStressModel")); + + Info<< "Selecting frictionalStressModel " + << frictionalStressModelType << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(frictionalStressModelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalError + << "frictionalStressModel::New(const dictionary&) : " << endl + << " unknown frictionalStressModelType type " + << frictionalStressModelType + << ", constructor not in hash table" << endl << endl + << " Valid frictionalStressModelType types are :" << endl; + Info<< dictionaryConstructorTablePtr_->sortedToc() + << abort(FatalError); + } + + return autoPtr(cstrIter()(dict)); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/granularPressureModel/Lun/LunPressure.C b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/granularPressureModel/Lun/LunPressure.C new file mode 100644 index 0000000000..2655267134 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/granularPressureModel/Lun/LunPressure.C @@ -0,0 +1,98 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "LunPressure.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ +namespace granularPressureModels +{ + defineTypeNameAndDebug(Lun, 0); + + addToRunTimeSelectionTable + ( + granularPressureModel, + Lun, + dictionary + ); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::granularPressureModels::Lun::Lun +( + const dictionary& dict +) +: + granularPressureModel(dict) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::granularPressureModels::Lun::~Lun() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp +Foam::kineticTheoryModels::granularPressureModels::Lun::granularPressureCoeff +( + const volScalarField& alpha, + const volScalarField& g0, + const dimensionedScalar& rhoa, + const dimensionedScalar& e +) const +{ + + return rhoa*alpha*(1.0 + 2.0*(1.0 + e)*alpha*g0); +} + + +Foam::tmp +Foam::kineticTheoryModels::granularPressureModels::Lun:: +granularPressureCoeffPrime +( + const volScalarField& alpha, + const volScalarField& g0, + const volScalarField& g0prime, + const dimensionedScalar& rhoa, + const dimensionedScalar& e +) const +{ + return rhoa*(1.0 + alpha*(1.0 + e)*(4.0*g0 + 2.0*g0prime*alpha)); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/granularPressureModel/Lun/LunPressure.H b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/granularPressureModel/Lun/LunPressure.H new file mode 100644 index 0000000000..81a58d409a --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/granularPressureModel/Lun/LunPressure.H @@ -0,0 +1,104 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::Lun + +Description + +SourceFiles + LunPressure.C + +\*---------------------------------------------------------------------------*/ + +#ifndef Lun_H +#define Lun_H + +#include "granularPressureModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ +namespace granularPressureModels +{ + +/*---------------------------------------------------------------------------*\ + Class Lun Declaration +\*---------------------------------------------------------------------------*/ + +class Lun +: + public granularPressureModel +{ + +public: + + //- Runtime type information + TypeName("Lun"); + + + // Constructors + + //- Construct from components + Lun(const dictionary& dict); + + + //- Destructor + virtual ~Lun(); + + + // Member Functions + + tmp granularPressureCoeff + ( + const volScalarField& alpha, + const volScalarField& g0, + const dimensionedScalar& rhoa, + const dimensionedScalar& e + ) const; + + tmp granularPressureCoeffPrime + ( + const volScalarField& alpha, + const volScalarField& g0, + const volScalarField& g0prime, + const dimensionedScalar& rhoa, + const dimensionedScalar& e + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace granularPressureModels +} // End namespace kineticTheoryModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/granularPressureModel/SyamlalRogersOBrien/SyamlalRogersOBrienPressure.C b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/granularPressureModel/SyamlalRogersOBrien/SyamlalRogersOBrienPressure.C new file mode 100644 index 0000000000..34ba15cbcf --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/granularPressureModel/SyamlalRogersOBrien/SyamlalRogersOBrienPressure.C @@ -0,0 +1,101 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "SyamlalRogersOBrienPressure.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ +namespace granularPressureModels +{ + defineTypeNameAndDebug(SyamlalRogersOBrien, 0); + + addToRunTimeSelectionTable + ( + granularPressureModel, + SyamlalRogersOBrien, + dictionary + ); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::granularPressureModels::SyamlalRogersOBrien:: +SyamlalRogersOBrien +( + const dictionary& dict +) +: + granularPressureModel(dict) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::granularPressureModels::SyamlalRogersOBrien:: +~SyamlalRogersOBrien() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp +Foam::kineticTheoryModels::granularPressureModels::SyamlalRogersOBrien:: +granularPressureCoeff +( + const volScalarField& alpha, + const volScalarField& g0, + const dimensionedScalar& rhoa, + const dimensionedScalar& e +) const +{ + + return 2.0*rhoa*(1.0 + e)*sqr(alpha)*g0; +} + + +Foam::tmp +Foam::kineticTheoryModels::granularPressureModels::SyamlalRogersOBrien:: +granularPressureCoeffPrime +( + const volScalarField& alpha, + const volScalarField& g0, + const volScalarField& g0prime, + const dimensionedScalar& rhoa, + const dimensionedScalar& e +) const +{ + return rhoa*alpha*(1.0 + e)*(4.0*g0 + 2.0*g0prime*alpha); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/granularPressureModel/SyamlalRogersOBrien/SyamlalRogersOBrienPressure.H b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/granularPressureModel/SyamlalRogersOBrien/SyamlalRogersOBrienPressure.H new file mode 100644 index 0000000000..c328481a1c --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/granularPressureModel/SyamlalRogersOBrien/SyamlalRogersOBrienPressure.H @@ -0,0 +1,104 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::SyamlalRogersOBrien + +Description + +SourceFiles + SyamlalRogersOBrienPressure.C + +\*---------------------------------------------------------------------------*/ + +#ifndef SyamlalRogersOBrien_H +#define SyamlalRogersOBrien_H + +#include "granularPressureModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ +namespace granularPressureModels +{ + +/*---------------------------------------------------------------------------*\ + Class SyamlalRogersOBrien Declaration +\*---------------------------------------------------------------------------*/ + +class SyamlalRogersOBrien +: + public granularPressureModel +{ + +public: + + //- Runtime type information + TypeName("SyamlalRogersOBrien"); + + + // Constructors + + //- Construct from components + SyamlalRogersOBrien(const dictionary& dict); + + + //- Destructor + virtual ~SyamlalRogersOBrien(); + + + // Member Functions + + tmp granularPressureCoeff + ( + const volScalarField& alpha, + const volScalarField& g0, + const dimensionedScalar& rhoa, + const dimensionedScalar& e + ) const; + + tmp granularPressureCoeffPrime + ( + const volScalarField& alpha, + const volScalarField& g0, + const volScalarField& g0prime, + const dimensionedScalar& rhoa, + const dimensionedScalar& e + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace granularPressureModels +} // End namespace kineticTheoryModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.C new file mode 100644 index 0000000000..6bbae86d37 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.C @@ -0,0 +1,58 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "granularPressureModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ + defineTypeNameAndDebug(granularPressureModel, 0); + + defineRunTimeSelectionTable(granularPressureModel, dictionary); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::granularPressureModel::granularPressureModel +( + const dictionary& dict +) +: + dict_(dict) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::granularPressureModel::~granularPressureModel() +{} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.H new file mode 100644 index 0000000000..1ae4da2e8e --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModel.H @@ -0,0 +1,137 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::granularPressureModel + +SourceFiles + granularPressureModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef granularPressureModel_H +#define granularPressureModel_H + +#include "dictionary.H" +#include "volFields.H" +#include "dimensionedTypes.H" +#include "runTimeSelectionTables.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ + +/*---------------------------------------------------------------------------*\ + Class granularPressureModel Declaration +\*---------------------------------------------------------------------------*/ + +class granularPressureModel +{ + // Private member functions + + //- Disallow default bitwise copy construct + granularPressureModel(const granularPressureModel&); + + //- Disallow default bitwise assignment + void operator=(const granularPressureModel&); + + +protected: + + // Protected data + + const dictionary& dict_; + + +public: + + //- Runtime type information + TypeName("granularPressureModel"); + + // Declare runtime constructor selection table + declareRunTimeSelectionTable + ( + autoPtr, + granularPressureModel, + dictionary, + ( + const dictionary& dict + ), + (dict) + ); + + + // Constructors + + //- Construct from components + granularPressureModel(const dictionary& dict); + + + // Selectors + + static autoPtr New + ( + const dictionary& dict + ); + + + //- Destructor + virtual ~granularPressureModel(); + + + // Member Functions + + //- Granular pressure coefficient + virtual tmp granularPressureCoeff + ( + const volScalarField& alpha, + const volScalarField& g0, + const dimensionedScalar& rhoa, + const dimensionedScalar& e + ) const = 0; + + //- Derivative of the granular pressure coefficient + virtual tmp granularPressureCoeffPrime + ( + const volScalarField& alpha, + const volScalarField& g0, + const volScalarField& g0prime, + const dimensionedScalar& rhoa, + const dimensionedScalar& e + ) const = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace kineticTheoryModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C new file mode 100644 index 0000000000..d8e1540f0f --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C @@ -0,0 +1,60 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "granularPressureModel.H" + +// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // + +Foam::autoPtr +Foam::kineticTheoryModels::granularPressureModel::New +( + const dictionary& dict +) +{ + word granularPressureModelType(dict.lookup("granularPressureModel")); + + Info<< "Selecting granularPressureModel " + << granularPressureModelType << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(granularPressureModelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalError + << "granularPressureModel::New(const dictionary&) : " << endl + << " unknown granularPressureModelType type " + << granularPressureModelType + << ", constructor not in hash table" << endl << endl + << " Valid granularPressureModelType types are :" << endl; + Info<< dictionaryConstructorTablePtr_->sortedToc() + << abort(FatalError); + } + + return autoPtr(cstrIter()(dict)); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C new file mode 100644 index 0000000000..d4513e922f --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C @@ -0,0 +1,390 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "kineticTheoryModel.H" +#include "surfaceInterpolate.H" +#include "mathematicalConstants.H" +#include "fvCFD.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::kineticTheoryModel::kineticTheoryModel +( + const Foam::phaseModel& phase1, + const Foam::volVectorField& Ub, + const Foam::volScalarField& alpha, + const Foam::dragModel& draga +) +: + phase1_(phase1), + Ua_(phase1.U()), + Ub_(Ub), + alpha_(alpha), + phia_(phase1.phi()), + draga_(draga), + + rhoa_(phase1.rho()), + nua_(phase1.nu()), + + kineticTheoryProperties_ + ( + IOobject + ( + "kineticTheoryProperties", + Ua_.time().constant(), + Ua_.mesh(), + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ), + kineticTheory_(kineticTheoryProperties_.lookup("kineticTheory")), + equilibrium_(kineticTheoryProperties_.lookup("equilibrium")), + + viscosityModel_ + ( + kineticTheoryModels::viscosityModel::New + ( + kineticTheoryProperties_ + ) + ), + conductivityModel_ + ( + kineticTheoryModels::conductivityModel::New + ( + kineticTheoryProperties_ + ) + ), + radialModel_ + ( + kineticTheoryModels::radialModel::New + ( + kineticTheoryProperties_ + ) + ), + granularPressureModel_ + ( + kineticTheoryModels::granularPressureModel::New + ( + kineticTheoryProperties_ + ) + ), + frictionalStressModel_ + ( + kineticTheoryModels::frictionalStressModel::New + ( + kineticTheoryProperties_ + ) + ), + e_(kineticTheoryProperties_.lookup("e")), + alphaMax_(kineticTheoryProperties_.lookup("alphaMax")), + alphaMinFriction_(kineticTheoryProperties_.lookup("alphaMinFriction")), + Fr_(kineticTheoryProperties_.lookup("Fr")), + eta_(kineticTheoryProperties_.lookup("eta")), + p_(kineticTheoryProperties_.lookup("p")), + phi_(dimensionedScalar(kineticTheoryProperties_.lookup("phi"))*M_PI/180.0), + Theta_ + ( + IOobject + ( + "Theta", + Ua_.time().timeName(), + Ua_.mesh(), + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + Ua_.mesh() + ), + mua_ + ( + IOobject + ( + "mua", + Ua_.time().timeName(), + Ua_.mesh(), + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + Ua_.mesh(), + dimensionedScalar("zero", dimensionSet(1, -1, -1, 0, 0), 0.0) + ), + lambda_ + ( + IOobject + ( + "lambda", + Ua_.time().timeName(), + Ua_.mesh(), + IOobject::NO_READ, + IOobject::NO_WRITE + ), + Ua_.mesh(), + dimensionedScalar("zero", dimensionSet(1, -1, -1, 0, 0), 0.0) + ), + pa_ + ( + IOobject + ( + "pa", + Ua_.time().timeName(), + Ua_.mesh(), + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + Ua_.mesh(), + dimensionedScalar("zero", dimensionSet(1, -1, -2, 0, 0), 0.0) + ), + kappa_ + ( + IOobject + ( + "kappa", + Ua_.time().timeName(), + Ua_.mesh(), + IOobject::NO_READ, + IOobject::NO_WRITE + ), + Ua_.mesh(), + dimensionedScalar("zero", dimensionSet(1, -1, -1, 0, 0), 0.0) + ), + gs0_ + ( + IOobject + ( + "gs0", + Ua_.time().timeName(), + Ua_.mesh(), + IOobject::NO_READ, + IOobject::NO_WRITE + ), + Ua_.mesh(), + dimensionedScalar("zero", dimensionSet(0, 0, 0, 0, 0), 1.0) + ) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::kineticTheoryModel::~kineticTheoryModel() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::kineticTheoryModel::solve(const volTensorField& gradUat) +{ + if (!kineticTheory_) + { + return; + } + + const scalar sqrtPi = sqrt(constant::mathematical::pi); + + volScalarField da_(phase1_.d()); + + surfaceScalarField phi(1.5*rhoa_*phia_*fvc::interpolate(alpha_)); + + volTensorField dU(gradUat.T()); //fvc::grad(Ua_); + volSymmTensorField D(symm(dU)); + + // NB, drag = K*alpha*beta, + // (the alpha and beta has been extracted from the drag function for + // numerical reasons) + volScalarField Ur(mag(Ua_ - Ub_)); + volScalarField betaPrim(alpha_*(1.0 - alpha_)*draga_.K(Ur)); + + // Calculating the radial distribution function (solid volume fraction is + // limited close to the packing limit, but this needs improvements) + // The solution is higly unstable close to the packing limit. + gs0_ = radialModel_->g0 + ( + min(max(alpha_, scalar(1e-6)), alphaMax_ - 0.01), + alphaMax_ + ); + + // particle pressure - coefficient in front of Theta (Eq. 3.22, p. 45) + volScalarField PsCoeff + ( + granularPressureModel_->granularPressureCoeff + ( + alpha_, + gs0_, + rhoa_, + e_ + ) + ); + + // 'thermal' conductivity (Table 3.3, p. 49) + kappa_ = conductivityModel_->kappa(alpha_, Theta_, gs0_, rhoa_, da_, e_); + + // particle viscosity (Table 3.2, p.47) + mua_ = viscosityModel_->mua(alpha_, Theta_, gs0_, rhoa_, da_, e_); + + dimensionedScalar Tsmall + ( + "small", + dimensionSet(0 , 2 ,-2 ,0 , 0, 0, 0), + 1.0e-6 + ); + + dimensionedScalar TsmallSqrt = sqrt(Tsmall); + volScalarField ThetaSqrt(sqrt(Theta_)); + + // dissipation (Eq. 3.24, p.50) + volScalarField gammaCoeff + ( + 12.0*(1.0 - sqr(e_))*sqr(alpha_)*rhoa_*gs0_*(1.0/da_)*ThetaSqrt/sqrtPi + ); + + // Eq. 3.25, p. 50 Js = J1 - J2 + volScalarField J1(3.0*betaPrim); + volScalarField J2 + ( + 0.25*sqr(betaPrim)*da_*sqr(Ur) + /(max(alpha_, scalar(1e-6))*rhoa_*sqrtPi*(ThetaSqrt + TsmallSqrt)) + ); + + // bulk viscosity p. 45 (Lun et al. 1984). + lambda_ = (4.0/3.0)*sqr(alpha_)*rhoa_*da_*gs0_*(1.0+e_)*ThetaSqrt/sqrtPi; + + // stress tensor, Definitions, Table 3.1, p. 43 + volSymmTensorField tau(2.0*mua_*D + (lambda_ - (2.0/3.0)*mua_)*tr(D)*I); + + if (!equilibrium_) + { + // construct the granular temperature equation (Eq. 3.20, p. 44) + // NB. note that there are two typos in Eq. 3.20 + // no grad infront of Ps + // wrong sign infront of laplacian + fvScalarMatrix ThetaEqn + ( + fvm::ddt(1.5*alpha_*rhoa_, Theta_) + + fvm::div(phi, Theta_, "div(phi,Theta)") + == + fvm::SuSp(-((PsCoeff*I) && dU), Theta_) + + (tau && dU) + + fvm::laplacian(kappa_, Theta_, "laplacian(kappa,Theta)") + + fvm::Sp(-gammaCoeff, Theta_) + + fvm::Sp(-J1, Theta_) + + fvm::Sp(J2/(Theta_ + Tsmall), Theta_) + ); + + ThetaEqn.relax(); + ThetaEqn.solve(); + } + else + { + // equilibrium => dissipation == production + // Eq. 4.14, p.82 + volScalarField K1(2.0*(1.0 + e_)*rhoa_*gs0_); + volScalarField K3 + ( + 0.5*da_*rhoa_* + ( + (sqrtPi/(3.0*(3.0-e_))) + *(1.0 + 0.4*(1.0 + e_)*(3.0*e_ - 1.0)*alpha_*gs0_) + +1.6*alpha_*gs0_*(1.0 + e_)/sqrtPi + ) + ); + + volScalarField K2 + ( + 4.0*da_*rhoa_*(1.0 + e_)*alpha_*gs0_/(3.0*sqrtPi) - 2.0*K3/3.0 + ); + + volScalarField K4(12.0*(1.0 - sqr(e_))*rhoa_*gs0_/(da_*sqrtPi)); + + volScalarField trD(tr(D)); + volScalarField tr2D(sqr(trD)); + volScalarField trD2(tr(D & D)); + + volScalarField t1(K1*alpha_ + rhoa_); + volScalarField l1(-t1*trD); + volScalarField l2(sqr(t1)*tr2D); + volScalarField l3 + ( + 4.0 + *K4 + *max(alpha_, scalar(1e-6)) + *(2.0*K3*trD2 + K2*tr2D) + ); + + Theta_ = sqr((l1 + sqrt(l2 + l3))/(2.0*(alpha_ + 1.0e-4)*K4)); + } + + Theta_.max(1.0e-15); + Theta_.min(1.0e+3); + + volScalarField pf + ( + frictionalStressModel_->frictionalPressure + ( + alpha_, + alphaMinFriction_, + alphaMax_, + Fr_, + eta_, + p_ + ) + ); + + PsCoeff += pf/(Theta_+Tsmall); + + PsCoeff.min(1.0e+10); + PsCoeff.max(-1.0e+10); + + // update particle pressure + pa_ = PsCoeff*Theta_; + + // frictional shear stress, Eq. 3.30, p. 52 + volScalarField muf + ( + frictionalStressModel_->muf + ( + alpha_, + alphaMax_, + pf, + D, + phi_ + ) + ); + + // add frictional stress + mua_ += muf; + mua_.min(1.0e+2); + mua_.max(0.0); + + Info<< "kinTheory: max(Theta) = " << max(Theta_).value() << endl; + + volScalarField ktn(mua_/rhoa_); + + Info<< "kinTheory: min(nua) = " << min(ktn).value() + << ", max(nua) = " << max(ktn).value() << endl; + + Info<< "kinTheory: min(pa) = " << min(pa_).value() + << ", max(pa) = " << max(pa_).value() << endl; +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H new file mode 100644 index 0000000000..59e80062ca --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H @@ -0,0 +1,197 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::kineticTheoryModel + +Description + +SourceFiles + kineticTheoryModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef kineticTheoryModel_H +#define kineticTheoryModel_H + +#include "dragModel.H" +#include "phaseModel.H" +#include "autoPtr.H" +#include "viscosityModel.H" +#include "conductivityModel.H" +#include "radialModel.H" +#include "granularPressureModel.H" +#include "frictionalStressModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class kineticTheoryModel Declaration +\*---------------------------------------------------------------------------*/ + +class kineticTheoryModel +{ + // Private data + + const phaseModel& phase1_; + const volVectorField& Ua_; + const volVectorField& Ub_; + const volScalarField& alpha_; + const surfaceScalarField& phia_; + + const dragModel& draga_; + + const dimensionedScalar& rhoa_; + const dimensionedScalar& nua_; + + //- dictionary holding the modeling info + IOdictionary kineticTheoryProperties_; + + //- use kinetic theory or not. + Switch kineticTheory_; + + //- use generation == dissipation + Switch equilibrium_; + + autoPtr viscosityModel_; + + autoPtr conductivityModel_; + + autoPtr radialModel_; + + autoPtr + granularPressureModel_; + + autoPtr + frictionalStressModel_; + + //- coefficient of restitution + const dimensionedScalar e_; + + //- maximum packing + const dimensionedScalar alphaMax_; + + //- min value for which the frictional stresses are zero + const dimensionedScalar alphaMinFriction_; + + //- material constant for frictional normal stress + const dimensionedScalar Fr_; + + //- material constant for frictional normal stress + const dimensionedScalar eta_; + + //- material constant for frictional normal stress + const dimensionedScalar p_; + + //- angle of internal friction + const dimensionedScalar phi_; + + //- The granular energy/temperature + volScalarField Theta_; + + //- The granular viscosity + volScalarField mua_; + + //- The granular bulk viscosity + volScalarField lambda_; + + //- The granular pressure + volScalarField pa_; + + //- The granular temperature conductivity + volScalarField kappa_; + + //- The radial distribution function + volScalarField gs0_; + + + // Private Member Functions + + //- Disallow default bitwise copy construct + kineticTheoryModel(const kineticTheoryModel&); + + //- Disallow default bitwise assignment + void operator=(const kineticTheoryModel&); + + +public: + + // Constructors + + //- Construct from components + kineticTheoryModel + ( + const phaseModel& phase1, + const volVectorField& Ub, + const volScalarField& alpha, + const dragModel& draga + ); + + + //- Destructor + virtual ~kineticTheoryModel(); + + + // Member Functions + + void solve(const volTensorField& gradUat); + + bool on() const + { + return kineticTheory_; + } + + const volScalarField& mua() const + { + return mua_; + } + + const volScalarField& pa() const + { + return pa_; + } + + const volScalarField& lambda() const + { + return lambda_; + } + + const volScalarField& kappa() const + { + return kappa_; + } +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/radialModel/CarnahanStarling/CarnahanStarlingRadial.C b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/radialModel/CarnahanStarling/CarnahanStarlingRadial.C new file mode 100644 index 0000000000..42c709068b --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/radialModel/CarnahanStarling/CarnahanStarlingRadial.C @@ -0,0 +1,99 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "CarnahanStarlingRadial.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ +namespace radialModels +{ + defineTypeNameAndDebug(CarnahanStarling, 0); + + addToRunTimeSelectionTable + ( + radialModel, + CarnahanStarling, + dictionary + ); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::radialModels::CarnahanStarling::CarnahanStarling +( + const dictionary& dict +) +: + radialModel(dict) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::radialModels::CarnahanStarling::~CarnahanStarling() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp +Foam::kineticTheoryModels::radialModels::CarnahanStarling::g0 +( + const volScalarField& alpha, + const dimensionedScalar& alphaMax +) const +{ + + return + 1.0/(1.0 - alpha) + + 3.0*alpha/(2.0*sqr(1.0 - alpha)) + + sqr(alpha)/(2.0*pow(1.0 - alpha, 3)); +} + + +Foam::tmp +Foam::kineticTheoryModels::radialModels::CarnahanStarling::g0prime +( + const volScalarField& alpha, + const dimensionedScalar& alphaMax +) const +{ + return + - alpha/sqr(1.0 - alpha) + + (3.0*(1.0 - alpha) + 6.0*sqr(alpha))/(2.0*(1.0 - alpha)) + + (2.0*alpha*(1.0 - alpha) + 3.0*pow(alpha, 3)) + /(2.0*pow(1.0 - alpha, 4)); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/radialModel/CarnahanStarling/CarnahanStarlingRadial.H b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/radialModel/CarnahanStarling/CarnahanStarlingRadial.H new file mode 100644 index 0000000000..de5c24a182 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/radialModel/CarnahanStarling/CarnahanStarlingRadial.H @@ -0,0 +1,100 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::radialModels::CarnahanStarling + +Description + +SourceFiles + CarnahanStarlingRadial.C + +\*---------------------------------------------------------------------------*/ + +#ifndef CarnahanStarling_H +#define CarnahanStarling_H + +#include "radialModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ +namespace radialModels +{ + +/*---------------------------------------------------------------------------*\ + Class CarnahanStarling Declaration +\*---------------------------------------------------------------------------*/ + +class CarnahanStarling +: + public radialModel +{ + +public: + + //- Runtime type information + TypeName("CarnahanStarling"); + + + // Constructors + + //- Construct from components + CarnahanStarling(const dictionary& dict); + + + //- Destructor + virtual ~CarnahanStarling(); + + + // Member Functions + + + tmp g0 + ( + const volScalarField& alpha, + const dimensionedScalar& alphaMax + ) const; + + tmp g0prime + ( + const volScalarField& alpha, + const dimensionedScalar& alphaMax + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace radialModels +} // End namespace kineticTheoryModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/radialModel/Gidaspow/GidaspowRadial.C b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/radialModel/Gidaspow/GidaspowRadial.C new file mode 100644 index 0000000000..9cd4675ce9 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/radialModel/Gidaspow/GidaspowRadial.C @@ -0,0 +1,93 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "GidaspowRadial.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ +namespace radialModels +{ + defineTypeNameAndDebug(Gidaspow, 0); + + addToRunTimeSelectionTable + ( + radialModel, + Gidaspow, + dictionary + ); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::radialModels::Gidaspow::Gidaspow +( + const dictionary& dict +) +: + radialModel(dict) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::radialModels::Gidaspow::~Gidaspow() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp +Foam::kineticTheoryModels::radialModels::Gidaspow::g0 +( + const volScalarField& alpha, + const dimensionedScalar& alphaMax +) const +{ + return 0.6/(1.0 - pow(alpha/alphaMax, 1.0/3.0)); +} + + +Foam::tmp +Foam::kineticTheoryModels::radialModels::Gidaspow::g0prime +( + const volScalarField& alpha, + const dimensionedScalar& alphaMax +) const +{ + return + (-1.0/5.0)*pow(alpha/alphaMax, -2.0/3.0) + /(alphaMax*sqr(1.0 - pow(alpha/alphaMax, 1.0/3.0))); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/radialModel/Gidaspow/GidaspowRadial.H b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/radialModel/Gidaspow/GidaspowRadial.H new file mode 100644 index 0000000000..7f94c23a97 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/radialModel/Gidaspow/GidaspowRadial.H @@ -0,0 +1,99 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::radialModels::Gidaspow + +Description + +SourceFiles + GidaspowRadial.C + +\*---------------------------------------------------------------------------*/ + +#ifndef Gidaspow_H +#define Gidaspow_H + +#include "radialModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ +namespace radialModels +{ + +/*---------------------------------------------------------------------------*\ + Class Gidaspow Declaration +\*---------------------------------------------------------------------------*/ + +class Gidaspow +: + public radialModel +{ + +public: + + //- Runtime type information + TypeName("Gidaspow"); + + + // Constructors + + //- Construct from components + Gidaspow(const dictionary& dict); + + + //- Destructor + virtual ~Gidaspow(); + + + // Member Functions + + tmp g0 + ( + const volScalarField& alpha, + const dimensionedScalar& alphaMax + ) const; + + tmp g0prime + ( + const volScalarField& alpha, + const dimensionedScalar& alphaMax + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace radialModels +} // End namespace kineticTheoryModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/radialModel/LunSavage/LunSavageRadial.C b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/radialModel/LunSavage/LunSavageRadial.C new file mode 100644 index 0000000000..91571b3bb3 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/radialModel/LunSavage/LunSavageRadial.C @@ -0,0 +1,92 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "LunSavageRadial.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ +namespace radialModels +{ + defineTypeNameAndDebug(LunSavage, 0); + + addToRunTimeSelectionTable + ( + radialModel, + LunSavage, + dictionary + ); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::radialModels::LunSavage::LunSavage +( + const dictionary& dict +) +: + radialModel(dict) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::radialModels::LunSavage::~LunSavage() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp +Foam::kineticTheoryModels::radialModels::LunSavage::g0 +( + const volScalarField& alpha, + const dimensionedScalar& alphaMax +) const +{ + + return pow(1.0 - alpha/alphaMax, -2.5*alphaMax); +} + + +Foam::tmp +Foam::kineticTheoryModels::radialModels::LunSavage::g0prime +( + const volScalarField& alpha, + const dimensionedScalar& alphaMax +) const +{ + return 2.5*alphaMax*alpha*pow(1.0 - alpha, -1.0 - 2.5*alphaMax); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/radialModel/LunSavage/LunSavageRadial.H b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/radialModel/LunSavage/LunSavageRadial.H new file mode 100644 index 0000000000..1e95f838ae --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/radialModel/LunSavage/LunSavageRadial.H @@ -0,0 +1,99 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::radialModels::LunSavage + +Description + +SourceFiles + LunSavage.C + +\*---------------------------------------------------------------------------*/ + +#ifndef LunSavage_H +#define LunSavage_H + +#include "radialModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ +namespace radialModels +{ + +/*---------------------------------------------------------------------------*\ + Class LunSavage Declaration +\*---------------------------------------------------------------------------*/ + +class LunSavage +: + public radialModel +{ + +public: + + //- Runtime type information + TypeName("LunSavage"); + + + // Constructors + + //- Construct from components + LunSavage(const dictionary& dict); + + + //- Destructor + virtual ~LunSavage(); + + + // Member Functions + + tmp g0 + ( + const volScalarField& alpha, + const dimensionedScalar& alphaMax + ) const; + + tmp g0prime + ( + const volScalarField& alpha, + const dimensionedScalar& alphaMax + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace radialModels +} // End namespace kineticTheoryModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/radialModel/SinclairJackson/SinclairJacksonRadial.C b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/radialModel/SinclairJackson/SinclairJacksonRadial.C new file mode 100644 index 0000000000..d9ffa4714b --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/radialModel/SinclairJackson/SinclairJacksonRadial.C @@ -0,0 +1,93 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "SinclairJacksonRadial.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ +namespace radialModels +{ + defineTypeNameAndDebug(SinclairJackson, 0); + + addToRunTimeSelectionTable + ( + radialModel, + SinclairJackson, + dictionary + ); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::radialModels::SinclairJackson::SinclairJackson +( + const dictionary& dict +) +: + radialModel(dict) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::radialModels::SinclairJackson::~SinclairJackson() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp +Foam::kineticTheoryModels::radialModels::SinclairJackson::g0 +( + const volScalarField& alpha, + const dimensionedScalar& alphaMax +) const +{ + return 1.0/(1.0 - pow(alpha/alphaMax, 1.0/3.0)); +} + + +Foam::tmp +Foam::kineticTheoryModels::radialModels::SinclairJackson::g0prime +( + const volScalarField& alpha, + const dimensionedScalar& alphaMax +) const +{ + return + (-1.0/3.0)*pow(alpha/alphaMax, -2.0/3.0) + /(alphaMax*sqr(1.0 - pow(alpha/alphaMax, 1.0/3.0))); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/radialModel/SinclairJackson/SinclairJacksonRadial.H b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/radialModel/SinclairJackson/SinclairJacksonRadial.H new file mode 100644 index 0000000000..8df30f1945 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/radialModel/SinclairJackson/SinclairJacksonRadial.H @@ -0,0 +1,99 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::SinclairJackson + +Description + +SourceFiles + SinclairJacksonRadial.C + +\*---------------------------------------------------------------------------*/ + +#ifndef SinclairJackson_H +#define SinclairJackson_H + +#include "radialModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ +namespace radialModels +{ + +/*---------------------------------------------------------------------------*\ + Class SinclairJackson Declaration +\*---------------------------------------------------------------------------*/ + +class SinclairJackson +: + public radialModel +{ + +public: + + //- Runtime type information + TypeName("SinclairJackson"); + + + // Constructors + + //- Construct from components + SinclairJackson(const dictionary& dict); + + + //- Destructor + virtual ~SinclairJackson(); + + + // Member Functions + + tmp g0 + ( + const volScalarField& alpha, + const dimensionedScalar& alphaMax + ) const; + + tmp g0prime + ( + const volScalarField& alpha, + const dimensionedScalar& alphaMax + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace radialModels +} // End namespace kineticTheoryModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/radialModel/radialModel/newRadialModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/radialModel/radialModel/newRadialModel.C new file mode 100644 index 0000000000..aa79335145 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/radialModel/radialModel/newRadialModel.C @@ -0,0 +1,60 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "radialModel.H" + +// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // + +Foam::autoPtr +Foam::kineticTheoryModels::radialModel::New +( + const dictionary& dict +) +{ + word radialModelType(dict.lookup("radialModel")); + + Info<< "Selecting radialModel " + << radialModelType << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(radialModelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalError + << "radialModel::New(const dictionary&) : " << endl + << " unknown radialModelType type " + << radialModelType + << ", constructor not in hash table" << endl << endl + << " Valid radialModelType types are :" << endl; + Info<< dictionaryConstructorTablePtr_->sortedToc() + << abort(FatalError); + } + + return autoPtr(cstrIter()(dict)); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/radialModel/radialModel/radialModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/radialModel/radialModel/radialModel.C new file mode 100644 index 0000000000..7caf81d366 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/radialModel/radialModel/radialModel.C @@ -0,0 +1,58 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "radialModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ + defineTypeNameAndDebug(radialModel, 0); + + defineRunTimeSelectionTable(radialModel, dictionary); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::radialModel::radialModel +( + const dictionary& dict +) +: + dict_(dict) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::radialModel::~radialModel() +{} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/radialModel/radialModel/radialModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/radialModel/radialModel/radialModel.H new file mode 100644 index 0000000000..bad05a99df --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/radialModel/radialModel/radialModel.H @@ -0,0 +1,132 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::radialModel + +SourceFiles + radialModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef radialModel_H +#define radialModel_H + +#include "dictionary.H" +#include "volFields.H" +#include "dimensionedTypes.H" +#include "runTimeSelectionTables.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ + +/*---------------------------------------------------------------------------*\ + Class radialModel Declaration +\*---------------------------------------------------------------------------*/ + +class radialModel +{ + // Private member functions + + //- Disallow default bitwise copy construct + radialModel(const radialModel&); + + //- Disallow default bitwise assignment + void operator=(const radialModel&); + + +protected: + + // Protected data + + const dictionary& dict_; + + +public: + + //- Runtime type information + TypeName("radialModel"); + + // Declare runtime constructor selection table + declareRunTimeSelectionTable + ( + autoPtr, + radialModel, + dictionary, + ( + const dictionary& dict + ), + (dict) + ); + + + // Constructors + + //- Construct from components + radialModel(const dictionary& dict); + + + // Selectors + + static autoPtr New + ( + const dictionary& dict + ); + + + //- Destructor + virtual ~radialModel(); + + + // Member Functions + + //- Radial distribution function + virtual tmp g0 + ( + const volScalarField& alpha, + const dimensionedScalar& alphaMax + ) const = 0; + + //- Derivative of the radial distribution function + virtual tmp g0prime + ( + const volScalarField& alpha, + const dimensionedScalar& alphaMax + ) const = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace kineticTheoryModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.C b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.C new file mode 100644 index 0000000000..dc51322752 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.C @@ -0,0 +1,87 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "GidaspowViscosity.H" +#include "mathematicalConstants.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ +namespace viscosityModels +{ + defineTypeNameAndDebug(Gidaspow, 0); + addToRunTimeSelectionTable(viscosityModel, Gidaspow, dictionary); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::viscosityModels::Gidaspow::Gidaspow +( + const dictionary& dict +) +: + viscosityModel(dict) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::viscosityModels::Gidaspow::~Gidaspow() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp +Foam::kineticTheoryModels::viscosityModels::Gidaspow::mua +( + const volScalarField& alpha, + const volScalarField& Theta, + const volScalarField& g0, + const dimensionedScalar& rhoa, + const volScalarField& da, + const dimensionedScalar& e +) const +{ + const scalar sqrtPi = sqrt(constant::mathematical::pi); + + return rhoa*da*sqrt(Theta)* + ( + (4.0/5.0)*sqr(alpha)*g0*(1.0 + e)/sqrtPi + + (1.0/15.0)*sqrtPi*g0*(1.0 + e)*sqr(alpha) + + (1.0/6.0)*sqrtPi*alpha + + (10.0/96.0)*sqrtPi/((1.0 + e)*g0) + ); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.H b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.H new file mode 100644 index 0000000000..efe2c5727c --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/viscosityModel/Gidaspow/GidaspowViscosity.H @@ -0,0 +1,96 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::viscosityModels::Gidaspow + +Description + +SourceFiles + GidaspowViscosity.C + +\*---------------------------------------------------------------------------*/ + +#ifndef Gidaspow_H +#define Gidaspow_H + +#include "viscosityModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ +namespace viscosityModels +{ + +/*---------------------------------------------------------------------------*\ + Class Gidaspow Declaration +\*---------------------------------------------------------------------------*/ + +class Gidaspow +: + public viscosityModel +{ + +public: + + //- Runtime type information + TypeName("Gidaspow"); + + // Constructors + + //- Construct from components + Gidaspow(const dictionary& dict); + + + //- Destructor + virtual ~Gidaspow(); + + + // Member functions + + tmp mua + ( + const volScalarField& alpha, + const volScalarField& Theta, + const volScalarField& g0, + const dimensionedScalar& rhoa, + const volScalarField& da, + const dimensionedScalar& e + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace viscosityModels +} // End namespace kineticTheoryModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C new file mode 100644 index 0000000000..5f65f3c74c --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C @@ -0,0 +1,101 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "HrenyaSinclairViscosity.H" +#include "mathematicalConstants.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ +namespace viscosityModels +{ + defineTypeNameAndDebug(HrenyaSinclair, 0); + + addToRunTimeSelectionTable + ( + viscosityModel, + HrenyaSinclair, + dictionary + ); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::viscosityModels::HrenyaSinclair::HrenyaSinclair +( + const dictionary& dict +) +: + viscosityModel(dict), + coeffsDict_(dict.subDict(typeName + "Coeffs")), + L_(coeffsDict_.lookup("L")) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::viscosityModels::HrenyaSinclair::~HrenyaSinclair() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp +Foam::kineticTheoryModels::viscosityModels::HrenyaSinclair::mua +( + const volScalarField& alpha, + const volScalarField& Theta, + const volScalarField& g0, + const dimensionedScalar& rhoa, + const volScalarField& da, + const dimensionedScalar& e +) const +{ + const scalar sqrtPi = sqrt(constant::mathematical::pi); + + volScalarField lamda + ( + scalar(1) + da/(6.0*sqrt(2.0)*(alpha + scalar(1.0e-5)))/L_ + ); + + return rhoa*da*sqrt(Theta)* + ( + (4.0/5.0)*sqr(alpha)*g0*(1.0 + e)/sqrtPi + + (1.0/15.0)*sqrtPi*g0*(1.0 + e)*(3.0*e - 1)*sqr(alpha)/(3.0-e) + + (1.0/6.0)*sqrtPi*alpha*(0.5*lamda + 0.25*(3.0*e - 1.0)) + /(0.5*(3.0 - e)*lamda) + + (10/96.0)*sqrtPi/((1.0 + e)*0.5*(3.0 - e)*g0*lamda) + ); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.H b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.H new file mode 100644 index 0000000000..7d9640b471 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.H @@ -0,0 +1,104 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::viscosityModels::HrenyaSinclair + +Description + +SourceFiles + HrenyaSinclairViscosity.C + +\*---------------------------------------------------------------------------*/ + +#ifndef HrenyaSinclair_H +#define HrenyaSinclair_H + +#include "viscosityModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ +namespace viscosityModels +{ + +/*---------------------------------------------------------------------------*\ + Class HrenyaSinclair Declaration +\*---------------------------------------------------------------------------*/ + +class HrenyaSinclair +: + public viscosityModel +{ + // Private data + + dictionary coeffsDict_; + + //- characteristic length of geometry + dimensionedScalar L_; + + +public: + + //- Runtime type information + TypeName("HrenyaSinclair"); + + + // Constructors + + //- Construct from components + HrenyaSinclair(const dictionary& dict); + + + //- Destructor + virtual ~HrenyaSinclair(); + + + // Member functions + + tmp mua + ( + const volScalarField& alpha, + const volScalarField& Theta, + const volScalarField& g0, + const dimensionedScalar& rhoa, + const volScalarField& da, + const dimensionedScalar& e + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace viscosityModels +} // End namespace kineticTheoryModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.C b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.C new file mode 100644 index 0000000000..7529baa3ae --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.C @@ -0,0 +1,86 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "SyamlalViscosity.H" +#include "mathematicalConstants.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ +namespace viscosityModels +{ + defineTypeNameAndDebug(Syamlal, 0); + addToRunTimeSelectionTable(viscosityModel, Syamlal, dictionary); +} +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::viscosityModels::Syamlal::Syamlal +( + const dictionary& dict +) +: + viscosityModel(dict) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::viscosityModels::Syamlal::~Syamlal() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp +Foam::kineticTheoryModels::viscosityModels::Syamlal::mua +( + const volScalarField& alpha, + const volScalarField& Theta, + const volScalarField& g0, + const dimensionedScalar& rhoa, + const volScalarField& da, + const dimensionedScalar& e +) const +{ + const scalar sqrtPi = sqrt(constant::mathematical::pi); + + return rhoa*da*sqrt(Theta)* + ( + (4.0/5.0)*sqr(alpha)*g0*(1.0 + e)/sqrtPi + + (1.0/15.0)*sqrtPi*g0*(1.0 + e)*(3.0*e - 1.0)*sqr(alpha)/(3.0 - e) + + (1.0/6.0)*alpha*sqrtPi/(3.0 - e) + ); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.H b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.H new file mode 100644 index 0000000000..9d784aeeb2 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/viscosityModel/Syamlal/SyamlalViscosity.H @@ -0,0 +1,97 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::viscosityModels::Syamlal + +Description + +SourceFiles + SyamlalViscosity.C + +\*---------------------------------------------------------------------------*/ + +#ifndef Syamlal_H +#define Syamlal_H + +#include "viscosityModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ +namespace viscosityModels +{ + +/*---------------------------------------------------------------------------*\ + Class Syamlal Declaration +\*---------------------------------------------------------------------------*/ + +class Syamlal +: + public viscosityModel +{ + +public: + + //- Runtime type information + TypeName("Syamlal"); + + + // Constructors + + //- Construct from components + Syamlal(const dictionary& dict); + + + //- Destructor + virtual ~Syamlal(); + + + // Member functions + + tmp mua + ( + const volScalarField& alpha, + const volScalarField& Theta, + const volScalarField& g0, + const dimensionedScalar& rhoa, + const volScalarField& da, + const dimensionedScalar& e + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace viscosityModels +} // End namespace kineticTheoryModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/viscosityModel/none/noneViscosity.C b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/viscosityModel/none/noneViscosity.C new file mode 100644 index 0000000000..36f4bab76a --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/viscosityModel/none/noneViscosity.C @@ -0,0 +1,75 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "noneViscosity.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ + defineTypeNameAndDebug(noneViscosity, 0); + addToRunTimeSelectionTable(viscosityModel, noneViscosity, dictionary); +} +} + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::noneViscosity::noneViscosity(const dictionary& dict) +: + viscosityModel(dict) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::noneViscosity::~noneViscosity() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp Foam::kineticTheoryModels::noneViscosity::mua +( + const volScalarField& alpha, + const volScalarField& Theta, + const volScalarField& g0, + const dimensionedScalar& rhoa, + const volScalarField& da, + const dimensionedScalar& e +) const +{ + return dimensionedScalar + ( + "0", + dimensionSet(1, -1, -1, 0, 0, 0, 0), + 0.0 + )*alpha; +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/viscosityModel/none/noneViscosity.H b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/viscosityModel/none/noneViscosity.H new file mode 100644 index 0000000000..22f60d9602 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/viscosityModel/none/noneViscosity.H @@ -0,0 +1,94 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::noneViscosity + +Description + +SourceFiles + noneViscosity.C + +\*---------------------------------------------------------------------------*/ + +#ifndef noneViscosity_H +#define noneViscosity_H + +#include "viscosityModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ + +/*---------------------------------------------------------------------------*\ + Class noneViscosity Declaration +\*---------------------------------------------------------------------------*/ + +class noneViscosity +: + public viscosityModel +{ + +public: + + //- Runtime type information + TypeName("none"); + + + // Constructors + + //- Construct from components + noneViscosity(const dictionary& dict); + + + //- Destructor + virtual ~noneViscosity(); + + + // Member functions + + tmp mua + ( + const volScalarField& alpha, + const volScalarField& Theta, + const volScalarField& g0, + const dimensionedScalar& rhoa, + const volScalarField& da, + const dimensionedScalar& e + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace kineticTheoryModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C new file mode 100644 index 0000000000..2b50f09359 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C @@ -0,0 +1,59 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "viscosityModel.H" + +// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // + +Foam::autoPtr +Foam::kineticTheoryModels::viscosityModel::New +( + const dictionary& dict +) +{ + word viscosityModelType(dict.lookup("viscosityModel")); + + Info<< "Selecting viscosityModel " + << viscosityModelType << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(viscosityModelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalError + << "viscosityModel::New(const dictionary&) : " << endl + << " unknown viscosityModelType type " + << viscosityModelType + << ", constructor not in hash table" << endl << endl + << " Valid viscosityModelType types are :" << endl; + Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); + } + + return autoPtr(cstrIter()(dict)); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.C new file mode 100644 index 0000000000..dc4c1ca1de --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.C @@ -0,0 +1,57 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "viscosityModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ + defineTypeNameAndDebug(viscosityModel, 0); + defineRunTimeSelectionTable(viscosityModel, dictionary); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::viscosityModel::viscosityModel +( + const dictionary& dict +) +: + dict_(dict) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::kineticTheoryModels::viscosityModel::~viscosityModel() +{} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.H new file mode 100644 index 0000000000..9030938220 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModel.H @@ -0,0 +1,130 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::viscosityModel + +Description + +SourceFiles + viscosityModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef viscosityModel_H +#define viscosityModel_H + +#include "dictionary.H" +#include "volFields.H" +#include "dimensionedTypes.H" +#include "runTimeSelectionTables.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace kineticTheoryModels +{ + +/*---------------------------------------------------------------------------*\ + Class viscosityModel Declaration +\*---------------------------------------------------------------------------*/ + +class viscosityModel +{ + // Private member functions + + //- Disallow default bitwise copy construct + viscosityModel(const viscosityModel&); + + //- Disallow default bitwise assignment + void operator=(const viscosityModel&); + + +protected: + + // Protected data + + const dictionary& dict_; + + +public: + + //- Runtime type information + TypeName("viscosityModel"); + + // Declare runtime constructor selection table + declareRunTimeSelectionTable + ( + autoPtr, + viscosityModel, + dictionary, + ( + const dictionary& dict + ), + (dict) + ); + + + // Constructors + + //- Construct from components + viscosityModel(const dictionary& dict); + + + // Selectors + + static autoPtr New + ( + const dictionary& dict + ); + + + //- Destructor + virtual ~viscosityModel(); + + + // Member Functions + + virtual tmp mua + ( + const volScalarField& alpha, + const volScalarField& Theta, + const volScalarField& g0, + const dimensionedScalar& rhoa, + const volScalarField& da, + const dimensionedScalar& e + ) const = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace kineticTheoryModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam.C new file mode 100644 index 0000000000..b4cc579835 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseEulerFoam.C @@ -0,0 +1,110 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Application + multiphaseEulerFoam + +Description + Solver for a system of many compressible fluid phases including + heat-transfer. + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "multiphaseSystem.H" +#include "phaseModel.H" +#include "dragModel.H" +#include "heatTransferModel.H" +#include "pimpleControl.H" + +#include "singlePhaseTransportModel.H" +#include "LESModel.H" + +#include "MRFZones.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + #include "setRootCase.H" + + #include "createTime.H" + #include "createMesh.H" + + pimpleControl pimple(mesh); + + #include "createFields.H" + #include "createMRFZones.H" + #include "initContinuityErrs.H" + #include "readTimeControls.H" + #include "correctPhi.H" + #include "CourantNos.H" + #include "setInitialDeltaT.H" + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + Info<< "\nStarting time loop\n" << endl; + + while (runTime.run()) + { + #include "readTimeControls.H" + #include "CourantNos.H" + #include "setDeltaT.H" + + runTime++; + Info<< "Time = " << runTime.timeName() << nl << endl; + + // --- Pressure-velocity PIMPLE corrector loop + for (pimple.start(); pimple.loop(); pimple++) + { + sgsModel->correct(); + fluid.solve(); + rho = fluid.rho(); + + //#include "interfacialCoeffs.H" + //#include "TEqns.H" + #include "UEqns.H" + + // --- PISO loop + for (int corr=0; corr. + +\*---------------------------------------------------------------------------*/ + +#include "alphaContactAngleFvPatchScalarField.H" +#include "addToRunTimeSelectionTable.H" +#include "fvPatchFieldMapper.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +alphaContactAngleFvPatchScalarField::interfaceThetaProps::interfaceThetaProps +( + Istream& is +) +: + theta0_(readScalar(is)), + uTheta_(readScalar(is)), + thetaA_(readScalar(is)), + thetaR_(readScalar(is)) +{} + + +Istream& operator>> +( + Istream& is, + alphaContactAngleFvPatchScalarField::interfaceThetaProps& tp +) +{ + is >> tp.theta0_ >> tp.uTheta_ >> tp.thetaA_ >> tp.thetaR_; + return is; +} + + +Ostream& operator<< +( + Ostream& os, + const alphaContactAngleFvPatchScalarField::interfaceThetaProps& tp +) +{ + os << tp.theta0_ << token::SPACE + << tp.uTheta_ << token::SPACE + << tp.thetaA_ << token::SPACE + << tp.thetaR_; + + return os; +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF +) +: + zeroGradientFvPatchScalarField(p, iF) +{} + + +alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField +( + const alphaContactAngleFvPatchScalarField& gcpsf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + zeroGradientFvPatchScalarField(gcpsf, p, iF, mapper), + thetaProps_(gcpsf.thetaProps_) +{} + + +alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + zeroGradientFvPatchScalarField(p, iF), + thetaProps_(dict.lookup("thetaProperties")) +{ + evaluate(); +} + + +alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField +( + const alphaContactAngleFvPatchScalarField& gcpsf, + const DimensionedField& iF +) +: + zeroGradientFvPatchScalarField(gcpsf, iF), + thetaProps_(gcpsf.thetaProps_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void alphaContactAngleFvPatchScalarField::write(Ostream& os) const +{ + fvPatchScalarField::write(os); + os.writeKeyword("thetaProperties") + << thetaProps_ << token::END_STATEMENT << nl; + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + alphaContactAngleFvPatchScalarField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/alphaContactAngle/alphaContactAngleFvPatchScalarField.H b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/alphaContactAngle/alphaContactAngleFvPatchScalarField.H new file mode 100644 index 0000000000..8f980046e2 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/alphaContactAngle/alphaContactAngleFvPatchScalarField.H @@ -0,0 +1,215 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::alphaContactAngleFvPatchScalarField + +Description + Contact-angle boundary condition for multi-phase interface-capturing + simulations. Used in conjuction with multiphaseSystem. + +SourceFiles + alphaContactAngleFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef alphaContactAngleFvPatchScalarField_H +#define alphaContactAngleFvPatchScalarField_H + +#include "zeroGradientFvPatchFields.H" +#include "multiphaseSystem.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class alphaContactAngleFvPatch Declaration +\*---------------------------------------------------------------------------*/ + +class alphaContactAngleFvPatchScalarField +: + public zeroGradientFvPatchScalarField +{ +public: + + class interfaceThetaProps + { + //- Equilibrium contact angle + scalar theta0_; + + //- Dynamic contact angle velocity scale + scalar uTheta_; + + //- Limiting advancing contact angle + scalar thetaA_; + + //- Limiting receeding contact angle + scalar thetaR_; + + + public: + + // Constructors + interfaceThetaProps() + {} + + interfaceThetaProps(Istream&); + + + // Member functions + + //- Return the equilibrium contact angle theta0 + scalar theta0(bool matched=true) const + { + if (matched) return theta0_; + else return 180.0 - theta0_; + } + + //- Return the dynamic contact angle velocity scale + scalar uTheta() const + { + return uTheta_; + } + + //- Return the limiting advancing contact angle + scalar thetaA(bool matched=true) const + { + if (matched) return thetaA_; + else return 180.0 - thetaA_; + } + + //- Return the limiting receeding contact angle + scalar thetaR(bool matched=true) const + { + if (matched) return thetaR_; + else return 180.0 - thetaR_; + } + + + // IO functions + + friend Istream& operator>>(Istream&, interfaceThetaProps&); + friend Ostream& operator<<(Ostream&, const interfaceThetaProps&); + }; + + typedef HashTable + < + interfaceThetaProps, + multiphaseSystem::interfacePair, + multiphaseSystem::interfacePair::hash + > thetaPropsTable; + + +private: + + // Private data + + thetaPropsTable thetaProps_; + + +public: + + //- Runtime type information + TypeName("alphaContactAngle"); + + + // Constructors + + //- Construct from patch and internal field + alphaContactAngleFvPatchScalarField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + alphaContactAngleFvPatchScalarField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given alphaContactAngleFvPatchScalarField + // onto a new patch + alphaContactAngleFvPatchScalarField + ( + const alphaContactAngleFvPatchScalarField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Construct and return a clone + virtual tmp clone() const + { + return tmp + ( + new alphaContactAngleFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + alphaContactAngleFvPatchScalarField + ( + const alphaContactAngleFvPatchScalarField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp clone + ( + const DimensionedField& iF + ) const + { + return tmp + ( + new alphaContactAngleFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + //- Return the contact angle properties + const thetaPropsTable& thetaProps() const + { + return thetaProps_; + } + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C new file mode 100644 index 0000000000..3382504153 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C @@ -0,0 +1,822 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "multiphaseSystem.H" +#include "alphaContactAngleFvPatchScalarField.H" +#include "Time.H" +#include "subCycle.H" +#include "MULES.H" +#include "fvcSnGrad.H" +#include "fvcFlux.H" + +// * * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * // + +const Foam::scalar Foam::multiphaseSystem::convertToRad = + Foam::constant::mathematical::pi/180.0; + + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +void Foam::multiphaseSystem::calcAlphas() +{ + scalar level = 0.0; + alphas_ == 0.0; + + forAllIter(PtrDictionary, phases_, iter) + { + alphas_ += level*iter(); + level += 1.0; + } + + alphas_.correctBoundaryConditions(); +} + + +void Foam::multiphaseSystem::solveAlphas() +{ + surfaceScalarField phic(mag(phi_/mesh_.magSf())); + + PtrList phiAlphaCorrs(phases_.size()); + int phasei = 0; + + forAllIter(PtrDictionary, phases_, iter) + { + phaseModel& phase1 = iter(); + volScalarField& alpha1 = phase1; + + phase1.phiAlpha() = + dimensionedScalar("0", dimensionSet(0, 3, -1, 0, 0), 0); + + phiAlphaCorrs.set + ( + phasei, + new surfaceScalarField + ( + fvc::flux + ( + phi_, + phase1, + "div(phi," + alpha1.name() + ')' + ) + ) + ); + + surfaceScalarField& phiAlphaCorr = phiAlphaCorrs[phasei]; + + forAllIter(PtrDictionary, phases_, iter2) + { + phaseModel& phase2 = iter2(); + volScalarField& alpha2 = phase2; + + if (&phase2 == &phase1) continue; + + surfaceScalarField phir + ( + (phase1.phi() - phase2.phi()) + + min(cAlpha(phase1, phase2)*phic, max(phic)) + *nHatf(phase1, phase2) + ); + + word phirScheme + ( + "div(phir," + alpha2.name() + ',' + alpha1.name() + ')' + ); + + phiAlphaCorr += fvc::flux + ( + -fvc::flux(-phir, phase2, phirScheme), + phase1, + phirScheme + ); + } + + MULES::limit + ( + geometricOneField(), + phase1, + phi_, + phiAlphaCorr, + zeroField(), + zeroField(), + 1, + 0, + 3, + true + ); + + phasei++; + } + + MULES::limitSum(phiAlphaCorrs); + + volScalarField sumAlpha + ( + IOobject + ( + "sumAlpha", + mesh_.time().timeName(), + mesh_ + ), + mesh_, + dimensionedScalar("sumAlpha", dimless, 0) + ); + + phasei = 0; + + forAllIter(PtrDictionary, phases_, iter) + { + phaseModel& phase1 = iter(); + + surfaceScalarField& phiAlpha = phiAlphaCorrs[phasei]; + phiAlpha += upwind(mesh_, phi_).flux(phase1); + + MULES::explicitSolve + ( + geometricOneField(), + phase1, + phiAlpha, + zeroField(), + zeroField() + ); + + phase1.phiAlpha() += phiAlpha; + + Info<< phase1.name() << " volume fraction, min, max = " + << phase1.weightedAverage(mesh_.V()).value() + << ' ' << min(phase1).value() + << ' ' << max(phase1).value() + << endl; + + sumAlpha += phase1; + + phasei++; + } + + Info<< "Phase-sum volume fraction, min, max = " + << sumAlpha.weightedAverage(mesh_.V()).value() + << ' ' << min(sumAlpha).value() + << ' ' << max(sumAlpha).value() + << endl; + + calcAlphas(); +} + + +Foam::dimensionedScalar Foam::multiphaseSystem::sigma +( + const phaseModel& phase1, + const phaseModel& phase2 +) const +{ + scalarCoeffTable::const_iterator sigma + ( + sigmas_.find(interfacePair(phase1, phase2)) + ); + + if (sigma == sigmas_.end()) + { + FatalErrorIn + ( + "multiphaseSystem::sigma(const phaseModel& phase1," + "const phaseModel& phase2) const" + ) << "Cannot find interface " << interfacePair(phase1, phase2) + << " in list of sigma values" + << exit(FatalError); + } + + return dimensionedScalar("sigma", dimSigma_, sigma()); +} + + +Foam::scalar Foam::multiphaseSystem::cAlpha +( + const phaseModel& phase1, + const phaseModel& phase2 +) const +{ + scalarCoeffTable::const_iterator cAlpha + ( + cAlphas_.find(interfacePair(phase1, phase2)) + ); + + if (cAlpha == cAlphas_.end()) + { + FatalErrorIn + ( + "multiphaseSystem::cAlpha" + "(const phaseModel& phase1, const phaseModel& phase2) const" + ) << "Cannot find interface " << interfacePair(phase1, phase2) + << " in list of cAlpha values" + << exit(FatalError); + } + + return cAlpha(); +} + + +Foam::dimensionedScalar Foam::multiphaseSystem::Cvm +( + const phaseModel& phase1, + const phaseModel& phase2 +) const +{ + scalarCoeffTable::const_iterator Cvm + ( + Cvms_.find(interfacePair(phase1, phase2)) + ); + + if (Cvm != Cvms_.end()) + { + return Cvm()*phase2.rho(); + } + + Cvm = Cvms_.find(interfacePair(phase2, phase1)); + + if (Cvm != Cvms_.end()) + { + return Cvm()*phase1.rho(); + } + + FatalErrorIn + ( + "multiphaseSystem::sigma" + "(const phaseModel& phase1, const phaseModel& phase2) const" + ) << "Cannot find interface " << interfacePair(phase1, phase2) + << " in list of sigma values" + << exit(FatalError); + + return Cvm()*phase2.rho(); +} + + +Foam::tmp Foam::multiphaseSystem::nHatfv +( + const volScalarField& alpha1, + const volScalarField& alpha2 +) const +{ + /* + // Cell gradient of alpha + volVectorField gradAlpha = + alpha2*fvc::grad(alpha1) - alpha1*fvc::grad(alpha2); + + // Interpolated face-gradient of alpha + surfaceVectorField gradAlphaf = fvc::interpolate(gradAlpha); + */ + + surfaceVectorField gradAlphaf + ( + fvc::interpolate(alpha2)*fvc::interpolate(fvc::grad(alpha1)) + - fvc::interpolate(alpha1)*fvc::interpolate(fvc::grad(alpha2)) + ); + + // Face unit interface normal + return gradAlphaf/(mag(gradAlphaf) + deltaN_); +} + + +Foam::tmp Foam::multiphaseSystem::nHatf +( + const volScalarField& alpha1, + const volScalarField& alpha2 +) const +{ + // Face unit interface normal flux + return nHatfv(alpha1, alpha2) & mesh_.Sf(); +} + + +// Correction for the boundary condition on the unit normal nHat on +// walls to produce the correct contact angle. + +// The dynamic contact angle is calculated from the component of the +// velocity on the direction of the interface, parallel to the wall. + +void Foam::multiphaseSystem::correctContactAngle +( + const phaseModel& phase1, + const phaseModel& phase2, + surfaceVectorField::GeometricBoundaryField& nHatb +) const +{ + const volScalarField::GeometricBoundaryField& gbf + = phase1.boundaryField(); + + const fvBoundaryMesh& boundary = mesh_.boundary(); + + forAll(boundary, patchi) + { + if (isA(gbf[patchi])) + { + const alphaContactAngleFvPatchScalarField& acap = + refCast(gbf[patchi]); + + vectorField& nHatPatch = nHatb[patchi]; + + vectorField AfHatPatch + ( + mesh_.Sf().boundaryField()[patchi] + /mesh_.magSf().boundaryField()[patchi] + ); + + alphaContactAngleFvPatchScalarField::thetaPropsTable:: + const_iterator tp = + acap.thetaProps().find(interfacePair(phase1, phase2)); + + if (tp == acap.thetaProps().end()) + { + FatalErrorIn + ( + "multiphaseSystem::correctContactAngle" + "(const phaseModel& phase1, const phaseModel& phase2, " + "fvPatchVectorFieldField& nHatb) const" + ) << "Cannot find interface " << interfacePair(phase1, phase2) + << "\n in table of theta properties for patch " + << acap.patch().name() + << exit(FatalError); + } + + bool matched = (tp.key().first() == phase1.name()); + + scalar theta0 = convertToRad*tp().theta0(matched); + scalarField theta(boundary[patchi].size(), theta0); + + scalar uTheta = tp().uTheta(); + + // Calculate the dynamic contact angle if required + if (uTheta > SMALL) + { + scalar thetaA = convertToRad*tp().thetaA(matched); + scalar thetaR = convertToRad*tp().thetaR(matched); + + // Calculated the component of the velocity parallel to the wall + vectorField Uwall + ( + phase1.U().boundaryField()[patchi].patchInternalField() + - phase1.U().boundaryField()[patchi] + ); + Uwall -= (AfHatPatch & Uwall)*AfHatPatch; + + // Find the direction of the interface parallel to the wall + vectorField nWall + ( + nHatPatch - (AfHatPatch & nHatPatch)*AfHatPatch + ); + + // Normalise nWall + nWall /= (mag(nWall) + SMALL); + + // Calculate Uwall resolved normal to the interface parallel to + // the interface + scalarField uwall(nWall & Uwall); + + theta += (thetaA - thetaR)*tanh(uwall/uTheta); + } + + + // Reset nHatPatch to correspond to the contact angle + + scalarField a12(nHatPatch & AfHatPatch); + + scalarField b1(cos(theta)); + + scalarField b2(nHatPatch.size()); + + forAll(b2, facei) + { + b2[facei] = cos(acos(a12[facei]) - theta[facei]); + } + + scalarField det(1.0 - a12*a12); + + scalarField a((b1 - a12*b2)/det); + scalarField b((b2 - a12*b1)/det); + + nHatPatch = a*AfHatPatch + b*nHatPatch; + + nHatPatch /= (mag(nHatPatch) + deltaN_.value()); + } + } +} + + +Foam::tmp Foam::multiphaseSystem::K +( + const phaseModel& phase1, + const phaseModel& phase2 +) const +{ + tmp tnHatfv = nHatfv(phase1, phase2); + + correctContactAngle(phase1, phase2, tnHatfv().boundaryField()); + + // Simple expression for curvature + return -fvc::div(tnHatfv & mesh_.Sf()); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::multiphaseSystem::multiphaseSystem +( + const fvMesh& mesh, + const surfaceScalarField& phi +) +: + IOdictionary + ( + IOobject + ( + "transportProperties", + mesh.time().constant(), + mesh, + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE + ) + ), + phases_(lookup("phases"), phaseModel::iNew(mesh)), + + mesh_(mesh), + phi_(phi), + + alphas_ + ( + IOobject + ( + "alphas", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh_, + dimensionedScalar("alphas", dimless, 0.0), + zeroGradientFvPatchScalarField::typeName + ), + + sigmas_(lookup("sigmas")), + dimSigma_(1, 0, -2, 0, 0), + cAlphas_(lookup("interfaceCompression")), + Cvms_(lookup("virtualMass")), + deltaN_ + ( + "deltaN", + 1e-8/pow(average(mesh_.V()), 1.0/3.0) + ) +{ + calcAlphas(); + alphas_.write(); + + forAllIter(PtrDictionary, phases_, iter) + { + phaseModelTable_.add(iter()); + } + + interfaceDictTable dragModelsDict(lookup("drag")); + + forAllConstIter(interfaceDictTable, dragModelsDict, iter) + { + dragModels_.insert + ( + iter.key(), + dragModel::New + ( + iter(), + *phaseModelTable_.find(iter.key().first())(), + *phaseModelTable_.find(iter.key().second())() + ).ptr() + ); + } +} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + + +Foam::tmp Foam::multiphaseSystem::rho() const +{ + PtrDictionary::const_iterator iter = phases_.begin(); + + tmp trho = iter()*iter().rho(); + + for (++iter; iter != phases_.end(); ++iter) + { + trho() += iter()*iter().rho(); + } + + return trho; +} + + +Foam::tmp Foam::multiphaseSystem::Cvm +( + const phaseModel& phase +) const +{ + tmp tCvm + ( + new volScalarField + ( + IOobject + ( + "Cvm", + mesh_.time().timeName(), + mesh_ + ), + mesh_, + dimensionedScalar + ( + "Cvm", + dimensionSet(1, -3, 0, 0, 0), + 0 + ) + ) + ); + + forAllConstIter(PtrDictionary, phases_, iter) + { + const phaseModel& phase2 = iter(); + + if (&phase2 != &phase) + { + tCvm() += Cvm(phase, phase2)*phase2; + } + } + + return tCvm; +} + + +Foam::tmp Foam::multiphaseSystem::Svm +( + const phaseModel& phase +) const +{ + tmp tSvm + ( + new volVectorField + ( + IOobject + ( + "Svm", + mesh_.time().timeName(), + mesh_ + ), + mesh_, + dimensionedVector + ( + "Svm", + dimensionSet(1, -2, -2, 0, 0), + vector::zero + ) + ) + ); + + forAllConstIter(PtrDictionary, phases_, iter) + { + const phaseModel& phase2 = iter(); + + if (&phase2 != &phase) + { + tSvm() += Cvm(phase, phase2)*phase2*phase2.DDtU(); + } + } + + return tSvm; +} + + +Foam::autoPtr +Foam::multiphaseSystem::dragCoeffs() const +{ + autoPtr dragCoeffsPtr(new dragCoeffFields); + + forAllConstIter(dragModelTable, dragModels_, iter) + { + const dragModel& dm = *iter(); + + dragCoeffsPtr().insert + ( + iter.key(), + ( + dm.phase1()*dm.phase2() + *dm.K(mag(dm.phase1().U() - dm.phase2().U())) + + dm.residualDrag() + ).ptr() + ); + } + + return dragCoeffsPtr; +} + + +Foam::tmp Foam::multiphaseSystem::dragCoeff +( + const phaseModel& phase, + const dragCoeffFields& dragCoeffs +) const +{ + tmp tdragCoeff + ( + new volScalarField + ( + IOobject + ( + "dragCoeff", + mesh_.time().timeName(), + mesh_ + ), + mesh_, + dimensionedScalar + ( + "dragCoeff", + dimensionSet(1, -3, -1, 0, 0), + 0 + ) + ) + ); + + dragModelTable::const_iterator dmIter = dragModels_.begin(); + dragCoeffFields::const_iterator dcIter = dragCoeffs.begin(); + for + ( + ; + dmIter != dragModels_.end() && dcIter != dragCoeffs.end(); + ++dmIter, ++dcIter + ) + { + if + ( + &phase == &dmIter()->phase1() + || &phase == &dmIter()->phase2() + ) + { + tdragCoeff() += *dcIter(); + } + } + + return tdragCoeff; +} + + +Foam::tmp +Foam::multiphaseSystem::surfaceTensionForce() const +{ + tmp tstf + ( + new surfaceScalarField + ( + IOobject + ( + "surfaceTensionForce", + mesh_.time().timeName(), + mesh_ + ), + mesh_, + dimensionedScalar + ( + "surfaceTensionForce", + dimensionSet(1, -2, -2, 0, 0), + 0.0 + ) + ) + ); + + surfaceScalarField& stf = tstf(); + + forAllConstIter(PtrDictionary, phases_, iter1) + { + const phaseModel& phase1 = iter1(); + + PtrDictionary::const_iterator iter2 = iter1; + ++iter2; + + for (; iter2 != phases_.end(); ++iter2) + { + const phaseModel& phase2 = iter2(); + + stf += sigma(phase1, phase2) + *fvc::interpolate(K(phase1, phase2))* + ( + fvc::interpolate(phase2)*fvc::snGrad(phase1) + - fvc::interpolate(phase1)*fvc::snGrad(phase2) + ); + } + } + + return tstf; +} + + +Foam::tmp +Foam::multiphaseSystem::nearInterface() const +{ + tmp tnearInt + ( + new volScalarField + ( + IOobject + ( + "nearInterface", + mesh_.time().timeName(), + mesh_ + ), + mesh_, + dimensionedScalar("nearInterface", dimless, 0.0) + ) + ); + + forAllConstIter(PtrDictionary, phases_, iter) + { + tnearInt() = max(tnearInt(), pos(iter() - 0.01)*pos(0.99 - iter())); + } + + return tnearInt; +} + + +void Foam::multiphaseSystem::solve() +{ + forAllIter(PtrDictionary, phases_, iter) + { + iter().correct(); + } + + const Time& runTime = mesh_.time(); + + const dictionary& pimpleDict = mesh_.solutionDict().subDict("PIMPLE"); + + label nAlphaSubCycles(readLabel(pimpleDict.lookup("nAlphaSubCycles"))); + + volScalarField& alpha = phases_.first(); + + if (nAlphaSubCycles > 1) + { + dimensionedScalar totalDeltaT = runTime.deltaT(); + + for + ( + subCycle alphaSubCycle(alpha, nAlphaSubCycles); + !(++alphaSubCycle).end(); + ) + { + solveAlphas(); + } + } + else + { + solveAlphas(); + } +} + + +bool Foam::multiphaseSystem::read() +{ + if (regIOobject::read()) + { + bool readOK = true; + + PtrList phaseData(lookup("phases")); + label phasei = 0; + + forAllIter(PtrDictionary, phases_, iter) + { + readOK &= iter().read(phaseData[phasei++].dict()); + } + + lookup("sigmas") >> sigmas_; + lookup("interfaceCompression") >> cAlphas_; + lookup("virtualMass") >> Cvms_; + + return readOK; + } + else + { + return false; + } +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H new file mode 100644 index 0000000000..408fdcdafa --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.H @@ -0,0 +1,321 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::multiphaseSystem + +Description + Incompressible multi-phase mixture with built in solution for the + phase fractions with interface compression for interface-capturing. + + Derived from transportModel so that it can be unsed in conjunction with + the incompressible turbulence models. + + Surface tension and contact-angle is handled for the interface + between each phase-pair. + +SourceFiles + multiphaseSystem.C + +\*---------------------------------------------------------------------------*/ + +#ifndef multiphaseSystem_H +#define multiphaseSystem_H + +#include "incompressible/transportModel/transportModel.H" +#include "phaseModel.H" +#include "PtrDictionary.H" +#include "volFields.H" +#include "surfaceFields.H" +#include "dragModel.H" +#include "HashPtrTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class multiphaseSystem Declaration +\*---------------------------------------------------------------------------*/ + +class multiphaseSystem +: + public IOdictionary +{ + +public: + + class interfacePair + : + public Pair + { + public: + + class hash + : + public Hash + { + public: + + hash() + {} + + label operator()(const interfacePair& key) const + { + return word::hash()(key.first()) + word::hash()(key.second()); + } + }; + + + // Constructors + + interfacePair() + {} + + interfacePair(const word& alpha1Name, const word& alpha2Name) + : + Pair(alpha1Name, alpha2Name) + {} + + interfacePair(const phaseModel& alpha1, const phaseModel& alpha2) + : + Pair(alpha1.name(), alpha2.name()) + {} + + + // Friend Operators + + friend bool operator== + ( + const interfacePair& a, + const interfacePair& b + ) + { + return + ( + ((a.first() == b.first()) && (a.second() == b.second())) + || ((a.first() == b.second()) && (a.second() == b.first())) + ); + } + + friend bool operator!= + ( + const interfacePair& a, + const interfacePair& b + ) + { + return (!(a == b)); + } + }; + + + typedef HashPtrTable + dragModelTable; + + typedef HashPtrTable + dragCoeffFields; + + +private: + + // Private data + + //- Dictionary of phases + PtrDictionary phases_; + + //- phaseModelTable + class phaseModelTable + : + public HashTable + { + public: + + phaseModelTable() + {} + + void add(const phaseModel& pm) + { + this->insert(pm.name(), &pm); + } + }; + + //- Phase model table for quick lookup + phaseModelTable phaseModelTable_; + + const fvMesh& mesh_; + const surfaceScalarField& phi_; + + volScalarField alphas_; + + typedef HashTable + scalarCoeffTable; + + scalarCoeffTable sigmas_; + dimensionSet dimSigma_; + + scalarCoeffTable cAlphas_; + + scalarCoeffTable Cvms_; + + typedef HashTable + interfaceDictTable; + + dragModelTable dragModels_; + + //- Stabilisation for normalisation of the interface normal + const dimensionedScalar deltaN_; + + //- Conversion factor for degrees into radians + static const scalar convertToRad; + + + // Private member functions + + void calcAlphas(); + + void solveAlphas(); + + dimensionedScalar sigma + ( + const phaseModel& phase1, + const phaseModel& phase2 + ) const; + + scalar cAlpha + ( + const phaseModel& phase1, + const phaseModel& phase2 + ) const; + + dimensionedScalar Cvm + ( + const phaseModel& phase1, + const phaseModel& phase2 + ) const; + + tmp nHatfv + ( + const volScalarField& alpha1, + const volScalarField& alpha2 + ) const; + + tmp nHatf + ( + const volScalarField& alpha1, + const volScalarField& alpha2 + ) const; + + void correctContactAngle + ( + const phaseModel& alpha1, + const phaseModel& alpha2, + surfaceVectorField::GeometricBoundaryField& nHatb + ) const; + + tmp K + ( + const phaseModel& alpha1, + const phaseModel& alpha2 + ) const; + + +public: + + // Constructors + + //- Construct from components + multiphaseSystem + ( + const fvMesh& mesh, + const surfaceScalarField& phi + ); + + + //- Destructor + virtual ~multiphaseSystem() + {} + + + // Member Functions + + //- Return the phases + const PtrDictionary& phases() const + { + return phases_; + } + + //- Return the phases + PtrDictionary& phases() + { + return phases_; + } + + //- Return the mixture density + tmp rho() const; + + //- Return the virtual-mass coefficient for the given phase + tmp Cvm(const phaseModel& phase) const; + + //- Return the virtual-mass source for the given phase + tmp Svm(const phaseModel& phase) const; + + //- Return the table of drag models + const dragModelTable& dragModels() const + { + return dragModels_; + } + + //- Return the drag coefficients for all of the interfaces + autoPtr dragCoeffs() const; + + //- Return the sum of the drag coefficients for the given phase + tmp dragCoeff + ( + const phaseModel& phase, + const dragCoeffFields& dragCoeffs + ) const; + + tmp surfaceTensionForce() const; + + //- Indicator of the proximity of the interface + // Field values are 1 near and 0 away for the interface. + tmp nearInterface() const; + + //- Solve for the mixture phase-fractions + void solve(); + + //- Read base transportProperties dictionary + bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H b/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H new file mode 100644 index 0000000000..5f7c38ebf0 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H @@ -0,0 +1,263 @@ +{ + // rho1 = rho10 + psi1*p; + // rho2 = rho20 + psi2*p; + + // tmp pEqnComp1; + // tmp pEqnComp2; + + // //if (transonic) + // //{ + // //} + // //else + // { + // surfaceScalarField phid1("phid1", fvc::interpolate(psi1)*phi1); + // surfaceScalarField phid2("phid2", fvc::interpolate(psi2)*phi2); + + // pEqnComp1 = + // fvc::ddt(rho1) + psi1*correction(fvm::ddt(p)) + // + fvc::div(phid1, p) + // - fvc::Sp(fvc::div(phid1), p); + + // pEqnComp2 = + // fvc::ddt(rho2) + psi2*correction(fvm::ddt(p)) + // + fvc::div(phid2, p) + // - fvc::Sp(fvc::div(phid2), p); + // } + + PtrList alphafs(fluid.phases().size()); + PtrList U0s(fluid.phases().size()); + PtrList phi0s(fluid.phases().size()); + PtrList rAUs(fluid.phases().size()); + PtrList rAlphaAUfs(fluid.phases().size()); + + phasei = 0; + forAllIter(PtrDictionary, fluid.phases(), iter) + { + phaseModel& phase = iter(); + + U0s.set(phasei, new volVectorField(phase.U())); + phi0s.set(phasei, new surfaceScalarField(phase.phi())); + + phasei++; + } + + phasei = 0; + forAllIter(PtrDictionary, fluid.phases(), iter) + { + phaseModel& phase = iter(); + const volScalarField& alpha = phase; + + alphafs.set(phasei, fvc::interpolate(alpha).ptr()); + rAUs.set(phasei, (1.0/UEqns[phasei].A()).ptr()); + rAlphaAUfs.set(phasei, fvc::interpolate(alpha*rAUs[phasei]).ptr()); + + phase.U() = rAUs[phasei]*UEqns[phasei].H(); + + phase.phi() = + ( + (fvc::interpolate(phase.U()) & mesh.Sf()) + + fvc::ddtPhiCorr(rAUs[phasei], alpha, phase.U(), phase.phi()) + ); + + mrfZones.relativeFlux(phase.phi()); + phase.phi() += rAlphaAUfs[phasei]*(g & mesh.Sf()); + + multiphaseSystem::dragModelTable::const_iterator dmIter = + fluid.dragModels().begin(); + multiphaseSystem::dragCoeffFields::const_iterator dcIter = + dragCoeffs().begin(); + for + ( + ; + dmIter != fluid.dragModels().end() && dcIter != dragCoeffs().end(); + ++dmIter, ++dcIter + ) + { + if + ( + &phase == &dmIter()->phase1() + || &phase == &dmIter()->phase2() + ) + { + int phasej = 0; + forAllIter(PtrDictionary, fluid.phases(), iter2) + { + phaseModel& phase2 = iter2(); + + if + ( + ( + &phase == &dmIter()->phase1() + && &phase2 == &dmIter()->phase2() + ) + || ( + &phase == &dmIter()->phase2() + && &phase2 == &dmIter()->phase1() + ) + ) break; + + phasej++; + } + + phase.phi() += + fvc::interpolate + ((1.0/phase.rho())*rAUs[phasei]*(*dcIter())) + *phi0s[phasej]; + } + } + + phasei++; + } + + phi = dimensionedScalar("phi", phi.dimensions(), 0); + surfaceScalarField Dp + ( + IOobject + ( + "Dp", + runTime.timeName(), + mesh + ), + mesh, + dimensionedScalar("Dp", dimensionSet(-1, 3, 1, 0, 0), 0) + ); + + phasei = 0; + forAllIter(PtrDictionary, fluid.phases(), iter) + { + phaseModel& phase = iter(); + phi += alphafs[phasei]*phase.phi(); + Dp += alphafs[phasei]*rAlphaAUfs[phasei]/phase.rho(); + + phasei++; + } + Dp = mag(Dp); + adjustPhi(phi, U, p); + + for(int nonOrth=0; nonOrth<=pimple.nNonOrthCorr(); nonOrth++) + { + fvScalarMatrix pEqnIncomp + ( + fvc::div(phi) + - fvm::laplacian(Dp, p) + ); + + solve + ( + // ( + // (alpha1/rho1)*pEqnComp1() + // + (alpha2/rho2)*pEqnComp2() + // ) + + pEqnIncomp, + mesh.solver(p.select(pimple.finalInnerIter(corr, nonOrth))) + ); + + if (nonOrth == pimple.nNonOrthCorr()) + { + surfaceScalarField mSfGradp = pEqnIncomp.flux()/Dp; + + phasei = 0; + phi = dimensionedScalar("phi", phi.dimensions(), 0); + forAllIter(PtrDictionary, fluid.phases(), iter) + { + phaseModel& phase = iter(); + + phase.phi() += rAlphaAUfs[phasei]*mSfGradp/phase.rho(); + phi += alphafs[phasei]*phase.phi(); + + phasei++; + } + + // dgdt = + // ( + // pos(alpha2)*(pEqnComp2 & p)/rho2 + // - pos(alpha1)*(pEqnComp1 & p)/rho1 + // ); + + p.relax(); + mSfGradp = pEqnIncomp.flux()/Dp; + + U = dimensionedVector("U", dimVelocity, vector::zero); + + phasei = 0; + forAllIter(PtrDictionary, fluid.phases(), iter) + { + phaseModel& phase = iter(); + const volScalarField& alpha = phase; + + phase.U() += + fvc::reconstruct + ( + rAlphaAUfs[phasei]*(g & mesh.Sf()) + + rAlphaAUfs[phasei]*mSfGradp/phase.rho() + ); + + multiphaseSystem::dragModelTable::const_iterator dmIter = + fluid.dragModels().begin(); + multiphaseSystem::dragCoeffFields::const_iterator dcIter = + dragCoeffs().begin(); + for + ( + ; + dmIter != fluid.dragModels().end() + && dcIter != dragCoeffs().end(); + ++dmIter, ++dcIter + ) + { + if + ( + &phase == &dmIter()->phase1() + || &phase == &dmIter()->phase2() + ) + { + int phasej = 0; + forAllIter + ( + PtrDictionary, + fluid.phases(), + iter2 + ) + { + phaseModel& phase2 = iter2(); + + if + ( + ( + &phase == &dmIter()->phase1() + && &phase2 == &dmIter()->phase2() + ) + || ( + &phase == &dmIter()->phase2() + && &phase2 == &dmIter()->phase1() + ) + ) break; + + phasej++; + } + + phase.U() += + (1.0/phase.rho()) + *rAUs[phasei]*(*dcIter())*U0s[phasej]; + } + } + + phase.U() = fvc::reconstruct(phase.phi()); + phase.U().correctBoundaryConditions(); + + U += alpha*phase.U(); + + phasei++; + } + } + } + + //p = max(p, pMin); + + #include "continuityErrs.H" + + // rho1 = rho10 + psi1*p; + // rho2 = rho20 + psi2*p; + + // Dp1Dt = fvc::DDt(phi1, p); + // Dp2Dt = fvc::DDt(phi2, p); +} diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/packingLimiter.H b/applications/solvers/multiphase/multiphaseEulerFoam/packingLimiter.H new file mode 100644 index 0000000000..3790bf9bb9 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/packingLimiter.H @@ -0,0 +1,36 @@ + if (packingLimiter) + { + // Calculating exceeding volume fractions + volScalarField alphaEx(max(alpha1 - alphaMax, scalar(0))); + + // Finding neighbouring cells of the whole domain + labelListList neighbour = mesh.cellCells(); + scalarField cellVolumes(mesh.cellVolumes()); + + forAll (alphaEx, celli) + { + // Finding the labels of the neighbouring cells + labelList neighbourCell = neighbour[celli]; + + // Initializing neighbouring cells contribution + scalar neighboursEx = 0.0; + + forAll (neighbourCell, cellj) + { + labelList neighboursNeighbour = neighbour[neighbourCell[cellj]]; + scalar neighboursNeighbourCellVolumes = 0.0; + + forAll (neighboursNeighbour, cellk) + { + neighboursNeighbourCellVolumes += + cellVolumes[neighboursNeighbour[cellk]]; + } + + neighboursEx += + alphaEx[neighbourCell[cellj]]*cellVolumes[celli] + /neighboursNeighbourCellVolumes; + } + + alpha1[celli] += neighboursEx - alphaEx[celli]; + } + } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/Make/files b/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/Make/files new file mode 100644 index 0000000000..216ae9a5e9 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/Make/files @@ -0,0 +1,7 @@ +phaseModel/phaseModel.C +diameterModels/diameterModel/diameterModel.C +diameterModels/diameterModel/newDiameterModel.C +diameterModels/constantDiameter/constantDiameter.C +diameterModels/isothermalDiameter/isothermalDiameter.C + +LIB = $(FOAM_LIBBIN)/libcompressibleMultiPhaseModel diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/Make/options b/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/Make/options new file mode 100644 index 0000000000..0ec1139209 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/Make/options @@ -0,0 +1,6 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/transportModels/incompressible/lnInclude + +LIB_LIBS = \ + -lincompressibleTransportModels diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/diameterModels/constantDiameter/constantDiameter.C b/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/diameterModels/constantDiameter/constantDiameter.C new file mode 100644 index 0000000000..7be2be6d56 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/diameterModels/constantDiameter/constantDiameter.C @@ -0,0 +1,87 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "constantDiameter.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ + defineTypeNameAndDebug(constant, 0); + + addToRunTimeSelectionTable + ( + diameterModel, + constant, + dictionary + ); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::diameterModels::constant::constant +( + const dictionary& dict, + const phaseModel& phase +) +: + diameterModel(dict, phase), + d_("d", dimLength, dict.lookup("d")) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::diameterModels::constant::~constant() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp Foam::diameterModels::constant::d() const +{ + return tmp + ( + new volScalarField + ( + IOobject + ( + "d", + phase_.U().time().timeName(), + phase_.U().mesh() + ), + phase_.U().mesh(), + d_ + ) + ); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/diameterModels/constantDiameter/constantDiameter.H b/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/diameterModels/constantDiameter/constantDiameter.H new file mode 100644 index 0000000000..5ce8c9a3d9 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/diameterModels/constantDiameter/constantDiameter.H @@ -0,0 +1,96 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::constant + +Description + Constant dispersed-phase particle diameter model. + +SourceFiles + constant.C + +\*---------------------------------------------------------------------------*/ + +#ifndef constant_H +#define constant_H + +#include "diameterModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ + +/*---------------------------------------------------------------------------*\ + Class constant Declaration +\*---------------------------------------------------------------------------*/ + +class constant +: + public diameterModel +{ + // Private data + + //- The constant diameter of the phase + dimensionedScalar d_; + + +public: + + //- Runtime type information + TypeName("constant"); + + + // Constructors + + //- Construct from components + constant + ( + const dictionary& dict, + const phaseModel& phase + ); + + + //- Destructor + virtual ~constant(); + + + // Member Functions + + tmp d() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace diameterModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/diameterModels/diameterModel/diameterModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/diameterModels/diameterModel/diameterModel.C new file mode 100644 index 0000000000..800c700dce --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/diameterModels/diameterModel/diameterModel.C @@ -0,0 +1,56 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "diameterModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(diameterModel, 0); + defineRunTimeSelectionTable(diameterModel, dictionary); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::diameterModel::diameterModel +( + const dictionary& dict, + const phaseModel& phase +) +: + dict_(dict), + phase_(phase) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::diameterModel::~diameterModel() +{} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/diameterModels/diameterModel/diameterModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/diameterModels/diameterModel/diameterModel.H new file mode 100644 index 0000000000..3af7bd18ff --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/diameterModels/diameterModel/diameterModel.H @@ -0,0 +1,120 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::diameterModel + +Description + Abstract base-class for dispersed-phase particle diameter models. + +SourceFiles + diameterModel.C + newDiameterModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef diameterModel_H +#define diameterModel_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "dictionary.H" +#include "phaseModel.H" +#include "runTimeSelectionTables.H" + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class diameterModel Declaration +\*---------------------------------------------------------------------------*/ + +class diameterModel +{ +protected: + + // Protected data + + const dictionary& dict_; + const phaseModel& phase_; + + +public: + + //- Runtime type information + TypeName("diameterModel"); + + + // Declare runtime construction + + declareRunTimeSelectionTable + ( + autoPtr, + diameterModel, + dictionary, + ( + const dictionary& dict, + const phaseModel& phase + ), + (dict, phase) + ); + + + // Constructors + + diameterModel + ( + const dictionary& dict, + const phaseModel& phase + ); + + + //- Destructor + virtual ~diameterModel(); + + + // Selectors + + static autoPtr New + ( + const dictionary& dict, + const phaseModel& phase + ); + + + // Member Functions + + //- Return the phase mean diameter field + virtual tmp d() const = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/diameterModels/diameterModel/newDiameterModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/diameterModels/diameterModel/newDiameterModel.C new file mode 100644 index 0000000000..01d685ad56 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/diameterModels/diameterModel/newDiameterModel.C @@ -0,0 +1,63 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "diameterModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +Foam::autoPtr Foam::diameterModel::New +( + const dictionary& dict, + const phaseModel& phase +) +{ + word diameterModelType + ( + dict.lookup("diameterModel") + ); + + Info << "Selecting diameterModel for phase " + << phase.name() + << ": " + << diameterModelType << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(diameterModelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorIn("diameterModel::New") + << "Unknown diameterModelType type " + << diameterModelType << endl << endl + << "Valid diameterModel types are : " << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return cstrIter()(dict.subDict(diameterModelType + "Coeffs"), phase); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/diameterModels/isothermalDiameter/isothermalDiameter.C b/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/diameterModels/isothermalDiameter/isothermalDiameter.C new file mode 100644 index 0000000000..39d6f1afbd --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/diameterModels/isothermalDiameter/isothermalDiameter.C @@ -0,0 +1,80 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "isothermalDiameter.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ + defineTypeNameAndDebug(isothermal, 0); + + addToRunTimeSelectionTable + ( + diameterModel, + isothermal, + dictionary + ); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::diameterModels::isothermal::isothermal +( + const dictionary& dict, + const phaseModel& phase +) +: + diameterModel(dict, phase), + d0_("d0", dimLength, dict.lookup("d0")), + p0_("p0", dimPressure, dict.lookup("p0")) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::diameterModels::isothermal::~isothermal() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp Foam::diameterModels::isothermal::d() const +{ + const volScalarField& p = phase_.U().db().lookupObject + ( + "p" + ); + + return d0_*pow(p0_/p, 1.0/3.0); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/diameterModels/isothermalDiameter/isothermalDiameter.H b/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/diameterModels/isothermalDiameter/isothermalDiameter.H new file mode 100644 index 0000000000..29fe2c8642 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/diameterModels/isothermalDiameter/isothermalDiameter.H @@ -0,0 +1,99 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::isothermal + +Description + Isothermal dispersed-phase particle diameter model. + +SourceFiles + isothermal.C + +\*---------------------------------------------------------------------------*/ + +#ifndef isothermal_H +#define isothermal_H + +#include "diameterModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace diameterModels +{ + +/*---------------------------------------------------------------------------*\ + Class isothermal Declaration +\*---------------------------------------------------------------------------*/ + +class isothermal +: + public diameterModel +{ + // Private data + + //- Reference diameter for the isothermal expansion + dimensionedScalar d0_; + + //- Reference pressure for the isothermal expansion + dimensionedScalar p0_; + + +public: + + //- Runtime type information + TypeName("isothermal"); + + + // Constructors + + //- Construct from components + isothermal + ( + const dictionary& dict, + const phaseModel& phase + ); + + + //- Destructor + virtual ~isothermal(); + + + // Member Functions + + tmp d() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace diameterModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/phaseModel/phaseModel.C b/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/phaseModel/phaseModel.C new file mode 100644 index 0000000000..bf65fe659c --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/phaseModel/phaseModel.C @@ -0,0 +1,237 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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 "phaseModel.H" +#include "diameterModel.H" +#include "fixedValueFvPatchFields.H" +#include "surfaceInterpolate.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::phaseModel::phaseModel +( + const word& name, + const dictionary& phaseDict, + const fvMesh& mesh +) +: + volScalarField + ( + IOobject + ( + "alpha" + name, + mesh.time().timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ), + name_(name), + phaseDict_(phaseDict), + nu_ + ( + "nu", + dimensionSet(0, 2, -1, 0, 0), + phaseDict_.lookup("nu") + ), + kappa_ + ( + "kappa", + dimensionSet(1, 1, -3, -1, 0), + phaseDict_.lookup("kappa") + ), + Cp_ + ( + "Cp", + dimensionSet(0, 2, -2, -1, 0), + phaseDict_.lookup("Cp") + ), + rho_ + ( + "rho", + dimDensity, + phaseDict_.lookup("rho") + ), + U_ + ( + IOobject + ( + "U" + name, + mesh.time().timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ), + DDtU_ + ( + IOobject + ( + "DDtU" + name, + mesh.time().timeName(), + mesh + ), + mesh, + dimensionedVector("0", dimVelocity/dimTime, vector::zero) + ), + phiAlpha_ + ( + IOobject + ( + "phiAlpha" + name, + mesh.time().timeName(), + mesh + ), + mesh, + dimensionedScalar("0", dimensionSet(0, 3, -1, 0, 0), 0) + ) +{ + const word phiName = "phi" + name; + + IOobject phiHeader + ( + phiName, + mesh.time().timeName(), + mesh, + IOobject::NO_READ + ); + + if (phiHeader.headerOk()) + { + Info<< "Reading face flux field " << phiName << endl; + + phiPtr_.reset + ( + new surfaceScalarField + ( + IOobject + ( + phiName, + mesh.time().timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ) + ); + } + else + { + Info<< "Calculating face flux field " << phiName << endl; + + wordList phiTypes + ( + U_.boundaryField().size(), + calculatedFvPatchScalarField::typeName + ); + + forAll(U_.boundaryField(), i) + { + if (isA(U_.boundaryField()[i])) + { + phiTypes[i] = fixedValueFvPatchScalarField::typeName; + } + } + + phiPtr_.reset + ( + new surfaceScalarField + ( + IOobject + ( + phiName, + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + fvc::interpolate(U_) & mesh.Sf(), + phiTypes + ) + ); + } + + dPtr_ = diameterModel::New + ( + phaseDict_, + *this + ); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::phaseModel::~phaseModel() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::autoPtr Foam::phaseModel::clone() const +{ + notImplemented("phaseModel::clone() const"); + return autoPtr(NULL); +} + + + +void Foam::phaseModel::correct() +{ + //nuModel_->correct(); +} + + +bool Foam::phaseModel::read(const dictionary& phaseDict) +{ + phaseDict_ = phaseDict; + + //if (nuModel_->read(phaseDict_)) + { + phaseDict_.lookup("nu") >> nu_; + phaseDict_.lookup("kappa") >> kappa_; + phaseDict_.lookup("Cp") >> Cp_; + phaseDict_.lookup("rho") >> rho_; + + return true; + } + // else + // { + // return false; + // } + + return true; +} + + +Foam::tmp Foam::phaseModel::d() const +{ + return dPtr_().d(); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/phaseModel/phaseModel.H b/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/phaseModel/phaseModel.H new file mode 100644 index 0000000000..cd50760aff --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/phaseModel/phaseModel.H @@ -0,0 +1,227 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 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::phaseModel + +SourceFiles + phaseModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef phaseModel_H +#define phaseModel_H + +#include "dictionary.H" +#include "dictionaryEntry.H" +#include "dimensionedScalar.H" +#include "volFields.H" +#include "surfaceFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declarations +class diameterModel; + +/*---------------------------------------------------------------------------*\ + Class phaseModel Declaration +\*---------------------------------------------------------------------------*/ + +class phaseModel +: + public volScalarField +{ + // Private data + + //- Name of phase + word name_; + + dictionary phaseDict_; + + //- Kinematic viscosity + dimensionedScalar nu_; + + //- Thermal conductivity + dimensionedScalar kappa_; + + //- Heat capacity + dimensionedScalar Cp_; + + //- Density + dimensionedScalar rho_; + + //- Velocity + volVectorField U_; + + //- Substantive derivative of the velocity + volVectorField DDtU_; + + //- Volumetric flux of the phase + surfaceScalarField phiAlpha_; + + //- Volumetric flux for the phase + autoPtr phiPtr_; + + //- Diameter model + autoPtr dPtr_; + + +public: + + // Constructors + + phaseModel + ( + const word& phaseName, + const dictionary& phaseDict, + const fvMesh& mesh + ); + + //- Return clone + autoPtr clone() const; + + //- Return a pointer to a new phase created on freestore + // from Istream + class iNew + { + const fvMesh& mesh_; + + public: + + iNew + ( + const fvMesh& mesh + ) + : + mesh_(mesh) + {} + + autoPtr operator()(Istream& is) const + { + dictionaryEntry ent(dictionary::null, is); + return autoPtr + ( + new phaseModel(ent.keyword(), ent, mesh_) + ); + } + }; + + + //- Destructor + virtual ~phaseModel(); + + + // Member Functions + + const word& name() const + { + return name_; + } + + const word& keyword() const + { + return name(); + } + + tmp d() const; + + const dimensionedScalar& nu() const + { + return nu_; + } + + const dimensionedScalar& kappa() const + { + return kappa_; + } + + const dimensionedScalar& Cp() const + { + return Cp_; + } + + const dimensionedScalar& rho() const + { + return rho_; + } + + const volVectorField& U() const + { + return U_; + } + + volVectorField& U() + { + return U_; + } + + const volVectorField& DDtU() const + { + return DDtU_; + } + + volVectorField& DDtU() + { + return DDtU_; + } + + const surfaceScalarField& phi() const + { + return phiPtr_(); + } + + surfaceScalarField& phi() + { + return phiPtr_(); + } + + const surfaceScalarField& phiAlpha() const + { + return phiAlpha_; + } + + surfaceScalarField& phiAlpha() + { + return phiAlpha_; + } + + //- Correct the phase properties + void correct(); + + //- Read base transportProperties dictionary + bool read(const dictionary& phaseDict); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/readPPProperties.H b/applications/solvers/multiphase/multiphaseEulerFoam/readPPProperties.H new file mode 100644 index 0000000000..3acbf758d0 --- /dev/null +++ b/applications/solvers/multiphase/multiphaseEulerFoam/readPPProperties.H @@ -0,0 +1,36 @@ + IOdictionary ppProperties + ( + IOobject + ( + "ppProperties", + runTime.constant(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ); + + scalar preAlphaExp + ( + readScalar(ppProperties.lookup("preAlphaExp")) + ); + + scalar alphaMax + ( + readScalar(ppProperties.lookup("alphaMax")) + ); + + scalar expMax + ( + readScalar(ppProperties.lookup("expMax")) + ); + + dimensionedScalar g0 + ( + ppProperties.lookup("g0") + ); + + Switch packingLimiter + ( + ppProperties.lookup("packingLimiter") + ); diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C index 8608c60148..fb6283d1ef 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C @@ -64,7 +64,6 @@ Foam::multiphaseMixture::multiphaseMixture : transportModel(U, phi), phases_(lookup("phases"), phase::iNew(U, phi)), - refPhase_(*phases_.lookup(word(lookup("refPhase")))), mesh_(U.mesh()), U_(U), @@ -335,7 +334,7 @@ void Foam::multiphaseMixture::correctContactAngle ) const { const volScalarField::GeometricBoundaryField& gbf - = refPhase_.boundaryField(); + = alpha1.boundaryField(); const fvBoundaryMesh& boundary = mesh_.boundary(); @@ -549,8 +548,20 @@ void Foam::multiphaseMixture::solveAlphas MULES::limitSum(phiAlphaCorrs); - rhoPhi_ = 0.0*phi_*refPhase_.rho(); - volScalarField sumAlpha("sumAlpha", 0.0*refPhase_); + rhoPhi_ = dimensionedScalar("0", dimensionSet(1, 0, -1, 0, 0), 0); + + volScalarField sumAlpha + ( + IOobject + ( + "sumAlpha", + mesh_.time().timeName(), + mesh_ + ), + mesh_, + dimensionedScalar("sumAlpha", dimless, 0) + ); + phasei = 0; forAllIter(PtrDictionary, phases_, iter) diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H index ae15dc7ed0..19b436ef2a 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H @@ -136,10 +136,6 @@ private: //- Dictionary of phases PtrDictionary phases_; - //- The phase chosen as reference, the one which is derived from - // the others such thatr they sum to 1 - phase& refPhase_; - const fvMesh& mesh_; const volVectorField& U_; const surfaceScalarField& phi_; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.C index d6a65c9fa4..f1ace2213b 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.C @@ -69,7 +69,6 @@ Foam::tmp Foam::WenYu::K ) const { volScalarField beta(max(scalar(1) - alpha_, scalar(1.0e-6))); - volScalarField bp(pow(beta, -2.65)); volScalarField Re(max(Ur*phasea_.d()/phaseb_.nu(), scalar(1.0e-3))); volScalarField Cds @@ -78,7 +77,7 @@ Foam::tmp Foam::WenYu::K + pos(Re - 1000)*0.44 ); - return 0.75*Cds*phaseb_.rho()*Ur*bp/phasea_.d(); + return 0.75*Cds*phaseb_.rho()*Ur*pow(beta, -2.65)/phasea_.d(); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseEulerFoam.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseEulerFoam.C index 5fb4b7f7f1..43f353cd1c 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseEulerFoam.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseEulerFoam.C @@ -78,11 +78,6 @@ int main(int argc, char *argv[]) // --- Pressure-velocity PIMPLE corrector loop for (pimple.start(); pimple.loop(); pimple++) { - if (pimple.nOuterCorr() != 1) - { - p.storePrevIter(); - } - #include "alphaEqn.H" #include "liftDragCoeffs.H" #include "UEqns.H" diff --git a/applications/test/directMappedPatch/Make/files b/applications/test/directMappedPatch/Make/files deleted file mode 100644 index d33cd29958..0000000000 --- a/applications/test/directMappedPatch/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -Test-DirectMappedPatch.C - -EXE = $(FOAM_USER_APPBIN)/Test-DirectMappedPatch diff --git a/applications/test/mappedPatch/Make/files b/applications/test/mappedPatch/Make/files new file mode 100644 index 0000000000..468940aaec --- /dev/null +++ b/applications/test/mappedPatch/Make/files @@ -0,0 +1,3 @@ +Test-MappedPatch.C + +EXE = $(FOAM_USER_APPBIN)/Test-MappedPatch diff --git a/applications/test/directMappedPatch/Make/options b/applications/test/mappedPatch/Make/options similarity index 100% rename from applications/test/directMappedPatch/Make/options rename to applications/test/mappedPatch/Make/options diff --git a/applications/test/directMappedPatch/Test-DirectMappedPatch.C b/applications/test/mappedPatch/Test-MappedPatch.C similarity index 84% rename from applications/test/directMappedPatch/Test-DirectMappedPatch.C rename to applications/test/mappedPatch/Test-MappedPatch.C index 87d937da11..9f0258dfec 100644 --- a/applications/test/directMappedPatch/Test-DirectMappedPatch.C +++ b/applications/test/mappedPatch/Test-MappedPatch.C @@ -22,10 +22,10 @@ License along with OpenFOAM. If not, see . Application - testDirectMappedPatch + testMappedPatch Description - Test direct mapped b.c. by mapping face centres (mesh.C().boundaryField()). + Test mapped b.c. by mapping face centres (mesh.C().boundaryField()). \*---------------------------------------------------------------------------*/ @@ -37,7 +37,8 @@ Description #include "Time.H" #include "OFstream.H" #include "volFields.H" -#include "directMappedFixedValueFvPatchFields.H" +#include "mappedPolyPatch.H" +#include "mappedFixedValueFvPatchFields.H" using namespace Foam; @@ -48,10 +49,10 @@ using namespace Foam; int main(int argc, char *argv[]) { -# include "addTimeOptions.H" -# include "setRootCase.H" -# include "createTime.H" -# include "createMesh.H" + #include "addTimeOptions.H" + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" wordList patchFieldTypes ( @@ -61,10 +62,10 @@ int main(int argc, char *argv[]) forAll(mesh.boundaryMesh(), patchI) { - if (isA(mesh.boundaryMesh()[patchI])) + if (isA(mesh.boundaryMesh()[patchI])) { patchFieldTypes[patchI] = - directMappedFixedValueFvPatchVectorField::typeName; + mappedFixedValueFvPatchVectorField::typeName; } } @@ -92,13 +93,13 @@ int main(int argc, char *argv[]) { if ( - isA + isA ( cc.boundaryField()[patchI] ) ) { - Pout<< "Detected a directMapped patch:" << patchI << endl; + Pout<< "Detected a mapped patch:" << patchI << endl; OFstream str(mesh.boundaryMesh()[patchI].name() + ".obj"); Pout<< "Writing mapped values to " << str.name() << endl; diff --git a/applications/test/router/Gather/Gather.H b/applications/test/router/Gather/Gather.H index dc847d1894..337f7a6908 100644 --- a/applications/test/router/Gather/Gather.H +++ b/applications/test/router/Gather/Gather.H @@ -25,7 +25,7 @@ Class Foam::Gather Description - Gather data from all processors onto all processors. + Gather data from all processors onto all processors. SourceFiles Gather.C diff --git a/applications/test/router/Gather/GatherBase.C b/applications/test/router/Gather/GatherBase.C index 50d2143ab7..ecba2768b9 100644 --- a/applications/test/router/Gather/GatherBase.C +++ b/applications/test/router/Gather/GatherBase.C @@ -79,7 +79,7 @@ IndexType GatherBase::offset << " indices:" << indices.size() << abort(FatalError); } - + label sum = 0; diff --git a/applications/test/router/router.H b/applications/test/router/router.H index 7b675ac223..cbddd9a35b 100644 --- a/applications/test/router/router.H +++ b/applications/test/router/router.H @@ -56,7 +56,7 @@ Description | | ------+B - + But: + A diff --git a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshConformToSurface.C b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshConformToSurface.C index 454e355b94..e65a5beefa 100644 --- a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshConformToSurface.C +++ b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshConformToSurface.C @@ -136,7 +136,7 @@ void Foam::conformalVoronoiMesh::buildSurfaceConformation // Surface protrusion conformation is done in two steps. - // 1. the dual edges (of all internal vertices) can stretch to + // 1. the dual edges (of all internal vertices) can stretch to // 'infinity' so any intersection would be badly behaved. So // just find the nearest point on the geometry and insert point // pairs. diff --git a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshIO.C b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshIO.C index b5d73ae9e5..6430eab8ce 100644 --- a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshIO.C +++ b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshIO.C @@ -310,15 +310,15 @@ void Foam::conformalVoronoiMesh::writeMesh { // Determine map from Delaunay vertex to Dual mesh // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - + // From all Delaunay vertices to cell (positive index) // or patch face (negative index) labelList vertexToDualAddressing(number_of_vertices(), 0); - + forAll(cellToDelaunayVertex, cellI) { label vertI = cellToDelaunayVertex[cellI]; - + if (vertexToDualAddressing[vertI] != 0) { FatalErrorIn("conformalVoronoiMesh::writeMesh(..)") @@ -330,14 +330,14 @@ void Foam::conformalVoronoiMesh::writeMesh } vertexToDualAddressing[vertI] = cellI+1; } - + forAll(patchToDelaunayVertex, patchI) { const labelList& patchVertices = patchToDelaunayVertex[patchI]; forAll(patchVertices, i) { label vertI = patchVertices[i]; - + if (vertexToDualAddressing[vertI] > 0) { FatalErrorIn("conformalVoronoiMesh::writeMesh(..)") @@ -348,7 +348,7 @@ void Foam::conformalVoronoiMesh::writeMesh << vertexToDualAddressing[vertI]-1 << exit(FatalError); } - + // Vertex might be used by multiple faces. Which one to // use? For now last one wins. label dualFaceI = dualPatchStarts[patchI]+i; @@ -389,7 +389,7 @@ void Foam::conformalVoronoiMesh::writeMesh // Calculate map from tet points to dual mesh cells/patch faces // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - + labelIOList pointDualAddressing ( IOobject @@ -408,7 +408,7 @@ void Foam::conformalVoronoiMesh::writeMesh pointToDelaunayVertex )() ); - + label pointI = findIndex(pointDualAddressing, -1); if (pointI != -1) { @@ -422,13 +422,13 @@ void Foam::conformalVoronoiMesh::writeMesh ) << "Delaunay vertex " << pointI << " does not have a corresponding dual cell." << endl; } - + Info<< "Writing map from tetDualMesh points to Voronoi mesh to " << pointDualAddressing.objectPath() << endl; pointDualAddressing.write(); - - - + + + // Write tet points corresponding to the Voronoi cell/face centre // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { @@ -457,11 +457,11 @@ void Foam::conformalVoronoiMesh::writeMesh ), points ); - + forAll(pointDualAddressing, pointI) { label index = pointDualAddressing[pointI]; - + if (index > 0) { label cellI = index-1; @@ -476,7 +476,7 @@ void Foam::conformalVoronoiMesh::writeMesh } } } - + Info<< "Writing new tetDualMesh points mapped onto Voronoi mesh to " << dualPoints.objectPath() << endl << "Replace the polyMesh/points with these." << endl; diff --git a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C index 7a72591095..3549dc9560 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C +++ b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C @@ -27,9 +27,9 @@ Description - used to e.g. extrude baffles (extrude internal faces) or create liquid film regions. - if extruding internal faces: - - create baffles in original mesh with directMappedWall patches + - create baffles in original mesh with mappedWall patches - if extruding boundary faces: - - convert boundary faces to directMappedWall patches + - convert boundary faces to mappedWall patches - extrude edges of faceZone as a \_sidePatch - extrude edges inbetween different faceZones as a (nonuniformTransform)cyclic \_\ @@ -68,9 +68,9 @@ into the space of the neighbour: | | +-------------+ - BBB=directMapped between owner on original mesh and new extrusion. + BBB=mapped between owner on original mesh and new extrusion. (zero offset) - CCC=directMapped between neighbour on original mesh and new extrusion + CCC=mapped between neighbour on original mesh and new extrusion (offset due to the thickness of the extruded mesh) For the case of flipMap the extrusion is the other way around: from the @@ -98,7 +98,7 @@ becomes | | +-----------+ - BBB=directMapped between original mesh and new extrusion + BBB=mapped between original mesh and new extrusion CCC=polypatch @@ -126,7 +126,7 @@ Usage #include "patchPointEdgeCirculator.H" #include "OFstream.H" #include "meshTools.H" -#include "directMappedWallPolyPatch.H" +#include "mappedWallPolyPatch.H" #include "createShellMesh.H" #include "volFields.H" #include "surfaceFields.H" @@ -920,13 +920,12 @@ tmp calcOffset int main(int argc, char *argv[]) { argList::noParallel(); - argList::addNote - ( - "Create region mesh by extruding a faceZone" - ); + argList::addNote("Create region mesh by extruding a faceZone"); #include "addRegionOption.H" #include "addOverwriteOption.H" + argList::addBoolOption("AMI", "apply mapped AMI boundary type"); + #include "setRootCase.H" #include "createTime.H" #include "createNamedMesh.H" @@ -934,6 +933,12 @@ int main(int argc, char *argv[]) const word oldInstance = mesh.pointsInstance(); bool overwrite = args.optionFound("overwrite"); + mappedPatchBase::sampleMode sampleMode = mappedPatchBase::NEARESTPATCHFACE; + if (args.optionFound("AMI")) + { + sampleMode = mappedPatchBase::NEARESTPATCHFACEAMI; + } + IOdictionary dict ( IOobject @@ -1122,7 +1127,7 @@ int main(int argc, char *argv[]) // Check whether the zone is internal or external faces to determine // what patch type to insert. Cannot be mixed - // since then how to couple? - directMapped only valid for a whole patch. + // since then how to couple? - mapped only valid for a whole patch. boolList isInternal(zoneIDs.size(), false); forAll(zoneIDs, i) { @@ -1174,7 +1179,7 @@ int main(int argc, char *argv[]) if (isInternal[i]) { - interRegionTopPatch[i] = addPatch + interRegionTopPatch[i] = addPatch ( mesh, interName + "_top" @@ -1185,7 +1190,7 @@ int main(int argc, char *argv[]) << '\t' << patches[interRegionTopPatch[i]].type() << nl; - interRegionBottomPatch[i] = addPatch + interRegionBottomPatch[i] = addPatch ( mesh, interName + "_bottom" @@ -1209,7 +1214,7 @@ int main(int argc, char *argv[]) << '\t' << patches[interRegionTopPatch[i]].type() << nl; - interRegionBottomPatch[i] = addPatch + interRegionBottomPatch[i] = addPatch ( mesh, interName @@ -1222,7 +1227,7 @@ int main(int argc, char *argv[]) } else if (zoneShadowNames.size() > 0) //patch using shadow face zones. { - interRegionTopPatch[i] = addPatch + interRegionTopPatch[i] = addPatch ( mesh, zoneShadowNames[i] + "_top" @@ -1233,7 +1238,7 @@ int main(int argc, char *argv[]) << '\t' << patches[interRegionTopPatch[i]].type() << nl; - interRegionBottomPatch[i] = addPatch + interRegionBottomPatch[i] = addPatch ( mesh, interName @@ -1661,7 +1666,7 @@ int main(int argc, char *argv[]) if ( - isA(pp) + isA(pp) && (findIndex(interRegionTopPatch, patchI) != -1) ) { @@ -1669,14 +1674,14 @@ int main(int argc, char *argv[]) topOffsets[index] = calcOffset(extrudePatch, extruder, pp); - newPatches[patchI] = new directMappedWallPolyPatch + newPatches[patchI] = new mappedWallPolyPatch ( pp.name(), pp.size(), pp.start(), patchI, regionName, // sampleRegion - directMappedPatchBase::NEARESTPATCHFACE,// sampleMode + sampleMode, // sampleMode pp.name(), // samplePatch topOffsets[index], // offset patches @@ -1684,7 +1689,7 @@ int main(int argc, char *argv[]) } else if ( - isA(pp) + isA(pp) && (findIndex(interRegionBottomPatch, patchI) != -1) ) { @@ -1692,14 +1697,14 @@ int main(int argc, char *argv[]) bottomOffsets[index] = calcOffset(extrudePatch, extruder, pp); - newPatches[patchI] = new directMappedWallPolyPatch + newPatches[patchI] = new mappedWallPolyPatch ( pp.name(), pp.size(), pp.start(), patchI, regionName, // sampleRegion - directMappedPatchBase::NEARESTPATCHFACE,// sampleMode + sampleMode, // sampleMode pp.name(), // samplePatch bottomOffsets[index], // offset patches @@ -1985,19 +1990,19 @@ int main(int argc, char *argv[]) if ( - isA(pp) + isA(pp) && (findIndex(interRegionTopPatch, patchI) != -1) ) { label index = findIndex(interRegionTopPatch, patchI); - newPatches[patchI] = new directMappedWallPolyPatch + newPatches[patchI] = new mappedWallPolyPatch ( pp.name(), pp.size(), pp.start(), patchI, shellRegionName, // sampleRegion - directMappedPatchBase::NEARESTPATCHFACE,// sampleMode + sampleMode, // sampleMode pp.name(), // samplePatch -topOffsets[index], // offset patches @@ -2005,20 +2010,20 @@ int main(int argc, char *argv[]) } else if ( - isA(pp) + isA(pp) && (findIndex(interRegionBottomPatch, patchI) != -1) ) { label index = findIndex(interRegionBottomPatch, patchI); - newPatches[patchI] = new directMappedWallPolyPatch + newPatches[patchI] = new mappedWallPolyPatch ( pp.name(), pp.size(), pp.start(), patchI, shellRegionName, // sampleRegion - directMappedPatchBase::NEARESTPATCHFACE,// sampleMode + sampleMode, // sampleMode pp.name(), // samplePatch -bottomOffsets[index], // offset patches diff --git a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMeshDict b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMeshDict index 6f65c1cff1..7aa652fb79 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMeshDict +++ b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMeshDict @@ -23,13 +23,13 @@ faceZones (f0); // FaceZone shadow //faceZonesShadow (fBaffleShadow); -// Adapt the original mesh to have directMapped patches at where the +// Adapt the original mesh to have mapped patches at where the // faceZones are? // If true: -// - extruding internal faces: become baffles on directMapped patches -// - extruding boundary faces: repatched to be on directMapped patches +// - extruding internal faces: become baffles on mapped patches +// - extruding boundary faces: repatched to be on mapped patches // If false: leave original mesh intact. Extruded mesh will still have -// directMapped patch which might need to be adapted. +// mapped patch which might need to be adapted. adaptMesh true; // Extrude 1D-columns of cells? diff --git a/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C b/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C index ebd3a6cb47..5ce408d305 100644 --- a/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C +++ b/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C @@ -36,7 +36,7 @@ Description Output is: - volScalarField with regions as different scalars (-detectOnly) or - - mesh with multiple regions and directMapped patches. These patches + - mesh with multiple regions and mapped patches. These patches either cover the whole interface between two region (default) or only part according to faceZones (-useFaceZones) or @@ -57,7 +57,7 @@ Description - Should work in parallel. cellZones can differ on either side of processor boundaries in which case - the faces get moved from processor patch to directMapped patch. Not + the faces get moved from processor patch to mapped patch. Not very well tested. - If a cell zone gets split into more than one region it can detect @@ -94,7 +94,7 @@ Description #include "EdgeMap.H" #include "syncTools.H" #include "ReadFields.H" -#include "directMappedWallPolyPatch.H" +#include "mappedWallPolyPatch.H" #include "zeroGradientFvPatchFields.H" using namespace Foam; @@ -687,7 +687,7 @@ void getInterfaceSizes } } - // Rework + // Rework Pstream::scatter(regionsToSize); @@ -1260,14 +1260,14 @@ labelList addRegionPatches // << " trying to add patches " << names << endl; - directMappedWallPolyPatch patch1 + mappedWallPolyPatch patch1 ( names[0], 0, // overridden 0, // overridden 0, // overridden regionNames[e[1]], // sampleRegion - directMappedPatchBase::NEARESTPATCHFACE, + mappedPatchBase::NEARESTPATCHFACE, names[1], // samplePatch point::zero, // offset mesh.boundaryMesh() @@ -1275,14 +1275,14 @@ labelList addRegionPatches interfacePatches[interI] = addPatch(mesh, patch1); - directMappedWallPolyPatch patch2 + mappedWallPolyPatch patch2 ( names[1], 0, 0, 0, regionNames[e[0]], // sampleRegion - directMappedPatchBase::NEARESTPATCHFACE, + mappedPatchBase::NEARESTPATCHFACE, names[0], point::zero, // offset mesh.boundaryMesh() diff --git a/applications/utilities/parallelProcessing/decomposePar/decomposeParDict b/applications/utilities/parallelProcessing/decomposePar/decomposeParDict index e60757fffd..c5b5c45135 100644 --- a/applications/utilities/parallelProcessing/decomposePar/decomposeParDict +++ b/applications/utilities/parallelProcessing/decomposePar/decomposeParDict @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -numberOfSubdomains 8; +numberOfSubdomains 2; //- Keep owner and neighbour on same processor for faces in zones: // preserveFaceZones (heater solid1 solid3); @@ -24,13 +24,22 @@ numberOfSubdomains 8; // (makes sense only for cyclic patches) //preservePatches (cyclic_half0 cyclic_half1); +//- Keep all of faceZone on a single processor. This puts all cells +// connected with a point, edge or face on the same processor. +// (just having face connected cells might not guarantee a balanced +// decomposition) +// The processor can be -1 (the decompositionMethod chooses the processor +// for a good load balance) or explicitly provided (upsets balance). +//singleProcessorFaceZones ((f0 -1)); + + //- Use the volScalarField named here as a weight for each cell in the // decomposition. For example, use a particle population field to decompose // for a balanced number of particles in a lagrangian simulation. // weightField dsmcRhoNMean; method scotch; -// method hierarchical; +//method hierarchical; // method simple; // method metis; // method manual; @@ -70,7 +79,7 @@ simpleCoeffs hierarchicalCoeffs { - n (2 2 1); + n (1 2 1); delta 0.001; order xyz; } diff --git a/applications/utilities/parallelProcessing/decomposePar/domainDecompositionDistribute.C b/applications/utilities/parallelProcessing/decomposePar/domainDecompositionDistribute.C index 4ee3c7555e..726f907137 100644 --- a/applications/utilities/parallelProcessing/decomposePar/domainDecompositionDistribute.C +++ b/applications/utilities/parallelProcessing/decomposePar/domainDecompositionDistribute.C @@ -28,6 +28,7 @@ License #include "cpuTime.H" #include "cellSet.H" #include "regionSplit.H" +#include "Tuple2.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -47,7 +48,8 @@ void Foam::domainDecomposition::distributeCells() { wordList pNames(decompositionDict_.lookup("preservePatches")); - Info<< "Keeping owner of faces in patches " << pNames + Info<< nl + << "Keeping owner of faces in patches " << pNames << " on same processor. This only makes sense for cyclics." << endl; const polyBoundaryMesh& patches = boundaryMesh(); @@ -76,7 +78,8 @@ void Foam::domainDecomposition::distributeCells() { wordList zNames(decompositionDict_.lookup("preserveFaceZones")); - Info<< "Keeping owner and neighbour of faces in zones " << zNames + Info<< nl + << "Keeping owner and neighbour of faces in zones " << zNames << " on same processor" << endl; const faceZoneMesh& fZones = faceZones(); @@ -103,6 +106,65 @@ void Foam::domainDecomposition::distributeCells() } + // Specified processor for owner and neighbour of faces + Map