diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/UEqns.H b/applications/solvers/multiphase/twoPhaseEulerFoam/UEqns.H index fad73cfeb8..7cddcb8004 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/UEqns.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/UEqns.H @@ -8,30 +8,36 @@ fvVectorMatrix U2Eqn(U2, U2.dimensions()*dimVol/dimTime); volScalarField dragCoeff(fluid.dragCoeff()); { - volVectorField liftForce(fluid.liftForce(U)); + volScalarField virtualMassCoeff(fluid.virtualMassCoeff()); + + volVectorField liftForce(fluid.liftForce()); + volVectorField wallLubricationForce(fluid.wallLubricationForce()); + volVectorField turbulentDispersionForce(fluid.turbulentDispersionForce()); { U1Eqn = ( fvm::ddt(alpha1, U1) + fvm::div(alphaPhi1, U1) - - // Compressibity correction - fvm::Sp(fvc::ddt(alpha1) + fvc::div(alphaPhi1), U1) - - + fluid.Cvm()*rho2*alpha1*alpha2/rho1* - ( - fvm::ddt(U1) - + fvm::div(phi1, U1) - - fvm::Sp(fvc::div(phi1), U1) - ) - + phase1.turbulence().divDevReff(U1) == - fvm::Sp(dragCoeff/rho1, U1) - - alpha1*alpha2/rho1*(liftForce - fluid.Cvm()*rho2*DDtU2) + - alpha1*alpha2/rho1 + *( + liftForce + + wallLubricationForce + + turbulentDispersionForce + ) + - virtualMassCoeff/rho1 + *( + fvm::ddt(U1) + + fvm::div(phi1, U1) + - fvm::Sp(fvc::div(phi1), U1) + - DDtU2 + ) ); - mrfZones.addCoriolis(alpha1*(1 + fluid.Cvm()*rho2*alpha2/rho1), U1Eqn); + mrfZones.addCoriolis(alpha1 + virtualMassCoeff/rho1, U1Eqn); U1Eqn.relax(); } @@ -40,22 +46,25 @@ volScalarField dragCoeff(fluid.dragCoeff()); ( fvm::ddt(alpha2, U2) + fvm::div(alphaPhi2, U2) - - // Compressibity correction - fvm::Sp(fvc::ddt(alpha2) + fvc::div(alphaPhi2), U2) - - + fluid.Cvm()*rho2*alpha1*alpha2/rho2* - ( - fvm::ddt(U2) - + fvm::div(phi2, U2) - - fvm::Sp(fvc::div(phi2), U2) - ) + phase2.turbulence().divDevReff(U2) == - fvm::Sp(dragCoeff/rho2, U2) - + alpha1*alpha2/rho2*(liftForce + fluid.Cvm()*rho2*DDtU1) + + alpha1*alpha2/rho2 + *( + liftForce + + wallLubricationForce + + turbulentDispersionForce + ) + - virtualMassCoeff/rho2 + *( + fvm::ddt(U2) + + fvm::div(phi2, U2) + - fvm::Sp(fvc::div(phi2), U2) + - DDtU1 + ) ); - mrfZones.addCoriolis(alpha2*(1 + fluid.Cvm()*rho2*alpha1/rho2), U2Eqn); + mrfZones.addCoriolis(alpha2 + virtualMassCoeff/rho2, U2Eqn); U2Eqn.relax(); } } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/createFields.H b/applications/solvers/multiphase/twoPhaseEulerFoam/createFields.H index a382b769b5..bee6645407 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/createFields.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/createFields.H @@ -1,6 +1,6 @@ Info<< "Creating twoPhaseSystem\n" << endl; - twoPhaseSystem fluid(mesh); + twoPhaseSystem fluid(mesh, g); phaseModel& phase1 = fluid.phase1(); phaseModel& phase2 = fluid.phase2(); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/Make/files b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/Make/files index a8f1b61119..4457f8ea02 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/Make/files +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/Make/files @@ -1,20 +1,53 @@ dragModels/dragModel/dragModel.C dragModels/dragModel/newDragModel.C +dragModels/noDrag/noDrag.C +dragModels/segregated/segregated.C dragModels/Ergun/Ergun.C +dragModels/Gibilaro/Gibilaro.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/TomiyamaCorrelated/TomiyamaCorrelated.C +dragModels/TomiyamaAnalytic/TomiyamaAnalytic.C +dragModels/WenYu/WenYu.C -heatTransferModels/heatTransferModel/heatTransferModel.C -heatTransferModels/heatTransferModel/newHeatTransferModel.C -heatTransferModels/RanzMarshall/RanzMarshall.C +swarmCorrections/swarmCorrection/swarmCorrection.C +swarmCorrections/swarmCorrection/newSwarmCorrection.C +swarmCorrections/noSwarm/noSwarm.C +swarmCorrections/TomiyamaSwarm/TomiyamaSwarm.C liftModels/liftModel/liftModel.C liftModels/liftModel/newLiftModel.C liftModels/noLift/noLift.C -liftModels/constantCoefficient/constantCoefficient.C +liftModels/constantLiftCoefficient/constantLiftCoefficient.C +liftModels/TomiyamaLift/TomiyamaLift.C + +heatTransferModels/heatTransferModel/heatTransferModel.C +heatTransferModels/heatTransferModel/newHeatTransferModel.C +heatTransferModels/noHeatTransfer/noHeatTransfer.C +heatTransferModels/RanzMarshall/RanzMarshall.C + +virtualMassModels/virtualMassModel/virtualMassModel.C +virtualMassModels/virtualMassModel/newVirtualMassModel.C +virtualMassModels/noVirtualMass/noVirtualMass.C +virtualMassModels/constantVirtualMassCoefficient/constantVirtualMassCoefficient.C +virtualMassModels/Lamb/Lamb.C + +wallLubricationModels/wallLubricationModel/wallLubricationModel.C +wallLubricationModels/wallLubricationModel/newWallLubricationModel.C +wallLubricationModels/noWallLubrication/noWallLubrication.C +wallLubricationModels/Antal/Antal.C + +turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.C +turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C +turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.C +turbulentDispersionModels/constantTurbulentDispersionCoefficient/constantTurbulentDispersionCoefficient.C +turbulentDispersionModels/Gosman/Gosman.C + +aspectRatioModels/aspectRatioModel/aspectRatioModel.C +aspectRatioModels/aspectRatioModel/newAspectRatioModel.C +aspectRatioModels/constantAspectRatio/constantAspectRatio.C +aspectRatioModels/VakhrushevEfremov/VakhrushevEfremov.C LIB = $(FOAM_LIBBIN)/libcompressibleEulerianInterfacialModels diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/Make/options b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/Make/options index e7e60696ec..95c5844e38 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/Make/options +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/Make/options @@ -1,7 +1,10 @@ EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/transportModels/incompressible/transportModel \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/phaseIncompressible/lnInclude \ -I../twoPhaseSystem/lnInclude LIB_LIBS = \ diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/VakhrushevEfremov/VakhrushevEfremov.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/VakhrushevEfremov/VakhrushevEfremov.C new file mode 100644 index 0000000000..4d9c14d6fb --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/VakhrushevEfremov/VakhrushevEfremov.C @@ -0,0 +1,80 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "VakhrushevEfremov.H" +#include "orderedPhasePair.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace aspectRatioModels +{ + defineTypeNameAndDebug(VakhrushevEfremov, 0); + addToRunTimeSelectionTable + ( + aspectRatioModel, + VakhrushevEfremov, + dictionary + ); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::aspectRatioModels::VakhrushevEfremov::VakhrushevEfremov +( + const dictionary& dict, + const orderedPhasePair& pair +) +: + aspectRatioModel(dict, pair) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::aspectRatioModels::VakhrushevEfremov::~VakhrushevEfremov() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +Foam::tmp +Foam::aspectRatioModels::VakhrushevEfremov::E() const +{ + volScalarField Ta(pair_.Ta()); + + return + neg(Ta - scalar(1))*scalar(1) + + pos(Ta - scalar(1))*neg(Ta - scalar(39.8)) + *pow3(0.81 + 0.206*tanh(1.6 - 2*log10(max(Ta, scalar(1))))) + + pos(Ta - scalar(39.8))*0.24; +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/VakhrushevEfremov/VakhrushevEfremov.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/VakhrushevEfremov/VakhrushevEfremov.H new file mode 100644 index 0000000000..f32ee31990 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/VakhrushevEfremov/VakhrushevEfremov.H @@ -0,0 +1,100 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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::VakhrushevEfremov + +Description + Aspect ratio model of Vakhrushev and Efremov. + + Reference: + \verbatim + "Interpolation formula for computing the velocities of single gas + bubbles in liquids" + I A Vakhrushev and G I Efremov + Chemistry and Technology of Fuels and Oils + Volume 6, Issue 5, Pages 376-379, May 1970 + \endverbatim + +SourceFiles + VakhrushevEfremov.C + +\*---------------------------------------------------------------------------*/ + +#ifndef VakhrushevEfremov_H +#define VakhrushevEfremov_H + +#include "aspectRatioModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace aspectRatioModels +{ + +/*---------------------------------------------------------------------------*\ + Class VakhrushevEfremov Declaration +\*---------------------------------------------------------------------------*/ + +class VakhrushevEfremov +: + public aspectRatioModel +{ +public: + + //- Runtime type information + TypeName("VakhrushevEfremov"); + + + // Constructors + + //- Construct from a dictionary and an ordered phase pair + VakhrushevEfremov + ( + const dictionary& dict, + const orderedPhasePair& pair + ); + + + //- Destructor + virtual ~VakhrushevEfremov(); + + + // Member Functions + + //- Aspect ratio + virtual tmp E() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace aspectRatioModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModel.C new file mode 100644 index 0000000000..dc55e27868 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModel.C @@ -0,0 +1,56 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "aspectRatioModel.H" +#include "orderedPhasePair.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(aspectRatioModel, 0); + defineRunTimeSelectionTable(aspectRatioModel, dictionary); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::aspectRatioModel::aspectRatioModel +( + const dictionary& dict, + const orderedPhasePair& pair +) +: + pair_(pair) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::aspectRatioModel::~aspectRatioModel() +{} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModel.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModel.H new file mode 100644 index 0000000000..7e5550307a --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModel.H @@ -0,0 +1,121 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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::aspectRatioModel + +Description + +SourceFiles + aspectRatioModel.C + newAspectRatioModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef aspectRatioModel_H +#define aspectRatioModel_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "volFields.H" +#include "dictionary.H" +#include "runTimeSelectionTables.H" + +namespace Foam +{ + +class orderedPhasePair; + +/*---------------------------------------------------------------------------*\ + Class aspectRatioModel Declaration +\*---------------------------------------------------------------------------*/ + +class aspectRatioModel +{ +protected: + + // Protected data + + //- Phase pair + const orderedPhasePair& pair_; + + +public: + + //- Runtime type information + TypeName("aspectRatioModel"); + + + // Declare runtime construction + declareRunTimeSelectionTable + ( + autoPtr, + aspectRatioModel, + dictionary, + ( + const dictionary& dict, + const orderedPhasePair& pair + ), + (dict, pair) + ); + + + // Constructors + + //- Construct from a dictionary and an ordered phase pair + aspectRatioModel + ( + const dictionary& dict, + const orderedPhasePair& pair + ); + + + //- Destructor + virtual ~aspectRatioModel(); + + + // Selectors + + static autoPtr New + ( + const dictionary& dict, + const orderedPhasePair& pair + ); + + + // Member Functions + + //- Aspect ratio + virtual tmp E() const = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C new file mode 100644 index 0000000000..cf65f1110f --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/newAspectRatioModel.C @@ -0,0 +1,60 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "aspectRatioModel.H" +#include "orderedPhasePair.H" + +// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // + +Foam::autoPtr +Foam::aspectRatioModel::New +( + const dictionary& dict, + const orderedPhasePair& pair +) +{ + word aspectRatioModelType(dict.lookup("type")); + + Info<< "Selecting aspectRatioModel for " + << pair << ": " << aspectRatioModelType << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(aspectRatioModelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorIn("aspectRatioModel::New") + << "Unknown aspectRatioModelType type " + << aspectRatioModelType << endl << endl + << "Valid aspectRatioModel types are : " << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return cstrIter()(dict, pair); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.C new file mode 100644 index 0000000000..c17b6dd068 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.C @@ -0,0 +1,91 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "constantAspectRatio.H" +#include "orderedPhasePair.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace aspectRatioModels +{ + defineTypeNameAndDebug(constantAspectRatio, 0); + addToRunTimeSelectionTable + ( + aspectRatioModel, + constantAspectRatio, + dictionary + ); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::aspectRatioModels::constantAspectRatio::constantAspectRatio +( + const dictionary& dict, + const orderedPhasePair& pair +) +: + aspectRatioModel(dict, pair), + E0_("E0", dimless, dict.lookup("E0")) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::aspectRatioModels::constantAspectRatio::~constantAspectRatio() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +Foam::tmp +Foam::aspectRatioModels::constantAspectRatio::E() const +{ + const fvMesh& mesh(this->pair_.phase1().mesh()); + + return + tmp + ( + new volScalarField + ( + IOobject + ( + "zero", + mesh.time().timeName(), + mesh + ), + mesh, + E0_ + ) + ); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.H new file mode 100644 index 0000000000..20bef21082 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.H @@ -0,0 +1,97 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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::constantAspectRatio + +Description + Constant value aspect ratio model. + +SourceFiles + constantAspectRatio.C + +\*---------------------------------------------------------------------------*/ + +#ifndef constantAspectRatio_H +#define constantAspectRatio_H + +#include "aspectRatioModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace aspectRatioModels +{ + +/*---------------------------------------------------------------------------*\ + Class constantAspectRatio Declaration +\*---------------------------------------------------------------------------*/ + +class constantAspectRatio +: + public aspectRatioModel +{ + // Private data + + //- Constant aspect ratio value + const dimensionedScalar E0_; + + +public: + + //- Runtime type information + TypeName("constant"); + + + // Constructors + + //- Construct from a dictionary and an ordered phase pair + constantAspectRatio + ( + const dictionary& dict, + const orderedPhasePair& pair + ); + + + //- Destructor + virtual ~constantAspectRatio(); + + + // Member Functions + + //- Aspect ratio + virtual tmp E() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace aspectRatioModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C index ced13ced8f..c4a23d3cf3 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,6 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "Ergun.H" +#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -33,13 +34,7 @@ namespace Foam namespace dragModels { defineTypeNameAndDebug(Ergun, 0); - - addToRunTimeSelectionTable - ( - dragModel, - Ergun, - dictionary - ); + addToRunTimeSelectionTable(dragModel, Ergun, dictionary); } } @@ -48,13 +43,11 @@ namespace dragModels Foam::dragModels::Ergun::Ergun ( - const dictionary& interfaceDict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const dictionary& dict, + const phasePair& pair ) : - dragModel(interfaceDict, alpha1, phase1, phase2) + dragModel(dict, pair) {} @@ -66,17 +59,21 @@ Foam::dragModels::Ergun::~Ergun() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::tmp Foam::dragModels::Ergun::K -( - const volScalarField& Ur -) const +Foam::tmp Foam::dragModels::Ergun::Cd() const { - volScalarField alpha2(max(scalar(1) - alpha1_, scalar(1.0e-6))); - return - 150.0*alpha1_*phase2_.nu()*phase2_.rho() - /sqr(alpha2*phase1_.d()) - + 1.75*phase2_.rho()*Ur/(alpha2*phase1_.d()); + (4/3) + *( + 150 + *max(pair_.dispersed(), residualAlpha_) + *pair_.continuous().nu() + /( + max(scalar(1) - pair_.dispersed(), residualAlpha_) + *pair_.dispersed().d() + *max(pair_.magUr(), residualSlip_) + ) + + 1.75 + ); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.H index 75d5de107a..91c8ded674 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -44,6 +44,9 @@ SourceFiles namespace Foam { + +class phasePair; + namespace dragModels { @@ -55,7 +58,6 @@ class Ergun : public dragModel { - public: //- Runtime type information @@ -64,13 +66,11 @@ public: // Constructors - //- Construct from components + //- Construct from a dictionary and a phase pair Ergun ( - const dictionary& interfaceDict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const dictionary& dict, + const phasePair& pair ); @@ -80,7 +80,8 @@ public: // Member Functions - tmp K(const volScalarField& Ur) const; + //- Drag coefficient + virtual tmp Cd() const; }; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C index 093b86d70a..a03258b356 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,6 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "Gibilaro.H" +#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -33,13 +34,7 @@ namespace Foam namespace dragModels { defineTypeNameAndDebug(Gibilaro, 0); - - addToRunTimeSelectionTable - ( - dragModel, - Gibilaro, - dictionary - ); + addToRunTimeSelectionTable(dragModel, Gibilaro, dictionary); } } @@ -48,13 +43,12 @@ namespace dragModels Foam::dragModels::Gibilaro::Gibilaro ( - const dictionary& interfaceDict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const dictionary& dict, + const phasePair& pair ) : - dragModel(interfaceDict, alpha1, phase1, phase2) + dragModel(dict, pair), + residualRe_("residualRe", dimless, dict.lookup("residualRe")) {} @@ -66,16 +60,15 @@ Foam::dragModels::Gibilaro::~Gibilaro() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::tmp Foam::dragModels::Gibilaro::K -( - const volScalarField& Ur -) const +Foam::tmp Foam::dragModels::Gibilaro::Cd() const { - volScalarField alpha2(max(scalar(1) - alpha1_, scalar(1.0e-6))); - volScalarField bp(pow(alpha2, -2.8)); - volScalarField Re(max(alpha2*Ur*phase1_.d()/phase2_.nu(), scalar(1.0e-3))); + volScalarField alpha2(max(scalar(1) - pair_.dispersed(), residualAlpha_)); - return (17.3/Re + scalar(0.336))*phase2_.rho()*Ur*bp/phase1_.d(); + return + (4/3) + *(17.3/(alpha2*max(pair_.Re(), residualRe_)) + scalar(0.336)) + *max(pair_.continuous(), residualAlpha_) + *pow(alpha2, -2.8); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.H index 2a922c86d9..ef63e826a3 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -44,6 +44,9 @@ SourceFiles namespace Foam { + +class phasePair; + namespace dragModels { @@ -55,6 +58,13 @@ class Gibilaro : public dragModel { +private: + + // Private data + + //- Residual Reynolds number + const dimensionedScalar residualRe_; + public: @@ -64,13 +74,11 @@ public: // Constructors - //- Construct from components + //- Construct from a dictionary and a phase pair Gibilaro ( - const dictionary& interfaceDict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const dictionary& dict, + const phasePair& pair ); @@ -80,7 +88,8 @@ public: // Member Functions - tmp K(const volScalarField& Ur) const; + //- Drag coefficient + virtual tmp Cd() const; }; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C index deb949de21..8ef3232226 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,6 +24,9 @@ License \*---------------------------------------------------------------------------*/ #include "GidaspowErgunWenYu.H" +#include "phasePair.H" +#include "Ergun.H" +#include "WenYu.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -33,13 +36,7 @@ namespace Foam namespace dragModels { defineTypeNameAndDebug(GidaspowErgunWenYu, 0); - - addToRunTimeSelectionTable - ( - dragModel, - GidaspowErgunWenYu, - dictionary - ); + addToRunTimeSelectionTable(dragModel, GidaspowErgunWenYu, dictionary); } } @@ -48,13 +45,28 @@ namespace dragModels Foam::dragModels::GidaspowErgunWenYu::GidaspowErgunWenYu ( - const dictionary& interfaceDict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const dictionary& dict, + const phasePair& pair ) : - dragModel(interfaceDict, alpha1, phase1, phase2) + dragModel(dict, pair), + Ergun_ + ( + new Ergun + ( + dict, + pair + ) + ), + WenYu_ + ( + new WenYu + ( + dict, + pair + ) + ), + residualRe_("residualRe", dimless, dict.lookup("residualRe")) {} @@ -66,33 +78,12 @@ Foam::dragModels::GidaspowErgunWenYu::~GidaspowErgunWenYu() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::tmp Foam::dragModels::GidaspowErgunWenYu::K -( - const volScalarField& Ur -) const +Foam::tmp +Foam::dragModels::GidaspowErgunWenYu::Cd() const { - volScalarField alpha2(max(scalar(1) - alpha1_, scalar(1.0e-6))); - volScalarField d(phase1_.d()); - volScalarField bp(pow(alpha2, -2.65)); - volScalarField Re(max(Ur*d/phase2_.nu(), scalar(1.0e-3))); - - volScalarField Cds - ( - neg(Re - 1000)*(24.0*(1.0 + 0.15*pow(Re, 0.687))/Re) - + pos(Re - 1000)*0.44 - ); - - // Wen and Yu (1966) return - ( - pos(alpha2 - 0.8) - *(0.75*Cds*phase2_.rho()*Ur*bp/d) - + neg(alpha2 - 0.8) - *( - 150.0*alpha1_*phase2_.nu()*phase2_.rho()/(sqr(alpha2*d)) - + 1.75*phase2_.rho()*Ur/(alpha2*d) - ) - ); + pos(pair_.continuous() - 0.8)*WenYu_->Cd() + + neg(pair_.continuous() - 0.8)*Ergun_->Cd(); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.H index 9c2a25ac0a..f796977c16 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -42,9 +42,15 @@ SourceFiles namespace Foam { + +class phasePair; + namespace dragModels { +class Ergun; +class WenYu; + /*---------------------------------------------------------------------------*\ Class GidaspowErgunWenYu Declaration \*---------------------------------------------------------------------------*/ @@ -53,6 +59,19 @@ class GidaspowErgunWenYu : public dragModel { +private: + + // Private data + + //- Ergun drag model + autoPtr Ergun_; + + //- Wen Yu drag model + autoPtr WenYu_; + + //- Residual Reynolds number + const dimensionedScalar residualRe_; + public: @@ -62,13 +81,11 @@ public: // Constructors - //- Construct from components + //- Construct from a dictionary and an ordered phase pair GidaspowErgunWenYu ( const dictionary& interfaceDict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const phasePair& pair ); @@ -78,7 +95,8 @@ public: // Member Functions - tmp K(const volScalarField& Ur) const; + //- Drag coefficient + virtual tmp Cd() const; }; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C index c6ebe66092..3e389a7a6b 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,6 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "GidaspowSchillerNaumann.H" +#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -33,13 +34,7 @@ namespace Foam namespace dragModels { defineTypeNameAndDebug(GidaspowSchillerNaumann, 0); - - addToRunTimeSelectionTable - ( - dragModel, - GidaspowSchillerNaumann, - dictionary - ); + addToRunTimeSelectionTable(dragModel, GidaspowSchillerNaumann, dictionary); } } @@ -48,13 +43,12 @@ namespace dragModels Foam::dragModels::GidaspowSchillerNaumann::GidaspowSchillerNaumann ( - const dictionary& interfaceDict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const dictionary& dict, + const phasePair& pair ) : - dragModel(interfaceDict, alpha1, phase1, phase2) + dragModel(dict, pair), + residualRe_("residualRe", dimless, dict.lookup("residualRe")) {} @@ -66,22 +60,21 @@ Foam::dragModels::GidaspowSchillerNaumann::~GidaspowSchillerNaumann() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::tmp Foam::dragModels::GidaspowSchillerNaumann::K -( - const volScalarField& Ur -) const +Foam::tmp +Foam::dragModels::GidaspowSchillerNaumann::Cd() const { - volScalarField alpha2(max(scalar(1) - alpha1_, scalar(1e-6))); - volScalarField bp(pow(alpha2, -2.65)); - - volScalarField Re(max(alpha2*Ur*phase1_.d()/phase2_.nu(), scalar(1.0e-3))); + volScalarField alpha2(max(scalar(1) - pair_.dispersed(), residualAlpha_)); + volScalarField Re(max(alpha2*pair_.Re(), residualRe_)); volScalarField Cds ( neg(Re - 1000)*(24.0*(1.0 + 0.15*pow(Re, 0.687))/Re) + pos(Re - 1000)*0.44 ); - return 0.75*Cds*phase2_.rho()*Ur*bp/phase1_.d(); + return + Cds + *pow(alpha2, -2.65) + *max(pair_.continuous(), residualAlpha_); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.H index dcc07aec6c..9277781bc3 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -51,6 +51,9 @@ SourceFiles namespace Foam { + +class phasePair; + namespace dragModels { @@ -62,6 +65,13 @@ class GidaspowSchillerNaumann : public dragModel { +private: + + // Private data + + //- Residual Reynolds number + const dimensionedScalar residualRe_; + public: @@ -71,13 +81,11 @@ public: // Constructors - //- Construct from components + //- Construct from a dictionary and a phase pair GidaspowSchillerNaumann ( - const dictionary& interfaceDict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const dictionary& dict, + const phasePair& pair ); @@ -87,7 +95,8 @@ public: // Member Functions - tmp K(const volScalarField& Ur) const; + //- Drag coefficient + virtual tmp Cd() const; }; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.C index 4ab62e14a7..7cfc98d298 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,6 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "SchillerNaumann.H" +#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -33,13 +34,7 @@ namespace Foam namespace dragModels { defineTypeNameAndDebug(SchillerNaumann, 0); - - addToRunTimeSelectionTable - ( - dragModel, - SchillerNaumann, - dictionary - ); + addToRunTimeSelectionTable(dragModel, SchillerNaumann, dictionary); } } @@ -48,13 +43,12 @@ namespace dragModels Foam::dragModels::SchillerNaumann::SchillerNaumann ( - const dictionary& interfaceDict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const dictionary& dict, + const phasePair& pair ) : - dragModel(interfaceDict, alpha1, phase1, phase2) + dragModel(dict, pair), + residualRe_("residualRe", dimless, dict.lookup("residualRe")) {} @@ -66,19 +60,13 @@ Foam::dragModels::SchillerNaumann::~SchillerNaumann() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::tmp Foam::dragModels::SchillerNaumann::K -( - const volScalarField& Ur -) const +Foam::tmp Foam::dragModels::SchillerNaumann::Cd() const { - volScalarField Re(max(Ur*phase1_.d()/phase2_.nu(), scalar(1.0e-3))); - volScalarField Cds - ( - neg(Re - 1000)*(24.0*(1.0 + 0.15*pow(Re, 0.687))/Re) - + pos(Re - 1000)*0.44 - ); + volScalarField Re(pair_.Re() + residualRe_); - return 0.75*Cds*phase2_.rho()*Ur/phase1_.d(); + return + neg(Re - 1000)*(24.0*(1.0 + 0.15*pow(Re, 0.687))/Re) + + pos(Re - 1000)*0.44; } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.H index 00aacd4469..72d0d2c1b7 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SchillerNaumann/SchillerNaumann.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -40,6 +40,9 @@ SourceFiles namespace Foam { + +class phasePair; + namespace dragModels { @@ -51,6 +54,13 @@ class SchillerNaumann : public dragModel { +private: + + // Private data + + //- Residual Reynolds number + const dimensionedScalar residualRe_; + public: @@ -60,13 +70,11 @@ public: // Constructors - //- Construct from components + //- Construct from a dictionary and a phase pair SchillerNaumann ( - const dictionary& interfaceDict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const dictionary& dict, + const phasePair& pair ); @@ -76,7 +84,8 @@ public: // Member Functions - tmp K(const volScalarField& Ur) const; + //- Drag coefficient + virtual tmp Cd() const; }; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.C index ff6abc1857..d2c0f800b1 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,6 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "SyamlalOBrien.H" +#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -33,13 +34,7 @@ namespace Foam namespace dragModels { defineTypeNameAndDebug(SyamlalOBrien, 0); - - addToRunTimeSelectionTable - ( - dragModel, - SyamlalOBrien, - dictionary - ); + addToRunTimeSelectionTable(dragModel, SyamlalOBrien, dictionary); } } @@ -48,13 +43,12 @@ namespace dragModels Foam::dragModels::SyamlalOBrien::SyamlalOBrien ( - const dictionary& interfaceDict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const dictionary& dict, + const phasePair& pair ) : - dragModel(interfaceDict, alpha1, phase1, phase2) + dragModel(dict, pair), + residualRe_("residualRe", dimless, dict.lookup("residualRe")) {} @@ -66,32 +60,30 @@ Foam::dragModels::SyamlalOBrien::~SyamlalOBrien() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::tmp Foam::dragModels::SyamlalOBrien::K -( - const volScalarField& Ur -) const +Foam::tmp Foam::dragModels::SyamlalOBrien::Cd() const { - volScalarField alpha2(max(scalar(1) - alpha1_, scalar(1.0e-6))); + volScalarField alpha2(max(scalar(1) - pair_.dispersed(), residualAlpha_)); + volScalarField magUr(max(pair_.magUr(), residualSlip_)); volScalarField A(pow(alpha2, 4.14)); volScalarField B ( neg(alpha2 - 0.85)*(0.8*pow(alpha2, 1.28)) + pos(alpha2 - 0.85)*(pow(alpha2, 2.65)) ); - - volScalarField Re(max(Ur*phase1_.d()/phase2_.nu(), scalar(1.0e-3))); - + volScalarField Re(max(pair_.Re(), residualRe_)); volScalarField Vr ( - 0.5* - ( + 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)); + return + Cds + *max(pair_.continuous(), residualAlpha_) + /sqr(Vr); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.H index 210b49d200..652013aae2 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/SyamlalOBrien/SyamlalOBrien.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,6 +43,9 @@ SourceFiles namespace Foam { + +class phasePair; + namespace dragModels { @@ -54,6 +57,13 @@ class SyamlalOBrien : public dragModel { +private: + + // Private data + + //- Residual Reynolds number + const dimensionedScalar residualRe_; + public: @@ -63,13 +73,11 @@ public: // Constructors - //- Construct from components + //- Construct from a dictionary and a phase pair SyamlalOBrien ( - const dictionary& interfaceDict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const dictionary& dict, + const phasePair& pair ); @@ -79,7 +87,8 @@ public: // Member Functions - tmp K(const volScalarField& Ur) const; + //- Drag coefficient + virtual tmp Cd() const; }; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/TomiyamaAnalytic/TomiyamaAnalytic.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/TomiyamaAnalytic/TomiyamaAnalytic.C new file mode 100644 index 0000000000..7770579a86 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/TomiyamaAnalytic/TomiyamaAnalytic.C @@ -0,0 +1,84 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "TomiyamaAnalytic.H" +#include "phasePair.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace dragModels +{ + defineTypeNameAndDebug(TomiyamaAnalytic, 0); + addToRunTimeSelectionTable(dragModel, TomiyamaAnalytic, dictionary); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::dragModels::TomiyamaAnalytic::TomiyamaAnalytic +( + const dictionary& dict, + const phasePair& pair +) +: + dragModel(dict, pair), + residualEo_("residualEo", dimless, dict.lookup("residualEo")), + residualE_("residualE", dimless, dict.lookup("residualE")) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::dragModels::TomiyamaAnalytic::~TomiyamaAnalytic() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp Foam::dragModels::TomiyamaAnalytic::Cd() const +{ + volScalarField Eo(max(pair_.Eo(), residualEo_)); + volScalarField E(max(pair_.E(), residualE_)); + + volScalarField OmEsq(max(scalar(1) - sqr(E), residualE_)); + volScalarField rtOmEsq(sqrt(OmEsq)); + + volScalarField F((asin(rtOmEsq) - E*rtOmEsq)/OmEsq); + + return + (8.0/3.0)*Eo + /( + Eo*pow(E, 2.0/3.0)/OmEsq + + 16*pow(E, 0.75) + ) + /sqr(F); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/TomiyamaAnalytic/TomiyamaAnalytic.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/TomiyamaAnalytic/TomiyamaAnalytic.H new file mode 100644 index 0000000000..7bb3a9c8c6 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/TomiyamaAnalytic/TomiyamaAnalytic.H @@ -0,0 +1,114 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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::TomiyamaAnalytic + +Description + Analytic drag model of Tomiyama et al. + + Reference: + \verbatim + "Drag Coefficients of Bubbles. 1st Report. Drag Coefficients of a + Single Bubble in a Stagnant Liquid." + A Tomiyama, I Kataoka, and T Sakaguchi + Nippon Kikai Gakkai Ronbunshu + Volume 61, Issue 587, Pages 2357-2364, 1995 + \endverbatim + +SourceFiles + TomiyamaAnalytic.C + +\*---------------------------------------------------------------------------*/ + +#ifndef TomiyamaAnalytic_H +#define TomiyamaAnalytic_H + +#include "dragModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class phasePair; + +namespace dragModels +{ + +/*---------------------------------------------------------------------------*\ + Class TomiyamaAnalytic Declaration +\*---------------------------------------------------------------------------*/ + +class TomiyamaAnalytic +: + public dragModel +{ +private: + + // Private data + + //- Residual Eotvos number + const dimensionedScalar residualEo_; + + //- Residual aspect ratio + const dimensionedScalar residualE_; + + +public: + + //- Runtime type information + TypeName("TomiyamaAnalytic"); + + + // Constructors + + //- Construct from a dictionary and a phase pair + TomiyamaAnalytic + ( + const dictionary& dict, + const phasePair& pair + ); + + + //- Destructor + virtual ~TomiyamaAnalytic(); + + + // Member Functions + + // Drag coefficient + virtual tmp Cd() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace dragModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/TomiyamaCorrelated/TomiyamaCorrelated.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/TomiyamaCorrelated/TomiyamaCorrelated.C new file mode 100644 index 0000000000..c7b0eecae6 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/TomiyamaCorrelated/TomiyamaCorrelated.C @@ -0,0 +1,85 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "TomiyamaCorrelated.H" +#include "phasePair.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace dragModels +{ + defineTypeNameAndDebug(TomiyamaCorrelated, 0); + addToRunTimeSelectionTable(dragModel, TomiyamaCorrelated, dictionary); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::dragModels::TomiyamaCorrelated::TomiyamaCorrelated +( + const dictionary& dict, + const phasePair& pair +) +: + dragModel(dict, pair), + residualRe_("residualRe", dimless, dict.lookup("residualRe")), + A_("A", dimless, dict.lookup("A")) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::dragModels::TomiyamaCorrelated::~TomiyamaCorrelated() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp +Foam::dragModels::TomiyamaCorrelated::Cd() const +{ + volScalarField Re(pair_.Re() + residualRe_); + volScalarField Eo(pair_.Eo()); + + return + max + ( + A_/Re + *min + ( + (1 + 0.15*pow(Re, 0.687)), + scalar(3) + ), + 8*Eo/(3*Eo + 12) + ); + +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/TomiyamaCorrelated/TomiyamaCorrelated.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/TomiyamaCorrelated/TomiyamaCorrelated.H new file mode 100644 index 0000000000..b2a8b8b006 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/TomiyamaCorrelated/TomiyamaCorrelated.H @@ -0,0 +1,114 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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::TomiyamaCorrelated + +Description + Correlation of Tomiyama et al. + + Reference: + \verbatim + "Terminal velocity of single bubbles in surface tension force dominant + regime" + A Tomiyama, G P Celata, S Hosokawa, S Yoshida + International Journal of Multiphase Flow + Volume 28, Issue 9, Pages 1497-1519, September 2002 + \endverbatim + +SourceFiles + TomiyamaCorrelated.C + +\*---------------------------------------------------------------------------*/ + +#ifndef TomiyamaCorrelated_H +#define TomiyamaCorrelated_H + +#include "dragModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class phasePair; + +namespace dragModels +{ + +/*---------------------------------------------------------------------------*\ + Class TomiyamaCorrelated Declaration +\*---------------------------------------------------------------------------*/ + +class TomiyamaCorrelated +: + public dragModel +{ +private: + + // Private data + + //- Residual Reynolds number + const dimensionedScalar residualRe_; + + //- Coefficient + const dimensionedScalar A_; + + +public: + + //- Runtime type information + TypeName("TomiyamaCorrelated"); + + + // Constructors + + //- Construct from a dictionary and a phase pair + TomiyamaCorrelated + ( + const dictionary& dict, + const phasePair& pair + ); + + + //- Destructor + virtual ~TomiyamaCorrelated(); + + + // Member Functions + + //- Drag coefficient + virtual tmp Cd() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace dragModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.C index b31aa21fb6..707ce62683 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,6 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "WenYu.H" +#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -33,13 +34,7 @@ namespace Foam namespace dragModels { defineTypeNameAndDebug(WenYu, 0); - - addToRunTimeSelectionTable - ( - dragModel, - WenYu, - dictionary - ); + addToRunTimeSelectionTable(dragModel, WenYu, dictionary); } } @@ -48,13 +43,12 @@ namespace dragModels Foam::dragModels::WenYu::WenYu ( - const dictionary& interfaceDict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const dictionary& dict, + const phasePair& pair ) : - dragModel(interfaceDict, alpha1, phase1, phase2) + dragModel(dict, pair), + residualRe_("residualRe", dimless, dict.lookup("residualRe")) {} @@ -66,22 +60,20 @@ Foam::dragModels::WenYu::~WenYu() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::tmp Foam::dragModels::WenYu::K -( - const volScalarField& Ur -) const +Foam::tmp Foam::dragModels::WenYu::Cd() const { - volScalarField alpha2(max(scalar(1) - alpha1_, scalar(1.0e-6))); - volScalarField bp(pow(alpha2, -2.65)); - - volScalarField Re(max(Ur*phase1_.d()/phase2_.nu(), scalar(1.0e-3))); + volScalarField alpha2(max(scalar(1) - pair_.dispersed(), residualAlpha_)); + volScalarField Re(max(pair_.Re(), residualRe_)); volScalarField Cds ( neg(Re - 1000)*(24.0*(1.0 + 0.15*pow(Re, 0.687))/Re) + pos(Re - 1000)*0.44 ); - return 0.75*Cds*phase2_.rho()*Ur*bp/phase1_.d(); + return + Cds + *pow(alpha2, -2.65) + *max(pair_.continuous(), residualAlpha_); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.H index 6d9affca9f..e471c38546 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/WenYu/WenYu.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -54,6 +54,9 @@ SourceFiles namespace Foam { + +class phasePair; + namespace dragModels { @@ -65,6 +68,13 @@ class WenYu : public dragModel { +private: + + // Private data + + //- Residual Reynolds number + const dimensionedScalar residualRe_; + public: @@ -74,13 +84,11 @@ public: // Constructors - //- Construct from components + //- Construct from a dictionary and a phase pair WenYu ( - const dictionary& interfaceDict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const dictionary& dict, + const phasePair& pair ); @@ -90,7 +98,8 @@ public: // Member Functions - tmp K(const volScalarField& Ur) const; + //- Drag coefficient + virtual tmp Cd() const; }; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/dragModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/dragModel.C index 0d2ed1c620..b76d90e390 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/dragModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/dragModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,6 +24,8 @@ License \*---------------------------------------------------------------------------*/ #include "dragModel.H" +#include "phasePair.H" +#include "swarmCorrection.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -33,21 +35,55 @@ namespace Foam defineRunTimeSelectionTable(dragModel, dictionary); } +const Foam::dimensionSet Foam::dragModel::dimK(1, -3, -1, 0, 0); + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::dragModel::dragModel ( - const dictionary& interfaceDict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const phasePair& pair ) : - interfaceDict_(interfaceDict), - alpha1_(alpha1), - phase1_(phase1), - phase2_(phase2) + regIOobject + ( + IOobject + ( + IOobject::groupName(typeName, pair.name()), + pair.phase1().mesh().time().timeName(), + pair.phase1().mesh() + ) + ), + pair_(pair) +{} + + +Foam::dragModel::dragModel +( + const dictionary& dict, + const phasePair& pair +) +: + regIOobject + ( + IOobject + ( + IOobject::groupName(typeName, pair.name()), + pair.phase1().mesh().time().timeName(), + pair.phase1().mesh() + ) + ), + pair_(pair), + swarmCorrection_ + ( + swarmCorrection::New + ( + dict.subDict("swarmCorrection"), + pair + ) + ), + residualAlpha_("residualAlpha", dimless, dict.lookup("residualAlpha")), + residualSlip_("residualSlip", dimVelocity, dict.lookup("residualSlip")) {} @@ -57,4 +93,27 @@ Foam::dragModel::~dragModel() {} +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp Foam::dragModel::K() const +{ + return + 0.75 + *Cd() + *swarmCorrection_->Cs() + *pair_.continuous().rho() + /( + max(pair_.continuous(), residualAlpha_) + *pair_.dispersed().d() + ) + *max(pair_.magUr(), residualSlip_); +} + + +bool Foam::dragModel::writeData(Ostream& os) const +{ + return os.good(); +} + + // ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/dragModel.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/dragModel.H index 6e47aedb4d..abaed5c530 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/dragModel.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/dragModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -37,27 +37,39 @@ SourceFiles // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "volFields.H" #include "dictionary.H" -#include "phaseModel.H" #include "runTimeSelectionTables.H" namespace Foam { +class phasePair; +class swarmCorrection; + /*---------------------------------------------------------------------------*\ Class dragModel Declaration \*---------------------------------------------------------------------------*/ class dragModel +: + public regIOobject { protected: // Protected data - const dictionary& interfaceDict_; - const volScalarField& alpha1_; - const phaseModel& phase1_; - const phaseModel& phase2_; + //- Phase pair + const phasePair& pair_; + + //- Swarm correction + autoPtr swarmCorrection_; + + //- Residual phase fraction + const dimensionedScalar residualAlpha_; + + //- Residual slip velocity + const dimensionedScalar residualSlip_; public: @@ -74,23 +86,32 @@ public: dragModel, dictionary, ( - const dictionary& interfaceDict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const dictionary& dict, + const phasePair& pair ), - (interfaceDict, alpha1, phase1, phase2) + (dict, pair) ); + // Static data members + + //- Coefficient dimensions + static const dimensionSet dimK; + + // Constructors + // Construct without residual constants dragModel ( - const dictionary& interfaceDict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const phasePair& pair + ); + + // Construct with residual constants + dragModel + ( + const dictionary& dict, + const phasePair& pair ); @@ -102,25 +123,28 @@ public: static autoPtr New ( - const dictionary& interfaceDict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const dictionary& dict, + const phasePair& pair ); // Member Functions - //- the dragfunction K used in the momentum eq. + //- Drag coefficient + virtual tmp Cd() const = 0; + + //- The drag function K used in the momentum equation // ddt(alpha1*rho1*U1) + ... = ... alpha1*alpha2*K*(U1-U2) - // ddt(alpha2*rho2*U2) + ... = ... alpha1*alpha2*K*(U2-U1) + // ddt(alpha2*rho2*U2) + ... = ... alpha1*alpha2*K*(U2-U1) // ********************************** NB! ***************************** - // for numerical reasons alpha1 and alpha2 has been - // extracted from the dragFunction K, - // so you MUST divide K by alpha1*alpha2 when implemnting the drag - // function + // for numerical reasons alpha1 and alpha2 has been extracted from the + // drag function K, so you MUST divide K by alpha1*alpha2 when + // implemnting the drag function // ********************************** NB! ***************************** - virtual tmp K(const volScalarField& Ur) const = 0; + virtual tmp K() const; + + //- Dummy write for regIOobject + bool writeData(Ostream& os) const; }; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C index 9f20a3c22d..b2c9657e4f 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,26 +24,20 @@ License \*---------------------------------------------------------------------------*/ #include "dragModel.H" +#include "phasePair.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // Foam::autoPtr Foam::dragModel::New ( - const dictionary& interfaceDict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const dictionary& dict, + const phasePair& pair ) { - word dragModelType - ( - interfaceDict.lookup(phase1.name()) - ); + word dragModelType(dict.lookup("type")); - Info << "Selecting dragModel for phase " - << phase1.name() - << ": " - << dragModelType << endl; + Info<< "Selecting dragModel for " + << pair << ": " << dragModelType << endl; dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(dragModelType); @@ -58,7 +52,7 @@ Foam::autoPtr Foam::dragModel::New << exit(FatalError); } - return cstrIter()(interfaceDict, alpha1, phase1, phase2); + return cstrIter()(dict, pair); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/noDrag/noDrag.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/noDrag/noDrag.C new file mode 100644 index 0000000000..f12e3bf972 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/noDrag/noDrag.C @@ -0,0 +1,90 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "noDrag.H" +#include "phasePair.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace dragModels +{ + defineTypeNameAndDebug(noDrag, 0); + addToRunTimeSelectionTable(dragModel, noDrag, dictionary); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::dragModels::noDrag::noDrag +( + const dictionary& dict, + const phasePair& pair +) +: + dragModel(pair) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::dragModels::noDrag::~noDrag() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp Foam::dragModels::noDrag::Cd() const +{ + const fvMesh& mesh(this->pair_.phase1().mesh()); + + return + tmp + ( + new volScalarField + ( + IOobject + ( + "Cd", + mesh.time().timeName(), + mesh + ), + mesh, + dimensionedScalar("Cd", dimless, 0) + ) + ); +} + + +Foam::tmp Foam::dragModels::noDrag::K() const +{ + return Cd()*dimensionedScalar("zero", dimensionSet(1, -3, -1, 0, 0), 0); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/noDrag/noDrag.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/noDrag/noDrag.H new file mode 100644 index 0000000000..356c08c438 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/noDrag/noDrag.H @@ -0,0 +1,96 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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::noDrag + +Description + +SourceFiles + noDrag.C + +\*---------------------------------------------------------------------------*/ + +#ifndef noDrag_H +#define noDrag_H + +#include "dragModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class phasePair; + +namespace dragModels +{ + +/*---------------------------------------------------------------------------*\ + Class noDrag Declaration +\*---------------------------------------------------------------------------*/ + +class noDrag +: + public dragModel +{ +public: + + //- Runtime type information + TypeName("none"); + + + // Constructors + + //- Construct from a dictionary and a phase pair + noDrag + ( + const dictionary& dict, + const phasePair& pair + ); + + + //- Destructor + virtual ~noDrag(); + + + // Member Functions + + //- Drag coefficient + virtual tmp Cd() const; + + //- The drag function used in the momentum equation + virtual tmp K() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace dragModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/segregated/segregated.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/segregated/segregated.C new file mode 100644 index 0000000000..47016fb5c0 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/segregated/segregated.C @@ -0,0 +1,158 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "segregated.H" +#include "phasePair.H" +#include "addToRunTimeSelectionTable.H" +#include "fvc.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace dragModels +{ + defineTypeNameAndDebug(segregated, 0); + addToRunTimeSelectionTable(dragModel, segregated, dictionary); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::dragModels::segregated::segregated +( + const dictionary& dict, + const phasePair& pair +) +: + dragModel(dict, pair), + residualRe_("residualRe", dimless, dict.lookup("residualRe")), + m_("m", dimless, dict.lookup("m")), + n_("n", dimless, dict.lookup("n")) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::dragModels::segregated::~segregated() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp Foam::dragModels::segregated::Cd() const +{ + FatalErrorIn("Foam::dragModels::segregated::Cd() const") + << "Not implemented." + << "Drag coefficient not defined for the segregated model." + << exit(FatalError); + + return pair_.phase1(); +} + + +Foam::tmp Foam::dragModels::segregated::K() const +{ + const fvMesh& mesh(pair_.phase1().mesh()); + + const volScalarField& alpha1(pair_.phase1()); + const volScalarField& alpha2(pair_.phase2()); + + const volScalarField& rho1(pair_.phase1().rho()); + const volScalarField& rho2(pair_.phase2().rho()); + + tmp tnu1(pair_.phase1().nu()); + tmp tnu2(pair_.phase2().nu()); + + const volScalarField& nu1(tnu1()); + const volScalarField& nu2(tnu2()); + + volScalarField L + ( + IOobject + ( + "L", + mesh.time().timeName(), + mesh + ), + mesh, + dimensionedScalar("L", dimLength, 0), + zeroGradientFvPatchField::typeName + ); + L.internalField() = cbrt(mesh.V()); + L.correctBoundaryConditions(); + + volScalarField I + ( + alpha1 + /max + ( + alpha1 + alpha2, + residualAlpha_ + ) + ); + volScalarField magGradI + ( + max + ( + mag(fvc::grad(I)), + residualAlpha_/L + ) + ); + + volScalarField muI + ( + rho1*nu1*rho2*nu2 + /(rho1*nu1 + rho2*nu2) + ); + volScalarField muAlphaI + ( + alpha1*rho1*nu1*alpha2*rho2*nu2 + /(alpha1*rho1*nu1 + alpha2*rho2*nu2) + ); + + volScalarField ReI + ( + max + ( + pair_.rho() + *pair_.magUr() + /( + magGradI + *max(alpha1*alpha2, sqr(residualAlpha_)) + *muI + ), + residualRe_ + ) + ); + + volScalarField lambda(m_*ReI + n_*muAlphaI/muI); + + return lambda*sqr(magGradI)*muI; +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/segregated/segregated.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/segregated/segregated.H new file mode 100644 index 0000000000..3e2925f87c --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/segregated/segregated.H @@ -0,0 +1,118 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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::segregated + +Description + Segregated drag model for use in regions with no obvious dispersed phase. + + Reference: + \verbatim + "Towards the Numerical Simulation of Multi-scale Two-phase Flows" + H Marschall + PhD Thesis, TU München, 2011 + \endverbatim + +SourceFiles + segregated.C + +\*---------------------------------------------------------------------------*/ + +#ifndef segregated_H +#define segregated_H + +#include "dragModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class phasePair; + +namespace dragModels +{ + +/*---------------------------------------------------------------------------*\ + Class segregated Declaration +\*---------------------------------------------------------------------------*/ + +class segregated +: + public dragModel +{ +private: + + // Private data + + //- Residual reynolds number + const dimensionedScalar residualRe_; + + //- M coefficient + const dimensionedScalar m_; + + //- N coefficient + const dimensionedScalar n_; + + +public: + + //- Runtime type information + TypeName("segregated"); + + + // Constructors + + //- Construct from components + segregated + ( + const dictionary& dict, + const phasePair& pair + ); + + + //- Destructor + virtual ~segregated(); + + + // Member Functions + + //- Drag coefficient + virtual tmp Cd() const; + + //- The drag function used in the momentum equation + virtual tmp K() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace dragModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.C index 95ade6ba05..019926b34b 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,6 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "RanzMarshall.H" +#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -33,13 +34,7 @@ namespace Foam namespace heatTransferModels { defineTypeNameAndDebug(RanzMarshall, 0); - - addToRunTimeSelectionTable - ( - heatTransferModel, - RanzMarshall, - dictionary - ); + addToRunTimeSelectionTable(heatTransferModel, RanzMarshall, dictionary); } } @@ -48,13 +43,12 @@ namespace heatTransferModels Foam::heatTransferModels::RanzMarshall::RanzMarshall ( - const dictionary& interfaceDict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const dictionary& dict, + const phasePair& pair ) : - heatTransferModel(interfaceDict, alpha1, phase1, phase2) + heatTransferModel(dict, pair), + residualRe_("residualRe", dimless, dict.lookup("residualRe")) {} @@ -66,16 +60,13 @@ Foam::heatTransferModels::RanzMarshall::~RanzMarshall() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::tmp Foam::heatTransferModels::RanzMarshall::K -( - const volScalarField& Ur -) const +Foam::tmp +Foam::heatTransferModels::RanzMarshall::K() const { - volScalarField Re(max(Ur*phase1_.d()/phase2_.nu(), scalar(1.0e-3))); - volScalarField Prb(phase2_.rho()*phase2_.nu()*phase2_.Cp()/phase2_.kappa()); - volScalarField Nu(scalar(2) + 0.6*sqrt(Re)*cbrt(Prb)); + volScalarField Re(pair_.Re() + residualRe_); + volScalarField Nu(scalar(2) + 0.6*sqrt(Re)*cbrt(pair_.Pr())); - return 6.0*phase2_.kappa()*Nu/sqr(phase1_.d()); + return 6.0*pair_.continuous().kappa()*Nu/sqr(pair_.dispersed().d()); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.H index 8bcad969a8..0188d2e210 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/RanzMarshall/RanzMarshall.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -40,6 +40,9 @@ SourceFiles namespace Foam { + +class phasePair; + namespace heatTransferModels { @@ -51,6 +54,13 @@ class RanzMarshall : public heatTransferModel { +private: + + // Private data + + //- Residual Reynolds number + const dimensionedScalar residualRe_; + public: @@ -63,10 +73,8 @@ public: //- Construct from components RanzMarshall ( - const dictionary& interfaceDict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const dictionary& dict, + const phasePair& pair ); @@ -76,7 +84,8 @@ public: // Member Functions - tmp K(const volScalarField& Ur) const; + //- The heat transfer function K used in the enthalpy equation + tmp K() const; }; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.C index 40facd1fe6..b04b6a0c10 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,6 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "heatTransferModel.H" +#include "phasePair.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -33,21 +34,18 @@ namespace Foam defineRunTimeSelectionTable(heatTransferModel, dictionary); } +const Foam::dimensionSet Foam::heatTransferModel::dimK(1, -1, -3, -1, 0); + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::heatTransferModel::heatTransferModel ( - const dictionary& interfaceDict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const dictionary& dict, + const phasePair& pair ) : - interfaceDict_(interfaceDict), - alpha1_(alpha1), - phase1_(phase1), - phase2_(phase2) + pair_(pair) {} diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.H index f869f8c0e9..3d4c9dec68 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/heatTransferModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,7 +28,6 @@ Description SourceFiles heatTransferModel.C - newHeatTransferModel.C \*---------------------------------------------------------------------------*/ @@ -37,13 +36,15 @@ SourceFiles // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "volFields.H" #include "dictionary.H" -#include "phaseModel.H" #include "runTimeSelectionTables.H" namespace Foam { +class phasePair; + /*---------------------------------------------------------------------------*\ Class heatTransferModel Declaration \*---------------------------------------------------------------------------*/ @@ -54,10 +55,8 @@ protected: // Protected data - const dictionary& interfaceDict_; - const volScalarField& alpha1_; - const phaseModel& phase1_; - const phaseModel& phase2_; + //- Phase pair + const phasePair& pair_; public: @@ -74,23 +73,26 @@ public: heatTransferModel, dictionary, ( - const dictionary& interfaceDict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const dictionary& dict, + const phasePair& pair ), - (interfaceDict, alpha1, phase1, phase2) + (dict, pair) ); + // Static data members + + //- Coefficient dimensions + static const dimensionSet dimK; + + // Constructors + //- Construct froma dictionary and a phase pair heatTransferModel ( - const dictionary& interfaceDict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const dictionary& dict, + const phasePair& pair ); @@ -102,25 +104,22 @@ public: static autoPtr New ( - const dictionary& interfaceDict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const dictionary& dict, + const phasePair& pair ); // Member Functions - //- the heat-transfer function K used in the enthalpy eq. + //- The heat transfer function K used in the enthalpy equation // ddt(alpha1*rho1*ha) + ... = ... alpha1*alpha2*K*(Ta - Tb) - // ddt(alpha2*rho2*hb) + ... = ... alpha1*alpha2*K*(Tb - Ta) + // ddt(alpha2*rho2*hb) + ... = ... alpha1*alpha2*K*(Tb - Ta) // ********************************** NB!***************************** - // for numerical reasons alpha1 and alpha2 has been - // extracted from the heat-transfer function K, - // so you MUST divide K by alpha1*alpha2 when implementing the - // heat-transfer function + // for numerical reasons alpha1 and alpha2 has been extracted from the + // heat transfer function K, so you MUST divide K by alpha1*alpha2 when + // implementing the heat transfer function // ********************************** NB!***************************** - virtual tmp K(const volScalarField& Ur) const = 0; + virtual tmp K() const = 0; }; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C index 757fb94351..bceb23cacc 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/heatTransferModel/newHeatTransferModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,26 +24,20 @@ License \*---------------------------------------------------------------------------*/ #include "heatTransferModel.H" +#include "phasePair.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // Foam::autoPtr Foam::heatTransferModel::New ( - const dictionary& interfaceDict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const dictionary& dict, + const phasePair& pair ) { - word heatTransferModelType - ( - interfaceDict.lookup(phase1.name()) - ); + word heatTransferModelType(dict.lookup("type")); - Info<< "Selecting heatTransferModel for phase " - << phase1.name() - << ": " - << heatTransferModelType << endl; + Info<< "Selecting heatTransferModel for " + << pair << ": " << heatTransferModelType << endl; dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(heatTransferModelType); @@ -58,7 +52,7 @@ Foam::autoPtr Foam::heatTransferModel::New << exit(FatalError); } - return cstrIter()(interfaceDict, alpha1, phase1, phase2); + return cstrIter()(dict, pair); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/noHeatTransfer/noHeatTransfer.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/noHeatTransfer/noHeatTransfer.C new file mode 100644 index 0000000000..1a4b3744e8 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/noHeatTransfer/noHeatTransfer.C @@ -0,0 +1,87 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "noHeatTransfer.H" +#include "phasePair.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace heatTransferModels +{ + defineTypeNameAndDebug(noHeatTransfer, 0); + addToRunTimeSelectionTable(heatTransferModel, noHeatTransfer, dictionary); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::heatTransferModels::noHeatTransfer::noHeatTransfer +( + const dictionary& dict, + const phasePair& pair +) +: + heatTransferModel(dict, pair) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::heatTransferModels::noHeatTransfer::~noHeatTransfer() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp +Foam::heatTransferModels::noHeatTransfer::K() const +{ + const fvMesh& mesh(this->pair_.phase1().mesh()); + + return + tmp + ( + new volScalarField + ( + IOobject + ( + "zero", + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionedScalar("zero", dimensionSet(1, -1, -3, -1, 0), 0) + ) + ); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/noHeatTransfer/noHeatTransfer.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/noHeatTransfer/noHeatTransfer.H new file mode 100644 index 0000000000..5b17181434 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/noHeatTransfer/noHeatTransfer.H @@ -0,0 +1,93 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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::noHeatTransfer + +Description + +SourceFiles + noHeatTransfer.C + +\*---------------------------------------------------------------------------*/ + +#ifndef noHeatTransfer_H +#define noHeatTransfer_H + +#include "heatTransferModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class phasePair; + +namespace heatTransferModels +{ + +/*---------------------------------------------------------------------------*\ + Class noHeatTransfer Declaration +\*---------------------------------------------------------------------------*/ + +class noHeatTransfer +: + public heatTransferModel +{ +public: + + //- Runtime type information + TypeName("none"); + + + // Constructors + + //- Construct from a dictionary and a phase pair + noHeatTransfer + ( + const dictionary& dict, + const phasePair& pair + ); + + + //- Destructor + virtual ~noHeatTransfer(); + + + // Member Functions + + //- The heat transfer function K used in the enthalpy equation + tmp K() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace heatTransferModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/TomiyamaLift/TomiyamaLift.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/TomiyamaLift/TomiyamaLift.C new file mode 100644 index 0000000000..a789fd2079 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/TomiyamaLift/TomiyamaLift.C @@ -0,0 +1,75 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "TomiyamaLift.H" +#include "phasePair.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace liftModels +{ + defineTypeNameAndDebug(TomiyamaLift, 0); + addToRunTimeSelectionTable(liftModel, TomiyamaLift, dictionary); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::liftModels::TomiyamaLift::TomiyamaLift +( + const dictionary& dict, + const phasePair& pair +) +: + liftModel(dict, pair) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::liftModels::TomiyamaLift::~TomiyamaLift() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp Foam::liftModels::TomiyamaLift::Cl() const +{ + volScalarField EoH(pair_.EoH2()); + + volScalarField f(0.00105*pow3(EoH) - 0.0159*sqr(EoH) - 0.0204*EoH + 0.474); + + return + neg(EoH - scalar(4))*min(0.288*tanh(0.121*pair_.Re()), f) + + pos(EoH - scalar(4))*neg(EoH - scalar(10))*f + + pos(EoH - scalar(10))*(-0.29); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/TomiyamaLift/TomiyamaLift.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/TomiyamaLift/TomiyamaLift.H new file mode 100644 index 0000000000..f6787a62b2 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/TomiyamaLift/TomiyamaLift.H @@ -0,0 +1,102 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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::liftModels::TomiyamaLift + +Description + Lift model of Tomiyama et al. + + Reference: + \verbatim + "Transverse migration of single bubbles in simple shear flows" + A Tomiyama, H Tamai, I Zun, S Hosokawa + Chemical Engineering Science + Volume 57, Issue 11, Pages 1849-1858, June 2002 + \endverbatim + +SourceFiles + TomiyamaLift.C + +\*---------------------------------------------------------------------------*/ + +#ifndef TomiyamaLift_H +#define TomiyamaLift_H + +#include "liftModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class phasePair; + +namespace liftModels +{ + +/*---------------------------------------------------------------------------*\ + Class TomiyamaLift Declaration +\*---------------------------------------------------------------------------*/ + +class TomiyamaLift +: + public liftModel +{ +public: + + //- Runtime type information + TypeName("Tomiyama"); + + + // Constructors + + //- Construct from a dictionary and a phase pair + TomiyamaLift + ( + const dictionary& dict, + const phasePair& pair + ); + + + //- Destructor + virtual ~TomiyamaLift(); + + + // Member Functions + + //- Lift coefficient + virtual tmp Cl() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace liftModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/constantLiftCoefficient/constantLiftCoefficient.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/constantLiftCoefficient/constantLiftCoefficient.C new file mode 100644 index 0000000000..f070c55424 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/constantLiftCoefficient/constantLiftCoefficient.C @@ -0,0 +1,86 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "constantLiftCoefficient.H" +#include "phasePair.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace liftModels +{ + defineTypeNameAndDebug(constantLiftCoefficient, 0); + addToRunTimeSelectionTable(liftModel, constantLiftCoefficient, dictionary); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::liftModels::constantLiftCoefficient::constantLiftCoefficient +( + const dictionary& dict, + const phasePair& pair +) +: + liftModel(dict, pair), + Cl_("Cl", dimless, dict.lookup("Cl")) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::liftModels::constantLiftCoefficient::~constantLiftCoefficient() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp +Foam::liftModels::constantLiftCoefficient::Cl() const +{ + const fvMesh& mesh(this->pair_.phase1().mesh()); + + return + tmp + ( + new volScalarField + ( + IOobject + ( + "zero", + mesh.time().timeName(), + mesh + ), + mesh, + Cl_ + ) + ); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/constantCoefficient/constantCoefficient.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/constantLiftCoefficient/constantLiftCoefficient.H similarity index 77% rename from applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/constantCoefficient/constantCoefficient.H rename to applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/constantLiftCoefficient/constantLiftCoefficient.H index 8eb5cdeeac..852f04b642 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/constantCoefficient/constantCoefficient.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/constantLiftCoefficient/constantLiftCoefficient.H @@ -22,17 +22,18 @@ License along with OpenFOAM. If not, see . Class - Foam::liftModels::constantCoefficient + Foam::liftModels::constantLiftCoefficient Description + Constant coefficient lift model. SourceFiles - constantCoefficient.C + constantLiftCoefficient.C \*---------------------------------------------------------------------------*/ -#ifndef constantCoefficient_H -#define constantCoefficient_H +#ifndef constantLiftCoefficient_H +#define constantLiftCoefficient_H #include "liftModel.H" @@ -40,24 +41,24 @@ SourceFiles namespace Foam { + +class phasePair; + namespace liftModels { /*---------------------------------------------------------------------------*\ - Class constantCoefficient Declaration + Class constantLiftCoefficient Declaration \*---------------------------------------------------------------------------*/ -class constantCoefficient +class constantLiftCoefficient : public liftModel { // Private data - //- Coefficient dictionary - const dictionary& coeffDict_; - //- Constant lift coefficient - dimensionedScalar Cl_; + const dimensionedScalar Cl_; public: @@ -68,24 +69,22 @@ public: // Constructors - //- Construct from components - constantCoefficient + //- Construct from a dictionary and a phase pair + constantLiftCoefficient ( const dictionary& dict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const phasePair& pair ); //- Destructor - virtual ~constantCoefficient(); + virtual ~constantLiftCoefficient(); // Member Functions - //- Lift force - tmp F(const volVectorField& U) const; + //- Lift coefficient + virtual tmp Cl() const; }; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/liftModel/liftModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/liftModel/liftModel.C index 36dbde08ee..6cd5e02471 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/liftModel/liftModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/liftModel/liftModel.C @@ -24,6 +24,8 @@ License \*---------------------------------------------------------------------------*/ #include "liftModel.H" +#include "phasePair.H" +#include "fvc.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -33,21 +35,18 @@ namespace Foam defineRunTimeSelectionTable(liftModel, dictionary); } +const Foam::dimensionSet Foam::liftModel::dimF(1, -2, -2, 0, 0); + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::liftModel::liftModel ( const dictionary& dict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const phasePair& pair ) : - dict_(dict), - alpha1_(alpha1), - phase1_(phase1), - phase2_(phase2) + pair_(pair) {} @@ -57,4 +56,17 @@ Foam::liftModel::~liftModel() {} +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp Foam::liftModel::F() const +{ + return + Cl() + *pair_.continuous().rho() + *( + pair_.Ur() ^ fvc::curl(pair_.continuous().U()) + ); +} + + // ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/liftModel/liftModel.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/liftModel/liftModel.H index 3c22be1f00..d20d43216b 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/liftModel/liftModel.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/liftModel/liftModel.H @@ -37,13 +37,15 @@ SourceFiles // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "volFields.H" #include "dictionary.H" -#include "phaseModel.H" #include "runTimeSelectionTables.H" namespace Foam { +class phasePair; + /*---------------------------------------------------------------------------*\ Class liftModel Declaration \*---------------------------------------------------------------------------*/ @@ -54,10 +56,8 @@ protected: // Protected data - const dictionary& dict_; - const volScalarField& alpha1_; - const phaseModel& phase1_; - const phaseModel& phase2_; + //- Phase pair + const phasePair& pair_; public: @@ -75,26 +75,25 @@ public: dictionary, ( const dictionary& dict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const phasePair& pair ), - (dict, alpha1, phase1, phase2) + (dict, pair) ); + // Static data members + + //- Force dimensions + static const dimensionSet dimF; + + // Constructors - //- Construct null - liftModel(); - - //- Construct from components + //- Construct from a dictionary and a phase pair liftModel ( const dictionary& dict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const phasePair& pair ); @@ -107,16 +106,17 @@ public: static autoPtr New ( const dictionary& dict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const phasePair& pair ); // Member Functions + //- Lift coefficient + virtual tmp Cl() const = 0; + //- Lift force - virtual tmp F(const volVectorField& U) const = 0; + virtual tmp F() const; }; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C index 96b0e2f064..e8a476d441 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/liftModel/newLiftModel.C @@ -24,26 +24,20 @@ License \*---------------------------------------------------------------------------*/ #include "liftModel.H" +#include "phasePair.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // Foam::autoPtr Foam::liftModel::New ( const dictionary& dict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const phasePair& pair ) { - word liftModelType - ( - dict.subDict(phase1.name()).lookup("type") - ); + word liftModelType(dict.lookup("type")); - Info << "Selecting liftModel for phase " - << phase1.name() - << ": " - << liftModelType << endl; + Info<< "Selecting liftModel for " + << pair << ": " << liftModelType << endl; dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(liftModelType); @@ -58,14 +52,7 @@ Foam::autoPtr Foam::liftModel::New << exit(FatalError); } - return - cstrIter() - ( - dict.subDict(phase1.name()), - alpha1, - phase1, - phase2 - ); + return cstrIter()(dict, pair); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/noLift/noLift.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/noLift/noLift.C index 98d0724955..d6ad1c89f8 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/noLift/noLift.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/noLift/noLift.C @@ -24,6 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "noLift.H" +#include "phasePair.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -33,13 +34,7 @@ namespace Foam namespace liftModels { defineTypeNameAndDebug(noLift, 0); - - addToRunTimeSelectionTable - ( - liftModel, - noLift, - dictionary - ); + addToRunTimeSelectionTable(liftModel, noLift, dictionary); } } @@ -49,12 +44,10 @@ namespace liftModels Foam::liftModels::noLift::noLift ( const dictionary& dict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const phasePair& pair ) : - liftModel(dict, alpha1, phase1, phase2) + liftModel(dict, pair) {} @@ -66,32 +59,39 @@ Foam::liftModels::noLift::~noLift() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::tmp Foam::liftModels::noLift::F -( - const volVectorField& U -) const +Foam::tmp Foam::liftModels::noLift::Cl() const { + const fvMesh& mesh(this->pair_.phase1().mesh()); + return - tmp + tmp ( - new volVectorField + new volScalarField ( IOobject ( - "zero", - U.time().timeName(), - U.mesh() + "Cl", + mesh.time().timeName(), + mesh ), - U.mesh(), - dimensionedVector - ( - "zero", - dimensionSet(1, -2, -2, 0, 0, 0, 0), - vector::zero - ) + mesh, + dimensionedScalar("Cl", dimless, 0) ) ); } +Foam::tmp Foam::liftModels::noLift::F() const +{ + return + Cl() + *dimensionedVector + ( + "zero", + dimensionSet(1, -2, -2, 0, 0), + vector::zero + ); +} + + // ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/noLift/noLift.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/noLift/noLift.H index 68af5802a4..0b0760a67d 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/noLift/noLift.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/noLift/noLift.H @@ -40,6 +40,9 @@ SourceFiles namespace Foam { + +class phasePair; + namespace liftModels { @@ -51,12 +54,6 @@ class noLift : public liftModel { - // Private data - - //- Constant lift coefficient - dimensionedScalar Cl_; - - public: //- Runtime type information @@ -65,13 +62,11 @@ public: // Constructors - //- Construct from components + //- Construct from a dictionary and a phase pair noLift ( const dictionary& dict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const phasePair& pair ); @@ -81,8 +76,11 @@ public: // Member Functions + //- Lift coefficient + virtual tmp Cl() const; + //- Lift force - tmp F(const volVectorField& U) const; + virtual tmp F() const; }; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/TomiyamaSwarm/TomiyamaSwarm.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/TomiyamaSwarm/TomiyamaSwarm.C new file mode 100644 index 0000000000..7cc49195d8 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/TomiyamaSwarm/TomiyamaSwarm.C @@ -0,0 +1,77 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "TomiyamaSwarm.H" +#include "phasePair.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace swarmCorrections +{ + defineTypeNameAndDebug(TomiyamaSwarm, 0); + addToRunTimeSelectionTable + ( + swarmCorrection, + TomiyamaSwarm, + dictionary + ); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::swarmCorrections::TomiyamaSwarm::TomiyamaSwarm +( + const dictionary& dict, + const phasePair& pair +) +: + swarmCorrection(dict, pair), + residualAlpha_("residualAlpha", dimless, dict.lookup("residualAlpha")), + l_("l", dimless, dict.lookup("l")) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::swarmCorrections::TomiyamaSwarm::~TomiyamaSwarm() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +Foam::tmp +Foam::swarmCorrections::TomiyamaSwarm::Cs() const +{ + return + pow(max(this->pair_.continuous(), residualAlpha_), scalar(3) - 2*l_); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/TomiyamaSwarm/TomiyamaSwarm.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/TomiyamaSwarm/TomiyamaSwarm.H new file mode 100644 index 0000000000..ead7f698f9 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/TomiyamaSwarm/TomiyamaSwarm.H @@ -0,0 +1,109 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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::TomiyamaSwarm + +Description + Swarm correction of Tomiyama et al. + + Reference: + \verbatim + "Drag Coefficients of Bubbles. 2nd Report. Drag Coefficient for a Swarm + of Bubbles and its Applicability to Transient Flow." + A Tomiyama, I Kataoka, T Fukuda, and T Sakaguchi + Nippon Kikai Gakkai Ronbunshu + Volume 61, Issue 588, Pages 2810-2817, 1995 + \endverbatim + +SourceFiles + TomiyamaSwarm.C + +\*---------------------------------------------------------------------------*/ + +#ifndef TomiyamaSwarm_H +#define TomiyamaSwarm_H + +#include "swarmCorrection.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace swarmCorrections +{ + +/*---------------------------------------------------------------------------*\ + Class TomiyamaSwarm Declaration +\*---------------------------------------------------------------------------*/ + +class TomiyamaSwarm +: + public swarmCorrection +{ + // Private data + + //- Residual phase fraction + const dimensionedScalar residualAlpha_; + + //- Constant exponent + const dimensionedScalar l_; + + +public: + + //- Runtime type information + TypeName("Tomiyama"); + + + // Constructors + + //- Construct from a dictionary and a phase pair + TomiyamaSwarm + ( + const dictionary& dict, + const phasePair& pair + ); + + + //- Destructor + virtual ~TomiyamaSwarm(); + + + // Member Functions + + //- Swarm correction coefficient + virtual tmp Cs() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace swarmCorrections +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/noSwarm/noSwarm.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/noSwarm/noSwarm.C new file mode 100644 index 0000000000..9239585d7d --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/noSwarm/noSwarm.C @@ -0,0 +1,84 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "noSwarm.H" +#include "phasePair.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace swarmCorrections +{ + defineTypeNameAndDebug(noSwarm, 0); + addToRunTimeSelectionTable(swarmCorrection, noSwarm, dictionary); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::swarmCorrections::noSwarm::noSwarm +( + const dictionary& dict, + const phasePair& pair +) +: + swarmCorrection(dict, pair) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::swarmCorrections::noSwarm::~noSwarm() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp Foam::swarmCorrections::noSwarm::Cs() const +{ + const fvMesh& mesh(this->pair_.phase1().mesh()); + + return + tmp + ( + new volScalarField + ( + IOobject + ( + "one", + mesh.time().timeName(), + mesh + ), + mesh, + dimensionedScalar("one", dimless, 1) + ) + ); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/noSwarm/noSwarm.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/noSwarm/noSwarm.H new file mode 100644 index 0000000000..59682c9bb7 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/noSwarm/noSwarm.H @@ -0,0 +1,93 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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::swarmCorrections::noSwarm + +Description + +SourceFiles + noSwarm.C + +\*---------------------------------------------------------------------------*/ + +#ifndef noSwarm_H +#define noSwarm_H + +#include "swarmCorrection.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class phasePair; + +namespace swarmCorrections +{ + +/*---------------------------------------------------------------------------*\ + Class noSwarm Declaration +\*---------------------------------------------------------------------------*/ + +class noSwarm +: + public swarmCorrection +{ +public: + + //- Runtime type information + TypeName("none"); + + + // Constructors + + //- Construct from a dictionary and a phase pair + noSwarm + ( + const dictionary& dict, + const phasePair& pair + ); + + + //- Destructor + virtual ~noSwarm(); + + + // Member Functions + + //- Swarm correction coefficient + tmp Cs() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace swarmCorrections +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C new file mode 100644 index 0000000000..8c8f096a2e --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/newSwarmCorrection.C @@ -0,0 +1,60 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "swarmCorrection.H" +#include "phasePair.H" + +// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // + +Foam::autoPtr +Foam::swarmCorrection::New +( + const dictionary& dict, + const phasePair& pair +) +{ + word swarmCorrectionType(dict.lookup("type")); + + Info<< "Selecting swarmCorrection for " + << pair << ": " << swarmCorrectionType << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(swarmCorrectionType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorIn("swarmCorrection::New") + << "Unknown swarmCorrectionType type " + << swarmCorrectionType << endl << endl + << "Valid swarmCorrection types are : " << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return cstrIter()(dict, pair); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrection.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrection.C new file mode 100644 index 0000000000..50730c5f96 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrection.C @@ -0,0 +1,56 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "swarmCorrection.H" +#include "phasePair.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(swarmCorrection, 0); + defineRunTimeSelectionTable(swarmCorrection, dictionary); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::swarmCorrection::swarmCorrection +( + const dictionary& dict, + const phasePair& pair +) +: + pair_(pair) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::swarmCorrection::~swarmCorrection() +{} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrection.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrection.H new file mode 100644 index 0000000000..d8b2cb8b9c --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/swarmCorrection/swarmCorrection.H @@ -0,0 +1,121 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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::swarmCorrection + +Description + +SourceFiles + swarmCorrection.C + newSwarmCorrection.C + +\*---------------------------------------------------------------------------*/ + +#ifndef swarmCorrection_H +#define swarmCorrection_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "volFields.H" +#include "dictionary.H" +#include "runTimeSelectionTables.H" + +namespace Foam +{ + +class phasePair; + +/*---------------------------------------------------------------------------*\ + Class swarmCorrection Declaration +\*---------------------------------------------------------------------------*/ + +class swarmCorrection +{ +protected: + + // Protected data + + //- Phase pair + const phasePair& pair_; + + +public: + + //- Runtime type information + TypeName("swarmCorrection"); + + + // Declare runtime construction + declareRunTimeSelectionTable + ( + autoPtr, + swarmCorrection, + dictionary, + ( + const dictionary& dict, + const phasePair& pair + ), + (dict, pair) + ); + + + // Constructors + + //- Construct from a dictionary and a phase pair + swarmCorrection + ( + const dictionary& dict, + const phasePair& pair + ); + + + //- Destructor + virtual ~swarmCorrection(); + + + // Selectors + + static autoPtr New + ( + const dictionary& dict, + const phasePair& pair + ); + + + // Member Functions + + //- Swarm correction coefficient + virtual tmp Cs() const = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/Gosman/Gosman.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/Gosman/Gosman.C new file mode 100644 index 0000000000..33a144df68 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/Gosman/Gosman.C @@ -0,0 +1,99 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "Gosman.H" +#include "phasePair.H" +#include "fvc.H" +#include "PhaseIncompressibleTurbulenceModel.H" +#include "addToRunTimeSelectionTable.H" + +#include "dragModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace turbulentDispersionModels +{ + defineTypeNameAndDebug(Gosman, 0); + addToRunTimeSelectionTable + ( + turbulentDispersionModel, + Gosman, + dictionary + ); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::turbulentDispersionModels::Gosman::Gosman +( + const dictionary& dict, + const phasePair& pair +) +: + turbulentDispersionModel(dict, pair), + sigma_("sigma", dimless, dict.lookup("sigma")) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::turbulentDispersionModels::Gosman::~Gosman() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp +Foam::turbulentDispersionModels::Gosman::F() const +{ + const fvMesh& mesh(pair_.phase1().mesh()); + const dragModel& + drag + ( + mesh.lookupObject + ( + IOobject::groupName(dragModel::typeName, pair_.name()) + ) + ); + + return + - 0.75 + *drag.Cd() + *pair_.continuous().turbulence().nut() + *pair_.magUr() + /( + sigma_ + *pair_.dispersed().d() + ) + *pair_.continuous().rho() + *fvc::grad(pair_.dispersed()); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/Gosman/Gosman.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/Gosman/Gosman.H new file mode 100644 index 0000000000..15a96fef03 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/Gosman/Gosman.H @@ -0,0 +1,109 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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::turbulentDispersionModels::Gosman + +Description + Turbulent dispersion model of Gosman et al. + + Reference: + \verbatim + "Multidimensional modeling of turbulent two-phase flows in stirred + vessels" + A D Gosman, C Lekakou, S Politis, R I Issa and M K Looney + AIChE Journal + Volume 38, Issue 12, Pages 1946-1956, 1992 + \endverbatim + +SourceFiles + Gosman.C + +\*---------------------------------------------------------------------------*/ + +#ifndef Gosman_H +#define Gosman_H + +#include "turbulentDispersionModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class phasePair; + +namespace turbulentDispersionModels +{ + +/*---------------------------------------------------------------------------*\ + Class Gosman Declaration +\*---------------------------------------------------------------------------*/ + +class Gosman +: + public turbulentDispersionModel +{ + // Private data + + //- Schmidt number + const dimensionedScalar sigma_; + + +public: + + //- Runtime type information + TypeName("Gosman"); + + + // Constructors + + //- Construct from a dictionary and a phase pair + Gosman + ( + const dictionary& dict, + const phasePair& pair + ); + + + //- Destructor + virtual ~Gosman(); + + + // Member Functions + + //- Turbulent dispersion force + virtual tmp F() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace turbulentDispersionModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/constantTurbulentDispersionCoefficient/constantTurbulentDispersionCoefficient.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/constantTurbulentDispersionCoefficient/constantTurbulentDispersionCoefficient.C new file mode 100644 index 0000000000..47dd0bd9bb --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/constantTurbulentDispersionCoefficient/constantTurbulentDispersionCoefficient.C @@ -0,0 +1,84 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "constantTurbulentDispersionCoefficient.H" +#include "phasePair.H" +#include "fvc.H" +#include "PhaseIncompressibleTurbulenceModel.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace turbulentDispersionModels +{ + defineTypeNameAndDebug(constantTurbulentDispersionCoefficient, 0); + addToRunTimeSelectionTable + ( + turbulentDispersionModel, + constantTurbulentDispersionCoefficient, + dictionary + ); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::turbulentDispersionModels::constantTurbulentDispersionCoefficient:: +constantTurbulentDispersionCoefficient +( + const dictionary& dict, + const phasePair& pair +) +: + turbulentDispersionModel(dict, pair), + Ctd_("Ctd", dimless, dict.lookup("Ctd")) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::turbulentDispersionModels::constantTurbulentDispersionCoefficient:: +~constantTurbulentDispersionCoefficient() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp +Foam::turbulentDispersionModels::constantTurbulentDispersionCoefficient:: +F() const +{ + return + - Ctd_ + *pair_.continuous().rho() + *pair_.continuous().turbulence().k() + *fvc::grad(pair_.dispersed()); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/constantTurbulentDispersionCoefficient/constantTurbulentDispersionCoefficient.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/constantTurbulentDispersionCoefficient/constantTurbulentDispersionCoefficient.H new file mode 100644 index 0000000000..fba46ea740 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/constantTurbulentDispersionCoefficient/constantTurbulentDispersionCoefficient.H @@ -0,0 +1,100 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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::turbulentDispersionModels::constantTurbulentDispersionCoefficient + +Description + Constant coefficient turbulent dispersion model. + +SourceFiles + constantTurbulentDispersionCoefficient.C + +\*---------------------------------------------------------------------------*/ + +#ifndef constantTurbulentDispersionCoefficient_H +#define constantTurbulentDispersionCoefficient_H + +#include "turbulentDispersionModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class phasePair; + +namespace turbulentDispersionModels +{ + +/*---------------------------------------------------------------------------*\ + Class constantTurbulentDispersionCoefficient Declaration +\*---------------------------------------------------------------------------*/ + +class constantTurbulentDispersionCoefficient +: + public turbulentDispersionModel +{ + // Private data + + //- Constant turbulent dispersion coefficient + const dimensionedScalar Ctd_; + + +public: + + //- Runtime type information + TypeName("constantCoefficient"); + + + // Constructors + + //- Construct from a dictionary and a phase pair + constantTurbulentDispersionCoefficient + ( + const dictionary& dict, + const phasePair& pair + ); + + + //- Destructor + virtual ~constantTurbulentDispersionCoefficient(); + + + // Member Functions + + //- Turbulent dispersion force + virtual tmp F() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace turbulentDispersionModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.C new file mode 100644 index 0000000000..99c8e8581c --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.C @@ -0,0 +1,96 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "noTurbulentDispersion.H" +#include "phasePair.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace turbulentDispersionModels +{ + defineTypeNameAndDebug(noTurbulentDispersion, 0); + addToRunTimeSelectionTable + ( + turbulentDispersionModel, + noTurbulentDispersion, + dictionary + ); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::turbulentDispersionModels::noTurbulentDispersion::noTurbulentDispersion +( + const dictionary& dict, + const phasePair& pair +) +: + turbulentDispersionModel(dict, pair) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::turbulentDispersionModels::noTurbulentDispersion:: +~noTurbulentDispersion() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp +Foam::turbulentDispersionModels::noTurbulentDispersion::F() const +{ + const fvMesh& mesh(this->pair_.phase1().mesh()); + + return + tmp + ( + new volVectorField + ( + IOobject + ( + "zero", + mesh.time().timeName(), + mesh + ), + mesh, + dimensionedVector + ( + "zero", + dimensionSet(1, -2, -2, 0, 0), + vector::zero + ) + ) + ); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.H new file mode 100644 index 0000000000..7c9adf6d2c --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.H @@ -0,0 +1,93 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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::turbulentDispersionModels::noTurbulentDispersion + +Description + +SourceFiles + noTurbulentDispersion.C + +\*---------------------------------------------------------------------------*/ + +#ifndef noTurbulentDispersion_H +#define noTurbulentDispersion_H + +#include "turbulentDispersionModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class phasePair; + +namespace turbulentDispersionModels +{ + +/*---------------------------------------------------------------------------*\ + Class noTurbulentDispersion Declaration +\*---------------------------------------------------------------------------*/ + +class noTurbulentDispersion +: + public turbulentDispersionModel +{ +public: + + //- Runtime type information + TypeName("none"); + + + // Constructors + + //- Construct from a dictionary and a phase pair + noTurbulentDispersion + ( + const dictionary& dict, + const phasePair& pair + ); + + + //- Destructor + virtual ~noTurbulentDispersion(); + + + // Member Functions + + //- Turbulent dispersion force + virtual tmp F() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace turbulentDispersionModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C new file mode 100644 index 0000000000..fa267e80d5 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C @@ -0,0 +1,60 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "turbulentDispersionModel.H" +#include "phasePair.H" + +// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // + +Foam::autoPtr +Foam::turbulentDispersionModel::New +( + const dictionary& dict, + const phasePair& pair +) +{ + word turbulentDispersionModelType(dict.lookup("type")); + + Info<< "Selecting turbulentDispersionModel for " + << pair << ": " << turbulentDispersionModelType << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(turbulentDispersionModelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorIn("turbulentDispersionModel::New") + << "Unknown turbulentDispersionModelType type " + << turbulentDispersionModelType << endl << endl + << "Valid turbulentDispersionModel types are : " << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return cstrIter()(dict, pair); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.C new file mode 100644 index 0000000000..7d11722bab --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.C @@ -0,0 +1,58 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "turbulentDispersionModel.H" +#include "phasePair.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(turbulentDispersionModel, 0); + defineRunTimeSelectionTable(turbulentDispersionModel, dictionary); +} + +const Foam::dimensionSet Foam::turbulentDispersionModel::dimF(1, -2, -2, 0, 0); + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::turbulentDispersionModel::turbulentDispersionModel +( + const dictionary& dict, + const phasePair& pair +) +: + pair_(pair) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::turbulentDispersionModel::~turbulentDispersionModel() +{} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.H new file mode 100644 index 0000000000..b689033476 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.H @@ -0,0 +1,127 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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::turbulentDispersionModel + +Description + +SourceFiles + turbulentDispersionModel.C + newTurbulentDispersionModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef turbulentDispersionModel_H +#define turbulentDispersionModel_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "volFields.H" +#include "dictionary.H" +#include "runTimeSelectionTables.H" + +namespace Foam +{ + +class phasePair; + +/*---------------------------------------------------------------------------*\ + Class turbulentDispersionModel Declaration +\*---------------------------------------------------------------------------*/ + +class turbulentDispersionModel +{ +protected: + + // Protected data + + //- Phase pair + const phasePair& pair_; + + +public: + + //- Runtime type information + TypeName("turbulentDispersionModel"); + + + // Declare runtime construction + + declareRunTimeSelectionTable + ( + autoPtr, + turbulentDispersionModel, + dictionary, + ( + const dictionary& dict, + const phasePair& pair + ), + (dict, pair) + ); + + // Static data members + + //- Force dimensions + static const dimensionSet dimF; + + + // Constructors + + //- Construct from a dictionary and a phase pair + turbulentDispersionModel + ( + const dictionary& dict, + const phasePair& pair + ); + + + //- Destructor + virtual ~turbulentDispersionModel(); + + + // Selectors + + static autoPtr New + ( + const dictionary& dict, + const phasePair& pair + ); + + + // Member Functions + + //- Turbulent dispersion force + virtual tmp F() const = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/constantCoefficient/constantCoefficient.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/Lamb/Lamb.C similarity index 68% rename from applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/constantCoefficient/constantCoefficient.C rename to applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/Lamb/Lamb.C index 110f92e7d4..9ddcc4e358 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/constantCoefficient/constantCoefficient.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/Lamb/Lamb.C @@ -23,22 +23,21 @@ License \*---------------------------------------------------------------------------*/ -#include "constantCoefficient.H" +#include "Lamb.H" +#include "phasePair.H" #include "addToRunTimeSelectionTable.H" -#include "fvc.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { -namespace liftModels +namespace virtualMassModels { - defineTypeNameAndDebug(constantCoefficient, 0); - + defineTypeNameAndDebug(Lamb, 0); addToRunTimeSelectionTable ( - liftModel, - constantCoefficient, + virtualMassModel, + Lamb, dictionary ); } @@ -47,40 +46,32 @@ namespace liftModels // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::liftModels::constantCoefficient::constantCoefficient +Foam::virtualMassModels::Lamb::Lamb ( const dictionary& dict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const phasePair& pair ) : - liftModel(dict, alpha1, phase1, phase2), - coeffDict_(dict.subDict(typeName + "Coeffs")), - Cl_("Cl", dimless, coeffDict_.lookup("Cl")) + virtualMassModel(dict, pair) {} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::liftModels::constantCoefficient::~constantCoefficient() +Foam::virtualMassModels::Lamb::~Lamb() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::tmp Foam::liftModels::constantCoefficient::F -( - const volVectorField& U -) const +Foam::tmp Foam::virtualMassModels::Lamb::Cvm() const { + volScalarField E(min(max(pair_.E(), SMALL), 1 - SMALL)); + volScalarField rtOmEsq(sqrt(1 - sqr(E))); + return - Cl_ - *(phase1_*phase1_.rho() + phase2_*phase2_.rho()) - *( - (phase1_.U() - phase2_.U()) - ^ fvc::curl(U) - ); + (rtOmEsq - E*acos(E)) + /(E*acos(E) - sqr(E)*rtOmEsq); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/Lamb/Lamb.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/Lamb/Lamb.H new file mode 100644 index 0000000000..86f42ed3e1 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/Lamb/Lamb.H @@ -0,0 +1,101 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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::virtualMassModels::Lamb + +Description + Virtual mass model of Lamb. + + Reference: + \verbatim + "Hydrodynamics" + H Lamb + Cambridge University Press, 1895 + \endverbatim + +SourceFiles + Lamb.C + +\*---------------------------------------------------------------------------*/ + +#ifndef Lamb_H +#define Lamb_H + +#include "virtualMassModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class phasePair; + +namespace virtualMassModels +{ + +/*---------------------------------------------------------------------------*\ + Class Lamb Declaration +\*---------------------------------------------------------------------------*/ + +class Lamb +: + public virtualMassModel +{ +public: + + //- Runtime type information + TypeName("Lamb"); + + + // Constructors + + //- Construct from a dictionary and a phase pair + Lamb + ( + const dictionary& dict, + const phasePair& pair + ); + + + //- Destructor + virtual ~Lamb(); + + + // Member Functions + + //- Virtual mass coefficient + virtual tmp Cvm() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace virtualMassModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/constantVirtualMassCoefficient/constantVirtualMassCoefficient.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/constantVirtualMassCoefficient/constantVirtualMassCoefficient.C new file mode 100644 index 0000000000..b76ec41c6c --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/constantVirtualMassCoefficient/constantVirtualMassCoefficient.C @@ -0,0 +1,93 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "constantVirtualMassCoefficient.H" +#include "phasePair.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace virtualMassModels +{ + defineTypeNameAndDebug(constantVirtualMassCoefficient, 0); + addToRunTimeSelectionTable + ( + virtualMassModel, + constantVirtualMassCoefficient, + dictionary + ); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::virtualMassModels::constantVirtualMassCoefficient:: +constantVirtualMassCoefficient +( + const dictionary& dict, + const phasePair& pair +) +: + virtualMassModel(dict, pair), + Cvm_("Cvm", dimless, dict.lookup("Cvm")) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::virtualMassModels::constantVirtualMassCoefficient:: +~constantVirtualMassCoefficient() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp +Foam::virtualMassModels::constantVirtualMassCoefficient::Cvm() const +{ + const fvMesh& mesh(this->pair_.phase1().mesh()); + + return + tmp + ( + new volScalarField + ( + IOobject + ( + "zero", + mesh.time().timeName(), + mesh + ), + mesh, + Cvm_ + ) + ); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/constantVirtualMassCoefficient/constantVirtualMassCoefficient.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/constantVirtualMassCoefficient/constantVirtualMassCoefficient.H new file mode 100644 index 0000000000..f8b1f5a3de --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/constantVirtualMassCoefficient/constantVirtualMassCoefficient.H @@ -0,0 +1,102 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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::virtualMassModels::constantVirtualMassCoefficient + +Description + Constant coefficient virtual mass model. + +SourceFiles + constantVirtualMassCoefficient.C + +\*---------------------------------------------------------------------------*/ + +#ifndef constantVirtualMassCoefficient_H +#define constantVirtualMassCoefficient_H + +#include "virtualMassModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class phasePair; + +namespace virtualMassModels +{ + +/*---------------------------------------------------------------------------*\ + Class constantVirtualMassCoefficient Declaration +\*---------------------------------------------------------------------------*/ + +class constantVirtualMassCoefficient +: + public virtualMassModel +{ +private: + + // Private data + + //- Constant virtual mass coefficient + const dimensionedScalar Cvm_; + + +public: + + //- Runtime type information + TypeName("constantCoefficient"); + + + // Constructors + + //- Construct from a dictionary and a phase pair + constantVirtualMassCoefficient + ( + const dictionary& dict, + const phasePair& pair + ); + + + //- Destructor + virtual ~constantVirtualMassCoefficient(); + + + // Member Functions + + //- Virtual mass coefficient + virtual tmp Cvm() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace virtualMassModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/noVirtualMass/noVirtualMass.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/noVirtualMass/noVirtualMass.C new file mode 100644 index 0000000000..674bd63b9b --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/noVirtualMass/noVirtualMass.C @@ -0,0 +1,92 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "noVirtualMass.H" +#include "phasePair.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace virtualMassModels +{ + defineTypeNameAndDebug(noVirtualMass, 0); + addToRunTimeSelectionTable(virtualMassModel, noVirtualMass, dictionary); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::virtualMassModels::noVirtualMass::noVirtualMass +( + const dictionary& dict, + const phasePair& pair +) +: + virtualMassModel(dict, pair) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::virtualMassModels::noVirtualMass::~noVirtualMass() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp +Foam::virtualMassModels::noVirtualMass::Cvm() const +{ + const fvMesh& mesh(this->pair_.phase1().mesh()); + + return + tmp + ( + new volScalarField + ( + IOobject + ( + "zero", + mesh.time().timeName(), + mesh + ), + mesh, + dimensionedScalar("zero", dimless, 0) + ) + ); +} + + +Foam::tmp +Foam::virtualMassModels::noVirtualMass::K() const +{ + return Cvm()*dimensionedScalar("zero", dimDensity, 0); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/noVirtualMass/noVirtualMass.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/noVirtualMass/noVirtualMass.H new file mode 100644 index 0000000000..ca498c4606 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/noVirtualMass/noVirtualMass.H @@ -0,0 +1,95 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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::virtualMassModels::noVirtualMass + +Description + +SourceFiles + noVirtualMass.C + +\*---------------------------------------------------------------------------*/ + +#ifndef noVirtualMass_H +#define noVirtualMass_H + +#include "virtualMassModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class phasePair; + +namespace virtualMassModels +{ + +/*---------------------------------------------------------------------------*\ + Class noVirtualMass Declaration +\*---------------------------------------------------------------------------*/ + +class noVirtualMass +: + public virtualMassModel +{ +public: + + //- Runtime type information + TypeName("none"); + + + // Constructors + + //- Construct from a dictionary and a phase pair + noVirtualMass + ( + const dictionary& dict, + const phasePair& pair + ); + + + //- Destructor + virtual ~noVirtualMass(); + + + // Member Functions + + //- Virtual mass coefficient + virtual tmp Cvm() const; + + virtual tmp K() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace virtualMassModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C new file mode 100644 index 0000000000..d8df3a8b50 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/newVirtualMassModel.C @@ -0,0 +1,59 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "virtualMassModel.H" +#include "phasePair.H" + +// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // + +Foam::autoPtr Foam::virtualMassModel::New +( + const dictionary& dict, + const phasePair& pair +) +{ + word virtualMassModelType(dict.lookup("type")); + + Info<< "Selecting virtualMassModel for " + << pair << ": " << virtualMassModelType << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(virtualMassModelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorIn("virtualMassModel::New") + << "Unknown virtualMassModelType type " + << virtualMassModelType << endl << endl + << "Valid virtualMassModel types are : " << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return cstrIter()(dict, pair); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModel.C new file mode 100644 index 0000000000..ffdfb44a83 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModel.C @@ -0,0 +1,81 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "virtualMassModel.H" +#include "phasePair.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(virtualMassModel, 0); + defineRunTimeSelectionTable(virtualMassModel, dictionary); +} + +const Foam::dimensionSet Foam::virtualMassModel::dimK(dimDensity); + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::virtualMassModel::virtualMassModel +( + const dictionary& dict, + const phasePair& pair +) +: + regIOobject + ( + IOobject + ( + IOobject::groupName(typeName, pair.name()), + pair.phase1().mesh().time().timeName(), + pair.phase1().mesh() + ) + ), + pair_(pair) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::virtualMassModel::~virtualMassModel() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp Foam::virtualMassModel::K() const +{ + return Cvm()*pair_.continuous().rho(); +} + + +bool Foam::virtualMassModel::writeData(Ostream& os) const +{ + return os.good(); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModel.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModel.H new file mode 100644 index 0000000000..90222e8f67 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModel.H @@ -0,0 +1,143 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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::virtualMassModel + +Description + +SourceFiles + virtualMassModel.C + newVirtualMassModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef virtualMassModel_H +#define virtualMassModel_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "volFields.H" +#include "dictionary.H" +#include "runTimeSelectionTables.H" + +namespace Foam +{ + +class phasePair; + +/*---------------------------------------------------------------------------*\ + Class virtualMassModel Declaration +\*---------------------------------------------------------------------------*/ + +class virtualMassModel +: + public regIOobject +{ +protected: + + // Protected data + + //- Phase pair + const phasePair& pair_; + + +public: + + //- Runtime type information + TypeName("virtualMassModel"); + + + // Declare runtime construction + + declareRunTimeSelectionTable + ( + autoPtr, + virtualMassModel, + dictionary, + ( + const dictionary& dict, + const phasePair& pair + ), + (dict, pair) + ); + + + // Static data members + + //- Coefficient dimensions + static const dimensionSet dimK; + + + // Constructors + + //- Construct from a dictionary and a phase pair + virtualMassModel + ( + const dictionary& dict, + const phasePair& pair + ); + + + //- Destructor + virtual ~virtualMassModel(); + + + // Selectors + + static autoPtr New + ( + const dictionary& dict, + const phasePair& pair + ); + + + // Member Functions + + //- Virtual mass coefficient + virtual tmp Cvm() const = 0; + + //- The virtual mass function K used in the momentum equation + // ddt(alpha1*rho1*U1) + ... = ... alpha1*alpha2*K*(DU1_Dt - DU2_Dt) + // ddt(alpha2*rho2*U2) + ... = ... alpha1*alpha2*K*(DU1_Dt - DU2_Dt) + // ********************************** NB! ***************************** + // for numerical reasons alpha1 and alpha2 has been extracted from the + // virtual mass function K, so you MUST divide K by alpha1*alpha2 when + // implemnting the virtual mass function + // ********************************** NB! ***************************** + virtual tmp K() const; + + // Dummy write for regIOobject + bool writeData(Ostream& os) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/Antal/Antal.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/Antal/Antal.C new file mode 100644 index 0000000000..aea563edd8 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/Antal/Antal.C @@ -0,0 +1,88 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "Antal.H" +#include "phasePair.H" +#include "fvc.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace wallLubricationModels +{ + defineTypeNameAndDebug(Antal, 0); + addToRunTimeSelectionTable + ( + wallLubricationModel, + Antal, + dictionary + ); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::wallLubricationModels::Antal::Antal +( + const dictionary& dict, + const phasePair& pair +) +: + wallLubricationModel(dict, pair), + Cw1_("Cw1", dimless, dict.lookup("Cw1")), + Cw2_("Cw2", dimless, dict.lookup("Cw2")) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::wallLubricationModels::Antal::~Antal() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp Foam::wallLubricationModels::Antal::F() const +{ + volVectorField Ur(pair_.Ur()); + volVectorField nWall(- fvc::grad(yWall_)); + nWall /= mag(nWall) + SMALL; + + return + max + ( + dimensionedScalar("zero", dimless/dimLength, 0), + Cw1_/pair_.dispersed().d() + Cw2_/yWall_ + ) + *pair_.continuous().rho() + *magSqr(Ur - (Ur & nWall)*nWall) + *nWall; +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/Antal/Antal.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/Antal/Antal.H new file mode 100644 index 0000000000..bd5daf4cb7 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/Antal/Antal.H @@ -0,0 +1,114 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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::wallLubricationModels::Antal + +Description + Wall lubrication model of Antal et al. + + Reference: + \verbatim + "Analysis of phase distribution in fully developed laminar bubbly + two-phase flow" + S P Antal, R T Lahey Jr and J E Flaherty + International Journal of Multiphase Flow + Volume 17, Issue 5, Pages 635-652, September 1991 + \endverbatim + +SourceFiles + Antal.C + +\*---------------------------------------------------------------------------*/ + +#ifndef Antal_H +#define Antal_H + +#include "wallLubricationModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class phasePair; + +namespace wallLubricationModels +{ + +/*---------------------------------------------------------------------------*\ + Class Antal Declaration +\*---------------------------------------------------------------------------*/ + +class Antal +: + public wallLubricationModel +{ +private: + + // Private data + + //- Coefficient 1 + const dimensionedScalar Cw1_; + + //- Coefficient 2 + const dimensionedScalar Cw2_; + + +public: + + //- Runtime type information + TypeName("Antal"); + + + // Constructors + + //- Construct from components + Antal + ( + const dictionary& dict, + const phasePair& pair + ); + + + //- Destructor + virtual ~Antal(); + + + // Member Functions + + //- Wall lubrication force + tmp F() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace wallLubricationModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.C new file mode 100644 index 0000000000..4fbdffc085 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.C @@ -0,0 +1,95 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "noWallLubrication.H" +#include "phasePair.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace wallLubricationModels +{ + defineTypeNameAndDebug(noWallLubrication, 0); + addToRunTimeSelectionTable + ( + wallLubricationModel, + noWallLubrication, + dictionary + ); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::wallLubricationModels::noWallLubrication::noWallLubrication +( + const dictionary& dict, + const phasePair& pair +) +: + wallLubricationModel(dict, pair) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::wallLubricationModels::noWallLubrication::~noWallLubrication() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp +Foam::wallLubricationModels::noWallLubrication::F() const +{ + const fvMesh& mesh(this->pair_.phase1().mesh()); + + return + tmp + ( + new volVectorField + ( + IOobject + ( + "zero", + mesh.time().timeName(), + mesh + ), + mesh, + dimensionedVector + ( + "zero", + dimensionSet(1, -2, -2, 0, 0), + vector::zero + ) + ) + ); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.H new file mode 100644 index 0000000000..4861c25675 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.H @@ -0,0 +1,93 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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::wallLubricationModels::noWallLubrication + +Description + +SourceFiles + noWallLubrication.C + +\*---------------------------------------------------------------------------*/ + +#ifndef noWallLubrication_H +#define noWallLubrication_H + +#include "wallLubricationModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class phasePair; + +namespace wallLubricationModels +{ + +/*---------------------------------------------------------------------------*\ + Class noWallLubrication Declaration +\*---------------------------------------------------------------------------*/ + +class noWallLubrication +: + public wallLubricationModel +{ +public: + + //- Runtime type information + TypeName("none"); + + + // Constructors + + //- Construct from components + noWallLubrication + ( + const dictionary& dict, + const phasePair& pair + ); + + + //- Destructor + virtual ~noWallLubrication(); + + + // Member Functions + + //- Wall lubrication force + tmp F() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace wallLubricationModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C new file mode 100644 index 0000000000..b9766e7d52 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/newWallLubricationModel.C @@ -0,0 +1,59 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "wallLubricationModel.H" +#include "phasePair.H" + +// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // + +Foam::autoPtr Foam::wallLubricationModel::New +( + const dictionary& dict, + const phasePair& pair +) +{ + word wallLubricationModelType(dict.lookup("type")); + + Info<< "Selecting wallLubricationModel for " + << pair << ": " << wallLubricationModelType << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(wallLubricationModelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorIn("wallLubricationModel::New") + << "Unknown wallLubricationModelType type " + << wallLubricationModelType << endl << endl + << "Valid wallLubricationModel types are : " << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return cstrIter()(dict, pair); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.C new file mode 100644 index 0000000000..593516e4ff --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.C @@ -0,0 +1,59 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "wallLubricationModel.H" +#include "phasePair.H" + +const Foam::dimensionSet Foam::wallLubricationModel::dimF(1, -2, -2, 0, 0); + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(wallLubricationModel, 0); + defineRunTimeSelectionTable(wallLubricationModel, dictionary); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::wallLubricationModel::wallLubricationModel +( + const dictionary& dict, + const phasePair& pair +) +: + pair_(pair), + yWall_(pair.phase1().mesh().lookupObject("yWall")) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::wallLubricationModel::~wallLubricationModel() +{} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.H new file mode 100644 index 0000000000..ee2341970e --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.H @@ -0,0 +1,131 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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::wallLubricationModel + +Description + +SourceFiles + wallLubricationModel.C + newWallLubricationModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef wallLubricationModel_H +#define wallLubricationModel_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "volFields.H" +#include "dictionary.H" +#include "runTimeSelectionTables.H" + +namespace Foam +{ + +class phasePair; + +/*---------------------------------------------------------------------------*\ + Class wallLubricationModel Declaration +\*---------------------------------------------------------------------------*/ + +class wallLubricationModel +{ +protected: + + // Protected data + + //- Phase pair + const phasePair& pair_; + + //- Wall distance + const volScalarField& yWall_; + + +public: + + //- Runtime type information + TypeName("wallLubricationModel"); + + + // Declare runtime construction + + declareRunTimeSelectionTable + ( + autoPtr, + wallLubricationModel, + dictionary, + ( + const dictionary& dict, + const phasePair& pair + ), + (dict, pair) + ); + + + // Static data members + + //- Coefficient dimensions + static const dimensionSet dimF; + + + // Constructors + + //- Construct from components + wallLubricationModel + ( + const dictionary& dict, + const phasePair& pair + ); + + + //- Destructor + virtual ~wallLubricationModel(); + + + // Selectors + + static autoPtr New + ( + const dictionary& dict, + const phasePair& pair + ); + + + // Member Functions + + //- Wall lubrication force + virtual tmp F() const = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C index 1a9e2e1419..20428f9c0c 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C @@ -100,6 +100,12 @@ Foam::RASModels::kineticTheoryModel::kineticTheoryModel dimless, this->coeffDict_.lookup("alphaMinFriction") ), + residualAlpha_ + ( + "residualAlpha", + dimless, + this->coeffDict_.lookup("residualAlpha") + ), Theta_ ( @@ -384,7 +390,7 @@ void Foam::RASModels::kineticTheoryModel::correct() volScalarField gammaCoeff ( 12.0*(1.0 - sqr(e_)) - *max(sqr(alpha), phase_.fluid().residualPhaseFraction()) + *max(sqr(alpha), residualAlpha_) *gs0*(1.0/da)*ThetaSqrt/sqrtPi ); @@ -398,12 +404,9 @@ void Foam::RASModels::kineticTheoryModel::correct() max ( alpha*(1.0 - alpha), - phase_.fluid().residualPhaseFraction() + residualAlpha_ ) - *phase_.fluid().drag(phase_).K - ( - magUr + phase_.fluid().residualSlip() - )/rho + *phase_.fluid().drag(phase_).K()/rho ); // Eq. 3.25, p. 50 Js = J1 - J2 @@ -412,7 +415,7 @@ void Foam::RASModels::kineticTheoryModel::correct() ( 0.25*sqr(alpha2Prim)*da*sqr(magUr) /( - max(alpha, phase_.fluid().residualPhaseFraction()) + max(alpha, residualAlpha_) *sqrtPi*(ThetaSqrt + ThetaSmallSqrt) ) ); @@ -483,7 +486,7 @@ void Foam::RASModels::kineticTheoryModel::correct() volScalarField trD ( - alpha/(alpha + phase_.fluid().residualPhaseFraction()) + alpha/(alpha + residualAlpha_) *fvc::div(this->phi_) ); volScalarField tr2D(sqr(trD)); @@ -503,7 +506,7 @@ void Foam::RASModels::kineticTheoryModel::correct() Theta_ = sqr ( (l1 + sqrt(l2 + l3)) - /(2.0*max(alpha, phase_.fluid().residualPhaseFraction())*K4) + /(2.0*max(alpha, residualAlpha_)*K4) ); } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H index 750fa33503..a24b5aaae6 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.H @@ -82,9 +82,6 @@ class kineticTheoryModel const phaseModel& phase_; - ////- Drag model - //const dragModel& draga_; - // Sub-models //- Run-time selected viscosity model @@ -119,6 +116,9 @@ class kineticTheoryModel //- Min value for which the frictional stresses are zero dimensionedScalar alphaMinFriction_; + //- Residual phase fraction + dimensionedScalar residualAlpha_; + // Kinetic Theory Model Fields diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phaseIncompressibleTurbulenceModels.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phaseIncompressibleTurbulenceModels.C index 1f31befdd2..8a038c434e 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phaseIncompressibleTurbulenceModels.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/phaseIncompressibleTurbulenceModels.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,6 +25,7 @@ License #include "PhaseIncompressibleTurbulenceModel.H" #include "phaseModel.H" +#include "twoPhaseSystem.H" #include "addToRunTimeSelectionTable.H" #include "makeTurbulenceModel.H" @@ -76,12 +77,10 @@ makeLESModel(NicenoKEqn); #include "continuousGasKEqn.H" makeLESModel(continuousGasKEqn); - #include "kineticTheoryModel.H" makeTurbulenceModel (phaseModelPhaseIncompressibleTurbulenceModel, RAS, kineticTheoryModel); - #include "phasePressureModel.H" makeTurbulenceModel (phaseModelPhaseIncompressibleTurbulenceModel, RAS, phasePressureModel); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/readPPProperties.H b/applications/solvers/multiphase/twoPhaseEulerFoam/readPPProperties.H deleted file mode 100644 index 4f32564a48..0000000000 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/readPPProperties.H +++ /dev/null @@ -1,31 +0,0 @@ - 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") - ); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseEulerFoam.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseEulerFoam.C index 69682a9a3d..a8d8631dd1 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseEulerFoam.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseEulerFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,8 +33,6 @@ Description #include "fvCFD.H" #include "twoPhaseSystem.H" #include "PhaseIncompressibleTurbulenceModel.H" -#include "dragModel.H" -#include "heatTransferModel.H" #include "pimpleControl.H" #include "IOMRFZoneList.H" #include "fixedFluxPressureFvPatchScalarField.H" diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.C new file mode 100644 index 0000000000..95d6ebe77a --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.C @@ -0,0 +1,241 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "BlendedInterfacialModel.H" +#include "fixedValueFvsPatchFields.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template +template +void Foam::BlendedInterfacialModel::correctFixedFluxBCs +( + GeometricField& field +) const +{ + forAll(pair_.phase1().phi().boundaryField(), patchI) + { + if + ( + isA + ( + pair_.phase1().phi().boundaryField()[patchI] + ) + ) + { + field.boundaryField()[patchI] = pTraits::zero; + } + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::BlendedInterfacialModel::BlendedInterfacialModel +( + const phasePair::dictTable& modelTable, + const blendingMethod& blending, + const phasePair& pair, + const orderedPhasePair& pair1In2, + const orderedPhasePair& pair2In1 +) +: + pair_(pair), + pair1In2_(pair1In2), + pair2In1_(pair2In1), + blending_(blending) +{ + if (modelTable.found(pair_)) + { + model_.set + ( + modelType::New + ( + modelTable[pair_], + pair_ + ).ptr() + ); + } + + if (modelTable.found(pair1In2_)) + { + model1In2_.set + ( + modelType::New + ( + modelTable[pair1In2_], + pair1In2_ + ).ptr() + ); + } + + if (modelTable.found(pair2In1_)) + { + model2In1_.set + ( + modelType::New + ( + modelTable[pair2In1_], + pair2In1_ + ).ptr() + ); + } +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::BlendedInterfacialModel::~BlendedInterfacialModel() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +template +Foam::tmp +Foam::BlendedInterfacialModel::K() const +{ + tmp f1, f2; + + if (model_.valid() || model1In2_.valid()) + { + f1 = blending_.f1(pair1In2_.dispersed(), pair2In1_.dispersed()); + } + + if (model_.valid() || model2In1_.valid()) + { + f2 = blending_.f2(pair1In2_.dispersed(), pair2In1_.dispersed()); + } + + tmp x + ( + new volScalarField + ( + IOobject + ( + modelType::typeName + "Coeff", + pair_.phase1().mesh().time().timeName(), + pair_.phase1().mesh() + ), + pair_.phase1().mesh(), + dimensionedScalar("zero", modelType::dimK, 0) + ) + ); + + if (model_.valid()) + { + x() += model_->K()*(f1() - f2()); + } + + if (model1In2_.valid()) + { + x() += model1In2_->K()*(1 - f1); + } + + if (model2In1_.valid()) + { + x() += model2In1_->K()*f2; + } + + if (model_.valid() || model1In2_.valid() || model2In1_.valid()) + { + x() *= max(pair_.phase1()*pair_.phase2(), blending_.residualAlpha()); + + correctFixedFluxBCs(x()); + } + + return x; +} + + +template +template +Foam::tmp > +Foam::BlendedInterfacialModel::F() const +{ + tmp f1, f2; + + if (model_.valid() || model1In2_.valid()) + { + f1 = blending_.f1(pair1In2_.dispersed(), pair2In1_.dispersed()); + } + + if (model_.valid() || model2In1_.valid()) + { + f2 = blending_.f2(pair1In2_.dispersed(), pair2In1_.dispersed()); + } + + tmp > x + ( + new GeometricField + ( + IOobject + ( + modelType::typeName + "Coeff", + pair_.phase1().mesh().time().timeName(), + pair_.phase1().mesh() + ), + pair_.phase1().mesh(), + dimensioned("zero", modelType::dimF, pTraits::zero) + ) + ); + + if (model_.valid()) + { + x() += model_->F()*(f1() - f2()); + } + + if (model1In2_.valid()) + { + x() += model1In2_->F()*(1 - f1); + } + + if (model2In1_.valid()) + { + x() -= model2In1_->F()*f2; // note : subtraction + } + + if (model_.valid() || model1In2_.valid() || model2In1_.valid()) + { + correctFixedFluxBCs(x()); + } + + return x; +} + + +template +const modelType& Foam::BlendedInterfacialModel::phaseModel +( + const class phaseModel& phase +) const +{ + return &phase == &(pair_.phase1()) ? model1In2_ : model2In1_; +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.H b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.H new file mode 100644 index 0000000000..1f698f9916 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.H @@ -0,0 +1,144 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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::BlendedInterfacialModel + +Description + +SourceFiles + BlendedInterfacialModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef BlendedInterfacialModel_H +#define BlendedInterfacialModel_H + +#include "blendingMethod.H" +#include "phasePair.H" +#include "orderedPhasePair.H" + +#include "geometricZeroField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class BlendedInterfacialModel Declaration +\*---------------------------------------------------------------------------*/ + +template +class BlendedInterfacialModel +{ +private: + + // Private data + + //- Unordered phase pair + const phasePair& pair_; + + //- Ordered phase pair for dispersed phase 1 in continuous phase 2 + const orderedPhasePair& pair1In2_; + + //- Ordered phase pair for dispersed phase 2 in continuous phase 1 + const orderedPhasePair& pair2In1_; + + //- Model for region with no obvious dispersed phase + autoPtr model_; + + //- Model for dispersed phase 1 in continuous phase 2 + autoPtr model1In2_; + + //- Model for dispersed phase 2 in continuous phase 1 + autoPtr model2In1_; + + //- Blending model + const blendingMethod& blending_; + + + // Private Member Functions + + //- Disallow default bitwise copy construct + BlendedInterfacialModel(const BlendedInterfacialModel&); + + //- Disallow default bitwise assignment + void operator=(const BlendedInterfacialModel&); + + //- Correct coeff/value on fixed flux boundary conditions + template + void correctFixedFluxBCs + ( + GeometricField& field + ) const; + + +public: + + // Constructors + + //- Construct from the model table, dictionary and pairs + BlendedInterfacialModel + ( + const phasePair::dictTable& modelTable, + const blendingMethod& blending, + const phasePair& pair, + const orderedPhasePair& pair1In2, + const orderedPhasePair& pair2In1 + ); + + + //- Destructor + ~BlendedInterfacialModel(); + + + // Member Functions + + //- Return the implicit coefficient + tmp K() const; + + //- Return the explicit value + template + tmp > F() const; + + //- Return the model for the supplied phase + const modelType& phaseModel(const phaseModel& phase) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "BlendedInterfacialModel.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethod.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethod.C new file mode 100644 index 0000000000..3b4ec1092c --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethod.C @@ -0,0 +1,62 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "blendingMethod.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(blendingMethod, 0); + defineRunTimeSelectionTable(blendingMethod, dictionary); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::blendingMethod::blendingMethod +( + const dictionary& dict +) +: + residualAlpha_("residualAlpha", dimless, dict.lookup("residualAlpha")) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::blendingMethod::~blendingMethod() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +const Foam::dimensionedScalar& Foam::blendingMethod::residualAlpha() const +{ + return residualAlpha_; +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethod.H b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethod.H new file mode 100644 index 0000000000..63cfb797b3 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethod.H @@ -0,0 +1,131 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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::blendingMethod + +Description + +SourceFiles + blendingMethod.C + +\*---------------------------------------------------------------------------*/ + +#ifndef blendingMethod_H +#define blendingMethod_H + +#include "dictionary.H" +#include "runTimeSelectionTables.H" +#include "phaseModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class blendingMethod Declaration +\*---------------------------------------------------------------------------*/ + +class blendingMethod +{ +protected: + + // Protected data + + //- Residual phase fraction + const dimensionedScalar residualAlpha_; + + +public: + + //- Runtime type information + TypeName("blendingMethod"); + + + // Declare runtime construction + declareRunTimeSelectionTable + ( + autoPtr, + blendingMethod, + dictionary, + ( + const dictionary& dict, + const wordList& phaseNames + ), + (dict, phaseNames) + ); + + + // Constructors + + //- Construct from a dictionary + blendingMethod + ( + const dictionary& dict + ); + + + // Selector + + static autoPtr New + ( + const dictionary& dict, + const wordList& phaseNames + ); + + + //- Destructor + virtual ~blendingMethod(); + + + // Member Functions + + //- Residual phase fraction + const dimensionedScalar& residualAlpha() const; + + //- Factor for first phase + virtual tmp f1 + ( + const phaseModel& phase1, + const phaseModel& phase2 + ) const = 0; + + //- Factor for second phase + virtual tmp f2 + ( + const phaseModel& phase1, + const phaseModel& phase2 + ) const = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.C new file mode 100644 index 0000000000..95b277fd99 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.C @@ -0,0 +1,58 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "blendingMethod.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +Foam::autoPtr Foam::blendingMethod::New +( + const dictionary& dict, + const wordList& phaseNames +) +{ + word blendingMethodType(dict.lookup("type")); + + Info<< "Selecting " << dict.dictName() << " blending method: " + << blendingMethodType << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(blendingMethodType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorIn("blendingMethod::New") + << "Unknown blendingMethodType type " + << blendingMethodType << endl << endl + << "Valid blendingMethod types are : " << endl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return cstrIter()(dict, phaseNames); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/hyperbolic/hyperbolic.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/hyperbolic/hyperbolic.C new file mode 100644 index 0000000000..f799dae0c2 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/hyperbolic/hyperbolic.C @@ -0,0 +1,124 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "hyperbolic.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace blendingMethods +{ + defineTypeNameAndDebug(hyperbolic, 0); + + addToRunTimeSelectionTable + ( + blendingMethod, + hyperbolic, + dictionary + ); +} +} + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::blendingMethods::hyperbolic::hyperbolic +( + const dictionary& dict, + const wordList& phaseNames +) +: + blendingMethod(dict), + transitionAlphaScale_ + ( + "transitionAlphaScale", + dimless, + dict.lookup("transitionAlphaScale") + ) +{ + forAllConstIter(wordList, phaseNames, iter) + { + const word name(IOobject::groupName("maxDispersedAlpha", *iter)); + + maxDispersedAlpha_.insert + ( + *iter, + dimensionedScalar + ( + name, + dimless, + dict.lookup(name) + ) + ); + } +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::blendingMethods::hyperbolic::~hyperbolic() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +Foam::tmp Foam::blendingMethods::hyperbolic::f1 +( + const phaseModel& phase1, + const phaseModel& phase2 +) const +{ + return + ( + 1 + + tanh + ( + (4/transitionAlphaScale_) + *(phase1 - maxDispersedAlpha_[phase1.name()]) + ) + )/2; +} + + +Foam::tmp Foam::blendingMethods::hyperbolic::f2 +( + const phaseModel& phase1, + const phaseModel& phase2 +) const +{ + return + ( + 1 + + tanh + ( + (4/transitionAlphaScale_) + *(maxDispersedAlpha_[phase2.name()] - phase2) + ) + )/2; +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/hyperbolic/hyperbolic.H b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/hyperbolic/hyperbolic.H new file mode 100644 index 0000000000..5f89c5fb81 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/hyperbolic/hyperbolic.H @@ -0,0 +1,110 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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::hyperbolic + +Description + +SourceFiles + hyperbolic.C + +\*---------------------------------------------------------------------------*/ + +#ifndef hyperbolic_H +#define hyperbolic_H + +#include "blendingMethod.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace blendingMethods +{ + +/*---------------------------------------------------------------------------*\ + Class hyperbolic Declaration +\*---------------------------------------------------------------------------*/ + +class hyperbolic +: + public blendingMethod +{ + // Private data + + //- Maximum fraction of phases which can be considered dispersed + HashTable maxDispersedAlpha_; + + //- Width of the transition + const dimensionedScalar transitionAlphaScale_; + + +public: + + //- Runtime type information + TypeName("hyperbolic"); + + + // Constructors + + //- Construct from a dictionary and a list of phase names + hyperbolic + ( + const dictionary& dict, + const wordList& phaseNames + ); + + + //- Destructor + ~hyperbolic(); + + + // Member Functions + + //- Factor for first phase + virtual tmp f1 + ( + const phaseModel& phase1, + const phaseModel& phase2 + ) const; + + //- Factor for second phase + virtual tmp f2 + ( + const phaseModel& phase1, + const phaseModel& phase2 + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace blendingMethods +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/linear/linear.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/linear/linear.C new file mode 100644 index 0000000000..6bda755820 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/linear/linear.C @@ -0,0 +1,170 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "linear.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace blendingMethods +{ + defineTypeNameAndDebug(linear, 0); + + addToRunTimeSelectionTable + ( + blendingMethod, + linear, + dictionary + ); +} +} + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::blendingMethods::linear::linear +( + const dictionary& dict, + const wordList& phaseNames +) +: + blendingMethod(dict) +{ + forAllConstIter(wordList, phaseNames, iter) + { + const word nameFull + ( + IOobject::groupName("maxFullyDispersedAlpha", *iter) + ); + + maxFullyDispersedAlpha_.insert + ( + *iter, + dimensionedScalar + ( + nameFull, + dimless, + dict.lookup(nameFull) + ) + ); + + const word namePart + ( + IOobject::groupName("maxPartlyDispersedAlpha", *iter) + ); + + maxPartlyDispersedAlpha_.insert + ( + *iter, + dimensionedScalar + ( + namePart, + dimless, + dict.lookup(namePart) + ) + ); + + if + ( + maxFullyDispersedAlpha_[*iter] + > maxPartlyDispersedAlpha_[*iter] + ) + { + FatalErrorIn + ( + "Foam::blendingMethods::linear::linear" + "(" + "const dictionary& dict," + "const wordList& phaseNames" + ")" + ) << "The supplied fully dispersed volume fraction for " + << *iter + << " is greater than the partly dispersed value." + << endl << exit(FatalError); + } + } +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::blendingMethods::linear::~linear() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +Foam::tmp Foam::blendingMethods::linear::f1 +( + const phaseModel& phase1, + const phaseModel& phase2 +) const +{ + const dimensionedScalar + maxFullAlpha(maxFullyDispersedAlpha_[phase1.name()]); + const dimensionedScalar + maxPartAlpha(maxPartlyDispersedAlpha_[phase1.name()]); + + return + min + ( + max + ( + (phase1 - maxFullAlpha) + /(maxPartAlpha - maxFullAlpha + SMALL), + 0.0 + ), + 1.0 + ); +} + + +Foam::tmp Foam::blendingMethods::linear::f2 +( + const phaseModel& phase1, + const phaseModel& phase2 +) const +{ + const dimensionedScalar + maxFullAlpha(maxFullyDispersedAlpha_[phase2.name()]); + const dimensionedScalar + maxPartAlpha(maxPartlyDispersedAlpha_[phase2.name()]); + + return + min + ( + max + ( + (maxPartAlpha - phase2) + /(maxPartAlpha - maxFullAlpha + SMALL), + 0.0 + ), + 1.0 + ); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/linear/linear.H b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/linear/linear.H new file mode 100644 index 0000000000..153122c78d --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/linear/linear.H @@ -0,0 +1,112 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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::linear + +Description + +SourceFiles + linear.C + +\*---------------------------------------------------------------------------*/ + +#ifndef linear_H +#define linear_H + +#include "blendingMethod.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace blendingMethods +{ + +/*---------------------------------------------------------------------------*\ + Class linear Declaration +\*---------------------------------------------------------------------------*/ + +class linear +: + public blendingMethod +{ + // Private data + + //- Maximum fraction of phases which can be considered fully dispersed + HashTable + maxFullyDispersedAlpha_; + + //- Maximum fraction of phases which can be considered partly dispersed + HashTable + maxPartlyDispersedAlpha_; + + +public: + + //- Runtime type information + TypeName("linear"); + + + // Constructors + + //- Construct from a dictionary and two phases + linear + ( + const dictionary& dict, + const wordList& phaseNames + ); + + + //- Destructor + ~linear(); + + + // Member Functions + + //- Factor for primary phase + virtual tmp f1 + ( + const phaseModel& phase1, + const phaseModel& phase2 + ) const; + + //- Factor for secondary phase + virtual tmp f2 + ( + const phaseModel& phase1, + const phaseModel& phase2 + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace blendingMethods +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/noBlending/noBlending.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/noBlending/noBlending.C new file mode 100644 index 0000000000..37c543a8ff --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/noBlending/noBlending.C @@ -0,0 +1,108 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "noBlending.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace blendingMethods +{ + defineTypeNameAndDebug(noBlending, 0); + + addToRunTimeSelectionTable + ( + blendingMethod, + noBlending, + dictionary + ); +} +} + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::blendingMethods::noBlending::noBlending +( + const dictionary& dict, + const wordList& phaseNames +) +: + blendingMethod(dict), + continuousPhase_(dict.lookup("continuousPhase")) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::blendingMethods::noBlending::~noBlending() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +Foam::tmp Foam::blendingMethods::noBlending::f1 +( + const phaseModel& phase1, + const phaseModel& phase2 +) const +{ + const fvMesh& mesh(phase1.mesh()); + + return + tmp + ( + new volScalarField + ( + IOobject + ( + "f", + mesh.time().timeName(), + mesh + ), + mesh, + dimensionedScalar + ( + "f", + dimless, + phase1.name() == continuousPhase_ + ) + ) + ); +} + + +Foam::tmp Foam::blendingMethods::noBlending::f2 +( + const phaseModel& phase1, + const phaseModel& phase2 +) const +{ + return f1(phase1, phase2); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/noBlending/noBlending.H b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/noBlending/noBlending.H new file mode 100644 index 0000000000..7415920c77 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/noBlending/noBlending.H @@ -0,0 +1,107 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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::noBlending + +Description + +SourceFiles + noBlending.C + +\*---------------------------------------------------------------------------*/ + +#ifndef noBlending_H +#define noBlending_H + +#include "blendingMethod.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace blendingMethods +{ + +/*---------------------------------------------------------------------------*\ + Class noBlending Declaration +\*---------------------------------------------------------------------------*/ + +class noBlending +: + public blendingMethod +{ + // Private data + + //- Name of the continuous phase + const word continuousPhase_; + + +public: + + //- Runtime type information + TypeName("none"); + + + // Constructors + + //- Construct from a dictionary and two phases + noBlending + ( + const dictionary& dict, + const wordList& phaseNames + ); + + + //- Destructor + ~noBlending(); + + + // Member Functions + + //- Factor for primary phase + virtual tmp f1 + ( + const phaseModel& phase1, + const phaseModel& phase2 + ) const; + + //- Factor for secondary phase + virtual tmp f2 + ( + const phaseModel& phase1, + const phaseModel& phase2 + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace blendingMethods +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/Make/files b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/Make/files index 0de9e8939c..8ca75b46ee 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/Make/files +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/Make/files @@ -10,6 +10,16 @@ diameterModels/IATE/IATEsources/wakeEntrainmentCoalescence/wakeEntrainmentCoales diameterModels/IATE/IATEsources/turbulentBreakUp/turbulentBreakUp.C diameterModels/IATE/IATEsources/randomCoalescence/randomCoalescence.C +BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethod.C +BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.C +BlendedInterfacialModel/blendingMethods/noBlending/noBlending.C +BlendedInterfacialModel/blendingMethods/linear/linear.C +BlendedInterfacialModel/blendingMethods/hyperbolic/hyperbolic.C + +phasePair/phasePairKey/phasePairKey.C +phasePair/phasePair/phasePair.C +phasePair/orderedPhasePair/orderedPhasePair.C + twoPhaseSystem.C LIB = $(FOAM_LIBBIN)/libcompressibleTwoPhaseSystem diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATE.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATE.C index ef4bc12d0c..c25cedb14e 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATE.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATE.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -77,6 +77,12 @@ Foam::diameterModels::IATE::IATE ), dMax_("dMax", dimLength, diameterProperties_.lookup("dMax")), dMin_("dMin", dimLength, diameterProperties_.lookup("dMin")), + residualAlpha_ + ( + "residualAlpha", + dimless, + diameterProperties_.lookup("residualAlpha") + ), d_ ( IOobject @@ -137,7 +143,7 @@ void Foam::diameterModels::IATE::correct() /max ( fvc::average(phase_ + phase_.oldTime()), - phase_.fluid().residualPhaseFraction() + residualAlpha_ ) ) *(fvc::ddt(phase_) + fvc::div(phase_.phiAlpha())) diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATE.H b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATE.H index f599fb9959..7109bc18ae 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATE.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATE.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -80,6 +80,9 @@ class IATE //- Minimum diameter used for stabilisation in the limit kappai->inf dimensionedScalar dMin_; + //- Residual phase fraction + dimensionedScalar residualAlpha_; + //- The Sauter-mean diameter of the phase volScalarField d_; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phasePair/orderedPhasePair/orderedPhasePair.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phasePair/orderedPhasePair/orderedPhasePair.C new file mode 100644 index 0000000000..808208ea99 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phasePair/orderedPhasePair/orderedPhasePair.C @@ -0,0 +1,97 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "orderedPhasePair.H" +#include "aspectRatioModel.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::orderedPhasePair::orderedPhasePair +( + const phaseModel& dispersed, + const phaseModel& continuous, + const dimensionedVector& g, + const scalarTable& sigmaTable, + const dictTable& aspectRatioTable +) +: + phasePair(dispersed, continuous, g, sigmaTable, true) +{ + if (aspectRatioTable.found(*this)) + { + aspectRatio_.set + ( + aspectRatioModel::New + ( + aspectRatioTable[*this], + *this + ).ptr() + ); + } +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::orderedPhasePair::~orderedPhasePair() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +const Foam::phaseModel& Foam::orderedPhasePair::dispersed() const +{ + return phase1(); +} + + +const Foam::phaseModel& Foam::orderedPhasePair::continuous() const +{ + return phase2(); +} + + +Foam::word Foam::orderedPhasePair::name() const +{ + word namec(continuous().name()); + namec[0] = toupper(namec[0]); + return dispersed().name() + "In" + namec; +} + + +Foam::tmp Foam::orderedPhasePair::E() const +{ + if (!aspectRatio_.valid()) + { + FatalErrorIn("Foam::orderedPhasePair::E() const") + << "Aspect ratio model not specified for " << *this << "." + << exit(FatalError); + } + + return aspectRatio_->E(); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phasePair/orderedPhasePair/orderedPhasePair.H b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phasePair/orderedPhasePair/orderedPhasePair.H new file mode 100644 index 0000000000..e3530b06c9 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phasePair/orderedPhasePair/orderedPhasePair.H @@ -0,0 +1,106 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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::orderedPhasePair + +Description + +SourceFiles + orderedPhasePair.C + +\*---------------------------------------------------------------------------*/ + +#ifndef orderedPhasePair_H +#define orderedPhasePair_H + +#include "phasePair.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class aspectRatioModel; + +/*---------------------------------------------------------------------------*\ + Class orderedPhasePair Declaration +\*---------------------------------------------------------------------------*/ + +class orderedPhasePair +: + public phasePair +{ +private: + + // Private data + + //- Aspect ratio model + autoPtr aspectRatio_; + + +public: + + // Constructors + + //- Construct from two phases, gravity, surface tension and aspect + // ratio tables + orderedPhasePair + ( + const phaseModel& dispersed, + const phaseModel& continuous, + const dimensionedVector& g, + const scalarTable& sigmaTable, + const dictTable& aspectRatioTable + ); + + + //- Destructor + virtual ~orderedPhasePair(); + + + // Member Functions + + //- Dispersed phase + virtual const phaseModel& dispersed() const; + + //- Continuous phase + virtual const phaseModel& continuous() const; + + //- Pair name + virtual word name() const; + + //- Aspect ratio + virtual tmp E() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phasePair/phasePair/phasePair.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phasePair/phasePair/phasePair.C new file mode 100644 index 0000000000..14822a26c8 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phasePair/phasePair/phasePair.C @@ -0,0 +1,196 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "phasePair.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +Foam::tmp Foam::phasePair::EoH +( + const volScalarField& d +) const +{ + return + mag(dispersed().rho() - continuous().rho()) + *mag(g()) + *sqr(d) + /sigma(); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::phasePair::phasePair +( + const phaseModel& phase1, + const phaseModel& phase2, + const dimensionedVector& g, + const scalarTable& sigmaTable, + const bool ordered +) +: + phasePairKey(phase1.name(), phase2.name(), ordered), + phase1_(phase1), + phase2_(phase2), + g_(g), + sigma_ + ( + "sigma", + dimensionSet(1, 0, -2, 0, 0), + sigmaTable + [ + phasePairKey + ( + phase1.name(), + phase2.name(), + false + ) + ] + ) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::phasePair::~phasePair() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +const Foam::phaseModel& Foam::phasePair::dispersed() const +{ + FatalErrorIn("Foam::phasePair::dispersed() const") + << "Requested dispersed phase from an unordered pair." + << exit(FatalError); + + return phase1_; +} + + +const Foam::phaseModel& Foam::phasePair::continuous() const +{ + FatalErrorIn("Foam::phasePair::dispersed() const") + << "Requested continuous phase from an unordered pair." + << exit(FatalError); + + return phase1_; +} + + +Foam::word Foam::phasePair::name() const +{ + word name2(phase2().name()); + name2[0] = toupper(name2[0]); + return phase1().name() + "And" + name2; +} + + +Foam::tmp Foam::phasePair::rho() const +{ + return phase1()*phase1().rho() + phase2()*phase2().rho(); +} + + +Foam::tmp Foam::phasePair::magUr() const +{ + return mag(phase1().U() - phase2().U()); +} + + +Foam::tmp Foam::phasePair::Ur() const +{ + return dispersed().U() - continuous().U(); +} + + +Foam::tmp Foam::phasePair::Re() const +{ + return magUr()*dispersed().d()/continuous().nu(); +} + + +Foam::tmp Foam::phasePair::Pr() const +{ + return + continuous().nu()*continuous().Cp()*continuous().rho() + /continuous().kappa(); +} + + +Foam::tmp Foam::phasePair::Eo() const +{ + return EoH(dispersed().d()); +} + + +Foam::tmp Foam::phasePair::EoH1() const +{ + return + EoH + ( + dispersed().d() + *cbrt(1 + 0.163*pow(Eo(), 0.757)) + ); +} + + +Foam::tmp Foam::phasePair::EoH2() const +{ + return + EoH + ( + dispersed().d() + /cbrt(Eo()) + ); +} + + +Foam::tmp Foam::phasePair::Mo() const +{ + return + mag(g()) + *continuous().nu() + *pow3(continuous().nu()*continuous().rho()/sigma()); +} + + +Foam::tmp Foam::phasePair::Ta() const +{ + return Re()*pow(Mo(), 0.23); +} + + +Foam::tmp Foam::phasePair::E() const +{ + FatalErrorIn("Foam::phasePair::E() const") + << "Requested aspect ratio of the dispersed phase in an unordered pair" + << exit(FatalError); + + return phase1(); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phasePair/phasePair/phasePair.H b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phasePair/phasePair/phasePair.H new file mode 100644 index 0000000000..fb942c47f6 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phasePair/phasePair/phasePair.H @@ -0,0 +1,179 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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::phasePair + +Description + +SourceFiles + phasePair.C + +\*---------------------------------------------------------------------------*/ + +#ifndef phasePair_H +#define phasePair_H + +#include "phaseModel.H" +#include "phasePairKey.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class phasePair Declaration +\*---------------------------------------------------------------------------*/ + +class phasePair +: + public phasePairKey +{ +public: + + // Hash table types + + //- Dictionary hash table + typedef HashTable + dictTable; + + //- Scalar hash table + typedef HashTable + scalarTable; + + +private: + + // Private data + + //- Phase 1 + const phaseModel& phase1_; + + //- Phase 2 + const phaseModel& phase2_; + + //- Gravitational acceleration + const dimensionedVector& g_; + + //- Surface tension coefficient + const dimensionedScalar sigma_; + + + // Private member functions + + // Etvos number for given diameter + tmp EoH(const volScalarField& d) const; + +public: + + // Constructors + + //- Construct from two phases, gravity and surface tension table + phasePair + ( + const phaseModel& phase1, + const phaseModel& phase2, + const dimensionedVector& g, + const scalarTable& sigmaTable, + const bool ordered = false + ); + + + //- Destructor + virtual ~phasePair(); + + + // Member Functions + + //- Dispersed phase + virtual const phaseModel& dispersed() const; + + //- Continuous phase + virtual const phaseModel& continuous() const; + + //- Pair name + virtual word name() const; + + //- Average density + tmp rho() const; + + //- Relative velocity magnitude + tmp magUr() const; + + //- Relative velocity + tmp Ur() const; + + //- Reynolds number + tmp Re() const; + + //- Prandtl number + tmp Pr() const; + + //- Eotvos number + tmp Eo() const; + + //- Eotvos number based on hydraulic diameter type 1 + tmp EoH1() const; + + //- Eotvos number based on hydraulic diameter type 2 + tmp EoH2() const; + + //- Morton Number + tmp Mo() const; + + //- Takahashi Number + tmp Ta() const; + + //- Aspect ratio + virtual tmp E() const; + + // Access + + // Phase 1 + inline const phaseModel& phase1() const; + + // Phase 2 + inline const phaseModel& phase2() const; + + // Gravitational acceleration + inline const dimensionedVector& g() const; + + // Surface tension coefficient + inline const dimensionedScalar& sigma() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "phasePairI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phasePair/phasePair/phasePairI.H b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phasePair/phasePair/phasePairI.H new file mode 100644 index 0000000000..9f2f428ea3 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phasePair/phasePair/phasePairI.H @@ -0,0 +1,52 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 . + +\*---------------------------------------------------------------------------*/ + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +inline const Foam::phaseModel& Foam::phasePair::phase1() const +{ + return phase1_; +} + + +inline const Foam::phaseModel& Foam::phasePair::phase2() const +{ + return phase2_; +} + + +inline const Foam::dimensionedVector& Foam::phasePair::g() const +{ + return g_; +} + + +inline const Foam::dimensionedScalar& Foam::phasePair::sigma() const +{ + return sigma_; +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phasePair/phasePairKey/phasePairKey.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phasePair/phasePairKey/phasePairKey.C new file mode 100644 index 0000000000..4280dd5fb3 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phasePair/phasePairKey/phasePairKey.C @@ -0,0 +1,164 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 "phasePairKey.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::phasePairKey::hash::hash() +{} + + +Foam::phasePairKey::phasePairKey() +{} + + +Foam::phasePairKey::phasePairKey +( + const word& name1, + const word& name2, + const bool ordered +) +: + Pair(name1, name2), + ordered_(ordered) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::phasePairKey::~phasePairKey() +{} + + +// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * // + +Foam::label Foam::phasePairKey::hash::operator() +( + const phasePairKey& key +) const +{ + if (key.ordered_) + { + return + word::hash() + ( + key.first(), + word::hash()(key.second()) + ); + } + else + { + return + word::hash()(key.first()) + + word::hash()(key.second()); + } +} + + +// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * // + +bool Foam::operator== +( + const phasePairKey& a, + const phasePairKey& b +) +{ + const label c = Pair::compare(a,b); + + return + (a.ordered_ == b.ordered_) + && ( + (a.ordered_ && (c == 1)) + || (!a.ordered_ && (c != 0)) + ); +} + + +bool Foam::operator!= +( + const phasePairKey& a, + const phasePairKey& b +) +{ + return !(a == b); +} + + +// * * * * * * * * * * * * * * Istream Operator * * * * * * * * * * * * * * // + +Foam::Istream& Foam::operator>>(Istream& is, phasePairKey& key) +{ + const FixedList temp(is); + + key.first() = temp[0]; + + if (temp[1] == "and") + { + key.ordered_ = false; + } + else if(temp[1] == "in") + { + key.ordered_ = true; + } + else + { + FatalErrorIn + ( + "friend Istream& operator>>" + "(" + "Istream& is, " + "phasePairKey& key" + ")" + ) << "Phase pair type is not recognised. " + << temp + << "Use (phaseDispersed in phaseContinuous) for an ordered" + << "pair, or (phase1 and pase2) for an unordered pair." + << exit(FatalError); + } + + key.second() = temp[2]; + + return is; +} + + +// * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<<(Ostream& os, const phasePairKey& key) +{ + os << token::BEGIN_LIST + << key.first() + << token::SPACE + << (key.ordered_ ? "in" : "and") + << token::SPACE + << key.second() + << token::END_LIST; + + return os; +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phasePair/phasePairKey/phasePairKey.H b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phasePair/phasePairKey/phasePairKey.H new file mode 100644 index 0000000000..d514d6406c --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phasePair/phasePairKey/phasePairKey.H @@ -0,0 +1,119 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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::phasePairKey + +Description + +SourceFiles + +\*---------------------------------------------------------------------------*/ + +#ifndef phasePairKey_H +#define phasePairKey_H + +#include "Pair.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class phasePairKey Declaration +\*---------------------------------------------------------------------------*/ + +class phasePairKey +: + public Pair +{ +public: + + class hash + : + public Hash + { + public: + + // Constructors + + // Construct null + hash(); + + + // Member operators + + // Generate a hash from a phase pair key + label operator()(const phasePairKey& key) const; + }; + + +private: + + // Private data + + //- Flag to indicate whether ordering is important + bool ordered_; + + +public: + + // Constructors + + //- Construct null + phasePairKey(); + + //- Construct from names and the ordering flag + phasePairKey(const word& name1, const word& name2, const bool ordered); + + + // Destructor + virtual ~phasePairKey(); + + + // Friend Operators + + //- Test if keys are equal + friend bool operator==(const phasePairKey& a, const phasePairKey& b); + + //- Test if keys are unequal + friend bool operator!=(const phasePairKey& a, const phasePairKey& b); + + //- Read from stdin + friend Istream& operator>>(Istream& is, phasePairKey& key); + + //- Write to stdout + friend Ostream& operator<<(Ostream& os, const phasePairKey& key); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C index e1f9b221a3..98d096951e 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C @@ -24,8 +24,16 @@ License \*---------------------------------------------------------------------------*/ #include "twoPhaseSystem.H" -#include "fvMatrix.H" #include "PhaseIncompressibleTurbulenceModel.H" +#include "BlendedInterfacialModel.H" +#include "dragModel.H" +#include "virtualMassModel.H" +#include "heatTransferModel.H" +#include "liftModel.H" +#include "wallLubricationModel.H" +#include "turbulentDispersionModel.H" +#include "wallDist.H" +#include "fvMatrix.H" #include "surfaceInterpolate.H" #include "MULES.H" #include "subCycle.H" @@ -38,11 +46,15 @@ License #include "fvmLaplacian.H" #include "fixedValueFvsPatchFields.H" +#include "blendingMethod.H" +#include "HashPtrTable.H" + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::twoPhaseSystem::twoPhaseSystem ( - const fvMesh& mesh + const fvMesh& mesh, + const dimensionedVector& g ) : IOdictionary @@ -97,121 +109,186 @@ Foam::twoPhaseSystem::twoPhaseSystem pos(phase2_)*fvc::div(phi_)/max(phase2_, scalar(0.0001)) ), - sigma_ + yWall_ ( - "sigma", - dimensionSet(1, 0, -2, 0, 0), - lookup("sigma") - ), - - Cvm_ - ( - "Cvm", - dimless, - lookup("Cvm") - ), - - drag1_ - ( - dragModel::New + IOobject ( - subDict("drag"), - phase1_, - phase1_, - phase2_ - ) - ), - - drag2_ - ( - dragModel::New - ( - subDict("drag"), - phase2_, - phase2_, - phase1_ - ) - ), - - heatTransfer1_ - ( - heatTransferModel::New - ( - subDict("heatTransfer"), - phase1_, - phase1_, - phase2_ - ) - ), - - heatTransfer2_ - ( - heatTransferModel::New - ( - subDict("heatTransfer"), - phase2_, - phase2_, - phase1_ - ) - ), - - lift1_ - ( - liftModel::New - ( - subDict("lift"), - phase1_, - phase1_, - phase2_ - ) - ), - - lift2_ - ( - liftModel::New - ( - subDict("lift"), - phase2_, - phase2_, - phase1_ - ) - ), - - dispersedPhase_(lookup("dispersedPhase")), - - residualPhaseFraction_ - ( - readScalar(lookup("residualPhaseFraction")) - ), - - residualSlip_ - ( - "residualSlip", - dimVelocity, - lookup("residualSlip") + "yWall", + mesh.time().timeName(), + mesh + ), + wallDist(mesh).y() ) { - if - ( - !( - dispersedPhase_ == phase1_.name() - || dispersedPhase_ == phase2_.name() - || dispersedPhase_ == "both" - ) - ) + phase2_.volScalarField::operator=(scalar(1) - phase1_); + + + // Blending + // ~~~~~~~~ + + forAllConstIter(dictionary, subDict("blending"), iter) { - FatalErrorIn("twoPhaseSystem::twoPhaseSystem(const fvMesh& mesh)") - << "invalid dispersedPhase " << dispersedPhase_ - << exit(FatalError); + blendingMethods_.insert + ( + iter().dict().dictName(), + blendingMethod::New + ( + iter().dict(), + wordList(lookup("phases")) + ) + ); } - Info << "dispersedPhase is " << dispersedPhase_ << endl; - // Ensure the phase-fractions sum to 1 - phase2_.volScalarField::operator=(scalar(1) - phase1_); + // Pairs + // ~~~~~ + + phasePair::scalarTable sigmaTable(lookup("sigma")); + phasePair::dictTable aspectRatioTable(lookup("aspectRatio")); + + pair_.set + ( + new phasePair + ( + phase1_, + phase2_, + g, + sigmaTable + ) + ); + + pair1In2_.set + ( + new orderedPhasePair + ( + phase1_, + phase2_, + g, + sigmaTable, + aspectRatioTable + ) + ); + + pair2In1_.set + ( + new orderedPhasePair + ( + phase2_, + phase1_, + g, + sigmaTable, + aspectRatioTable + ) + ); + + + // Models + // ~~~~~~ + + drag_.set + ( + new BlendedInterfacialModel + ( + lookup("drag"), + ( + blendingMethods_.found("drag") + ? blendingMethods_["drag"] + : blendingMethods_["default"] + ), + pair_, + pair1In2_, + pair2In1_ + ) + ); + + virtualMass_.set + ( + new BlendedInterfacialModel + ( + lookup("virtualMass"), + ( + blendingMethods_.found("virtualMass") + ? blendingMethods_["virtualMass"] + : blendingMethods_["default"] + ), + pair_, + pair1In2_, + pair2In1_ + ) + ); + + heatTransfer_.set + ( + new BlendedInterfacialModel + ( + lookup("heatTransfer"), + ( + blendingMethods_.found("heatTransfer") + ? blendingMethods_["heatTransfer"] + : blendingMethods_["default"] + ), + pair_, + pair1In2_, + pair2In1_ + ) + ); + + lift_.set + ( + new BlendedInterfacialModel + ( + lookup("lift"), + ( + blendingMethods_.found("lift") + ? blendingMethods_["lift"] + : blendingMethods_["default"] + ), + pair_, + pair1In2_, + pair2In1_ + ) + ); + + wallLubrication_.set + ( + new BlendedInterfacialModel + ( + lookup("wallLubrication"), + ( + blendingMethods_.found("wallLubrication") + ? blendingMethods_["wallLubrication"] + : blendingMethods_["default"] + ), + pair_, + pair1In2_, + pair2In1_ + ) + ); + + turbulentDispersion_.set + ( + new BlendedInterfacialModel + ( + lookup("turbulentDispersion"), + ( + blendingMethods_.found("turbulentDispersion") + ? blendingMethods_["turbulentDispersion"] + : blendingMethods_["default"] + ), + pair_, + pair1In2_, + pair2In1_ + ) + ); } +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::twoPhaseSystem::~twoPhaseSystem() +{} + + // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // Foam::tmp Foam::twoPhaseSystem::rho() const @@ -236,206 +313,39 @@ Foam::tmp Foam::twoPhaseSystem::calcPhi() const Foam::tmp Foam::twoPhaseSystem::dragCoeff() const { - tmp tdragCoeff - ( - new volScalarField - ( - IOobject - ( - "dragCoeff", - mesh_.time().timeName(), - mesh_ - ), - mesh_, - dimensionedScalar("dragCoeff", dimensionSet(1, -3, -1, 0, 0), 0) - ) - ); - volScalarField& dragCoeff = tdragCoeff(); - - volVectorField Ur(phase1_.U() - phase2_.U()); - volScalarField magUr(mag(Ur) + residualSlip_); - - if (dispersedPhase_ == phase1_.name()) - { - dragCoeff = drag1().K(magUr); - } - else if (dispersedPhase_ == phase2_.name()) - { - dragCoeff = drag2().K(magUr); - } - else if (dispersedPhase_ == "both") - { - dragCoeff = - ( - phase2_*drag1().K(magUr) - + phase1_*drag2().K(magUr) - ); - } - else - { - FatalErrorIn("twoPhaseSystem::dragCoeff()") - << "dispersedPhase: " << dispersedPhase_ << " is incorrect" - << exit(FatalError); - } - - volScalarField alphaCoeff(max(phase1_*phase2_, residualPhaseFraction_)); - dragCoeff *= alphaCoeff; - - // Remove drag at fixed-flux boundaries - forAll(phase1_.phi().boundaryField(), patchi) - { - if - ( - isA - ( - phase1_.phi().boundaryField()[patchi] - ) - ) - { - dragCoeff.boundaryField()[patchi] = 0.0; - } - } - - return tdragCoeff; + return drag_->K(); } -Foam::tmp Foam::twoPhaseSystem::liftForce -( - const volVectorField& U -) const +Foam::tmp Foam::twoPhaseSystem::virtualMassCoeff() const { - tmp tliftForce - ( - new volVectorField - ( - IOobject - ( - "liftForce", - mesh_.time().timeName(), - mesh_ - ), - mesh_, - dimensionedVector - ( - "liftForce", - dimensionSet(1, -2, -2, 0, 0), - vector::zero - ) - ) - ); - volVectorField& liftForce = tliftForce(); - - if (dispersedPhase_ == phase1_.name()) - { - liftForce = lift1().F(U); - } - else if (dispersedPhase_ == phase2_.name()) - { - liftForce = lift2().F(U); - } - else if (dispersedPhase_ == "both") - { - liftForce = - ( - phase2_*lift1().F(U) - + phase1_*lift2().F(U) - ); - } - else - { - FatalErrorIn("twoPhaseSystem::liftForce()") - << "dispersedPhase: " << dispersedPhase_ << " is incorrect" - << exit(FatalError); - } - - // Remove lift at fixed-flux boundaries - forAll(phase1_.phi().boundaryField(), patchi) - { - if - ( - isA - ( - phase1_.phi().boundaryField()[patchi] - ) - ) - { - liftForce.boundaryField()[patchi] = vector::zero; - } - } - - return tliftForce; + return virtualMass_->K(); } Foam::tmp Foam::twoPhaseSystem::heatTransferCoeff() const { - tmp theatTransferCoeff - ( - new volScalarField - ( - IOobject - ( - "heatTransferCoeff", - mesh_.time().timeName(), - mesh_ - ), - mesh_, - dimensionedScalar - ( - "heatTransferCoeff", - dimensionSet(1, -1, -3, -1, 0), - 0 - ) - ) - ); - volScalarField& heatTransferCoeff = theatTransferCoeff(); + return heatTransfer_->K(); +} - volVectorField Ur(phase1_.U() - phase2_.U()); - volScalarField magUr(mag(Ur) + residualSlip_); - if (dispersedPhase_ == phase1_.name()) - { - heatTransferCoeff = heatTransfer1().K(magUr); - } - else if (dispersedPhase_ == phase2_.name()) - { - heatTransferCoeff = heatTransfer2().K(magUr); - } - else if (dispersedPhase_ == "both") - { - heatTransferCoeff = - ( - phase2_*heatTransfer1().K(magUr) - + phase1_*heatTransfer2().K(magUr) - ); - } - else - { - FatalErrorIn("twoPhaseSystem::heatTransferCoeff()") - << "dispersedPhase: " << dispersedPhase_ << " is incorrect" - << exit(FatalError); - } +Foam::tmp Foam::twoPhaseSystem::liftForce() const +{ + return lift_->F(); +} - volScalarField alphaCoeff(max(phase1_*phase2_, residualPhaseFraction_)); - heatTransferCoeff *= alphaCoeff; - // Remove heatTransfer at fixed-flux boundaries - forAll(phase1_.phi().boundaryField(), patchi) - { - if - ( - isA - ( - phase1_.phi().boundaryField()[patchi] - ) - ) - { - heatTransferCoeff.boundaryField()[patchi] = 0.0; - } - } +Foam::tmp +Foam::twoPhaseSystem::wallLubricationForce() const +{ + return wallLubrication_->F(); +} - return theatTransferCoeff; + +Foam::tmp +Foam::twoPhaseSystem::turbulentDispersionForce() const +{ + return turbulentDispersion_->F(); } @@ -661,18 +571,7 @@ bool Foam::twoPhaseSystem::read() readOK &= phase1_.read(*this); readOK &= phase2_.read(*this); - lookup("sigma") >> sigma_; - lookup("Cvm") >> Cvm_; - - // drag1_->read(*this); - // drag2_->read(*this); - - // heatTransfer1_->read(*this); - // heatTransfer2_->read(*this); - - lookup("dispersedPhase") >> dispersedPhase_; - lookup("residualPhaseFraction") >> residualPhaseFraction_; - lookup("residualSlip") >> residualSlip_; + // models ... return readOK; } @@ -683,4 +582,24 @@ bool Foam::twoPhaseSystem::read() } +const Foam::dragModel& +Foam::twoPhaseSystem::drag(const phaseModel& phase) const +{ + return drag_->phaseModel(phase); +} + + +const Foam::virtualMassModel& +Foam::twoPhaseSystem::virtualMass(const phaseModel& phase) const +{ + return virtualMass_->phaseModel(phase); +} + + +const Foam::dimensionedScalar& Foam::twoPhaseSystem::sigma() const +{ + return pair_->sigma(); +} + + // ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.H b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.H index cc781bcbc1..e6a5732bb9 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.H @@ -25,14 +25,6 @@ Class Foam::twoPhaseSystem 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 twoPhaseSystem.C @@ -44,9 +36,8 @@ SourceFiles #include "IOdictionary.H" #include "phaseModel.H" -#include "dragModel.H" -#include "liftModel.H" -#include "heatTransferModel.H" +#include "phasePair.H" +#include "orderedPhasePair.H" #include "volFields.H" #include "surfaceFields.H" @@ -55,10 +46,15 @@ SourceFiles namespace Foam { -// Forward declarations class dragModel; +class virtualMassModel; class heatTransferModel; class liftModel; +class wallLubricationModel; +class turbulentDispersionModel; + +class blendingMethod; +template class BlendedInterfacialModel; /*---------------------------------------------------------------------------*\ Class twoPhaseSystem Declaration @@ -68,6 +64,8 @@ class twoPhaseSystem : public IOdictionary { +private: + // Private data //- Reference to the mesh @@ -85,38 +83,40 @@ class twoPhaseSystem //- Dilatation term volScalarField dgdt_; - //- Surface tension coefficient - dimensionedScalar sigma_; + //- Wall distance + volScalarField yWall_; - //- Virtual mass coefficient - dimensionedScalar Cvm_; + //- Unordered phase pair + autoPtr pair_; - //- Drag model for phase 1 - autoPtr drag1_; + //- Phase pair for phase 1 dispersed in phase 2 + autoPtr pair1In2_; - //- Drag model for phase 2 - autoPtr drag2_; + //- Phase pair for phase 2 dispersed in phase 1 + autoPtr pair2In1_; - //- Heat transfer model for phase 1 - autoPtr heatTransfer1_; + //- Blending methods + HashTable, word, word::hash> blendingMethods_; - //- Heat transfer model for phase 2 - autoPtr heatTransfer2_; + //- Drag model + autoPtr > drag_; - //- Lift model for phase 1 - autoPtr lift1_; + //- Virtual mass model + autoPtr > virtualMass_; - //- Lift model for phase 2 - autoPtr lift2_; + //- Heat transfer model + autoPtr > heatTransfer_; - //- Name of the dispersed phase, or "both" - word dispersedPhase_; + //- Lift model + autoPtr > lift_; - //- Residual phase fraction - scalar residualPhaseFraction_; + //- Wall lubrication model + autoPtr > + wallLubrication_; - //- Redisual slip - dimensionedScalar residualSlip_; + //- Wall lubrication model + autoPtr > + turbulentDispersion_; // Private member functions @@ -130,31 +130,39 @@ public: // Constructors //- Construct from fvMesh - twoPhaseSystem(const fvMesh&); + twoPhaseSystem(const fvMesh&, const dimensionedVector& g); //- Destructor - virtual ~twoPhaseSystem() - {} + virtual ~twoPhaseSystem(); // Member Functions - //- Return the drag coefficient - tmp dragCoeff() const; - - //- Return the heat transfer coefficient - tmp heatTransferCoeff() const; - - //- Return the lift force - tmp liftForce(const volVectorField& U) const; - //- Return the mixture density tmp rho() const; //- Return the mixture velocity tmp U() const; + //- Return the drag coefficient + tmp dragCoeff() const; + + //- Return the virtual mass coefficient + tmp virtualMassCoeff() const; + + //- Return the heat transfer coefficient + tmp heatTransferCoeff() const; + + //- Return the lift force + tmp liftForce() const; + + //- Return the wall lubrication force + tmp wallLubricationForce() const; + + //- Return the wall lubrication force + tmp turbulentDispersionForce() const; + //- Solve for the two-phase-fractions void solve(); @@ -169,145 +177,44 @@ public: // Access - //- Return the mesh - const fvMesh& mesh() const - { - return mesh_; - } - - //- Return phase model 1 - const phaseModel& phase1() const - { - return phase1_; - } - - //- Return non-const access to phase model 1 - phaseModel& phase1() - { - return phase1_; - } - - //- Return phase model 2 - const phaseModel& phase2() const - { - return phase2_; - } - - //- Return non-const access to phase model 2 - phaseModel& phase2() - { - return phase2_; - } - - //- Return the phase not given as an argument - const phaseModel& otherPhase(const phaseModel& phase) const - { - if (&phase == &phase1_) - { - return phase2_; - } - else - { - return phase1_; - } - } - - //- Return the mixture flux - const surfaceScalarField& phi() const - { - return phi_; - } - - //- Return non-const access to the the mixture flux - surfaceScalarField& phi() - { - return phi_; - } - - //- Return the dilatation term - const volScalarField& dgdt() const - { - return dgdt_; - } - - //- Return non-const access to the - volScalarField& dgdt() - { - return dgdt_; - } - - //- Return the drag model for phase 1 - const dragModel& drag1() const - { - return drag1_(); - } - - //- Return the drag model for phase 2 - const dragModel& drag2() const - { - return drag2_(); - } - //- Return the drag model for the supplied phase - const dragModel& drag(const phaseModel& phase) const - { - if (&phase == &phase1_) - { - return drag1_(); - } - else - { - return drag2_(); - } - } + const dragModel& drag(const phaseModel& phase) const; - //- Return non-const access to the residual phase fraction - scalar residualPhaseFraction() const - { - return residualPhaseFraction_; - } - - //- Return the residual slip - const dimensionedScalar& residualSlip() const - { - return residualSlip_; - } - - //- Return the heat transfer model for phase 1 - const heatTransferModel& heatTransfer1() const - { - return heatTransfer1_(); - } - - //- Return the heat transfer model for phase 2 - const heatTransferModel& heatTransfer2() const - { - return heatTransfer2_(); - } - - //- Return the lift model for phase 1 - const liftModel& lift1() const - { - return lift1_(); - } - - //- Return the lift model for phase 2 - const liftModel& lift2() const - { - return lift2_(); - } + //- Return the virtual mass model for the supplied phase + const virtualMassModel& virtualMass(const phaseModel& phase) const; //- Return the surface tension coefficient - dimensionedScalar sigma() const - { - return sigma_; - } + const dimensionedScalar& sigma() const; - //- Return the virtual-mass coefficient - dimensionedScalar Cvm() const - { - return Cvm_; - } + //- Return the mesh + inline const fvMesh& mesh() const; + + //- Return phase model 1 + inline const phaseModel& phase1() const; + + //- Return non-const access to phase model 1 + inline phaseModel& phase1(); + + //- Return phase model 2 + inline const phaseModel& phase2() const; + + //- Return non-const access to phase model 2 + inline phaseModel& phase2(); + + //- Return the phase not given as an argument + inline const phaseModel& otherPhase(const phaseModel& phase) const; + + //- Return the mixture flux + inline const surfaceScalarField& phi() const; + + //- Return non-const access to the the mixture flux + inline surfaceScalarField& phi(); + + //- Return the dilatation term + inline const volScalarField& dgdt() const; + + //- Return non-const access to the dilatation parameter + inline volScalarField& dgdt(); }; @@ -317,6 +224,10 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "twoPhaseSystemI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystemI.H b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystemI.H new file mode 100644 index 0000000000..e832b0fa1e --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystemI.H @@ -0,0 +1,98 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 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 . + +\*---------------------------------------------------------------------------*/ + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +inline const Foam::fvMesh& Foam::twoPhaseSystem::mesh() const +{ + return mesh_; +} + + +inline const Foam::phaseModel& Foam::twoPhaseSystem::phase1() const +{ + return phase1_; +} + + +inline Foam::phaseModel& Foam::twoPhaseSystem::phase1() +{ + return phase1_; +} + + +inline const Foam::phaseModel& Foam::twoPhaseSystem::phase2() const +{ + return phase2_; +} + + +inline Foam::phaseModel& Foam::twoPhaseSystem::phase2() +{ + return phase2_; +} + + +inline const Foam::phaseModel& Foam::twoPhaseSystem::otherPhase +( + const phaseModel& phase +) const +{ + if (&phase == &phase1_) + { + return phase2_; + } + else + { + return phase1_; + } +} + + +inline const Foam::surfaceScalarField& Foam::twoPhaseSystem::phi() const +{ + return phi_; +} + + +inline Foam::surfaceScalarField& Foam::twoPhaseSystem::phi() +{ + return phi_; +} + + +inline const Foam::volScalarField& Foam::twoPhaseSystem::dgdt() const +{ + return dgdt_; +} + + +inline Foam::volScalarField& Foam::twoPhaseSystem::dgdt() +{ + return dgdt_; +} + + +// ************************************************************************* // diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C index b0cf1879c1..f3cf4c33dd 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -1340,12 +1340,13 @@ int main(int argc, char *argv[]) const_cast(mesh.time())++; } + refineDriver.doRefine ( refineDict, refineParams, snapParams, - wantSnap, + refineParams.handleSnapProblems(), motionDict ); diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict index 588908550c..2cfd6b7eee 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict @@ -252,7 +252,12 @@ castellatedMeshControls // free-standing zone faces. Not used if there are no faceZones. allowFreeStandingZoneFaces true; - // + + // Optional: do not remove cells likely to give snapping problems + // handleSnapProblems false; + + // Optional: switch off topological test for cells to-be-squashed + // and use geometric test instead //useTopologicalSnapDetection false; } diff --git a/src/TurbulenceModels/phaseIncompressible/LES/Niceno/NicenoKEqn.C b/src/TurbulenceModels/phaseIncompressible/LES/Niceno/NicenoKEqn.C index cadaafc818..07002a6a1e 100644 --- a/src/TurbulenceModels/phaseIncompressible/LES/Niceno/NicenoKEqn.C +++ b/src/TurbulenceModels/phaseIncompressible/LES/Niceno/NicenoKEqn.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,6 +26,7 @@ License #include "NicenoKEqn.H" #include "addToRunTimeSelectionTable.H" #include "twoPhaseSystem.H" +#include "dragModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -181,7 +182,7 @@ tmp NicenoKEqn::bubbleG() const tmp bubbleG ( - Cp_*gas*sqr(magUr)*fluid.drag(gas).K(magUr)/liquid.rho() + Cp_*gas*sqr(magUr)*fluid.drag(gas).K()/liquid.rho() ); return bubbleG; diff --git a/src/TurbulenceModels/phaseIncompressible/LES/continuousGasKEqn/continuousGasKEqn.C b/src/TurbulenceModels/phaseIncompressible/LES/continuousGasKEqn/continuousGasKEqn.C index 6613d81636..b55fa88708 100644 --- a/src/TurbulenceModels/phaseIncompressible/LES/continuousGasKEqn/continuousGasKEqn.C +++ b/src/TurbulenceModels/phaseIncompressible/LES/continuousGasKEqn/continuousGasKEqn.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,6 +25,7 @@ License #include "continuousGasKEqn.H" #include "addToRunTimeSelectionTable.H" +#include "twoPhaseSystem.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/TurbulenceModels/phaseIncompressible/RAS/LaheyKEpsilon/LaheyKEpsilon.C b/src/TurbulenceModels/phaseIncompressible/RAS/LaheyKEpsilon/LaheyKEpsilon.C index 6119b83579..8454103e3b 100644 --- a/src/TurbulenceModels/phaseIncompressible/RAS/LaheyKEpsilon/LaheyKEpsilon.C +++ b/src/TurbulenceModels/phaseIncompressible/RAS/LaheyKEpsilon/LaheyKEpsilon.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,6 +26,7 @@ License #include "LaheyKEpsilon.H" #include "addToRunTimeSelectionTable.H" #include "twoPhaseSystem.H" +#include "dragModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -195,7 +196,7 @@ tmp LaheyKEpsilon::bubbleG() const Cp_ *( pow3(magUr) - + pow(fluid.drag(gas).K(magUr)*gas.d()/liquid.rho(), 4.0/3.0) + + pow(fluid.drag(gas).K()*gas.d()/liquid.rho(), 4.0/3.0) *pow(magUr, 5.0/3.0) ) *gas diff --git a/src/TurbulenceModels/phaseIncompressible/RAS/continuousGasKEpsilon/continuousGasKEpsilon.C b/src/TurbulenceModels/phaseIncompressible/RAS/continuousGasKEpsilon/continuousGasKEpsilon.C index 6fc1832bdf..b6eef98095 100644 --- a/src/TurbulenceModels/phaseIncompressible/RAS/continuousGasKEpsilon/continuousGasKEpsilon.C +++ b/src/TurbulenceModels/phaseIncompressible/RAS/continuousGasKEpsilon/continuousGasKEpsilon.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,6 +25,8 @@ License #include "continuousGasKEpsilon.H" #include "addToRunTimeSelectionTable.H" +#include "twoPhaseSystem.H" +#include "virtualMassModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -200,7 +202,7 @@ continuousGasKEpsilon::rhoEff() const new volScalarField ( IOobject::groupName("rhoEff", this->U_.group()), - gas.rho() + (fluid.Cvm() + 3.0/20.0)*liquid.rho() + gas.rho() + (fluid.virtualMass(gas).Cvm() + 3.0/20.0)*liquid.rho() ) ); } diff --git a/src/TurbulenceModels/phaseIncompressible/RAS/mixtureKEpsilon/mixtureKEpsilon.C b/src/TurbulenceModels/phaseIncompressible/RAS/mixtureKEpsilon/mixtureKEpsilon.C index 1c811169fe..c759c5f6ad 100644 --- a/src/TurbulenceModels/phaseIncompressible/RAS/mixtureKEpsilon/mixtureKEpsilon.C +++ b/src/TurbulenceModels/phaseIncompressible/RAS/mixtureKEpsilon/mixtureKEpsilon.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,6 +26,8 @@ License #include "mixtureKEpsilon.H" #include "bound.H" #include "twoPhaseSystem.H" +#include "dragModel.H" +#include "virtualMassModel.H" #include "fixedValueFvPatchFields.H" #include "inletOutletFvPatchFields.H" #include "fvmSup.H" @@ -378,7 +380,7 @@ tmp mixtureKEpsilon::Ct2() const volScalarField beta ( (6*this->Cmu_/(4*sqrt(3.0/2.0))) - *alphag*fluid.drag(gas).K(magUr)/liquid.rho() + *alphag*fluid.drag(gas).K()/liquid.rho() *(liquidTurbulence.k_/liquidTurbulence.epsilon_) ); volScalarField Ct0((3 + beta)/(1 + beta + 2*gas.rho()/liquid.rho())); @@ -404,7 +406,7 @@ tmp mixtureKEpsilon::rhogEff() const const twoPhaseSystem& fluid = gas.fluid(); return gas.rho() - + fluid.Cvm()*fluid.otherPhase(gas).rho(); + + fluid.virtualMass(gas).Cvm()*fluid.otherPhase(gas).rho(); } @@ -489,7 +491,7 @@ tmp mixtureKEpsilon::bubbleG() const *sqr(liquid)*liquid.rho() *( pow3(magUr) - + pow(fluid.drag(gas).K(magUr)*gas.d()/liquid.rho(), 4.0/3.0) + + pow(fluid.drag(gas).K()*gas.d()/liquid.rho(), 4.0/3.0) *pow(magUr, 5.0/3.0) ) *gas @@ -499,7 +501,7 @@ tmp mixtureKEpsilon::bubbleG() const // Simple model // tmp bubbleG // ( - // Cp_*sqr(liquid)*gas*fluid.drag(gas).K(magUr)*sqr(magUr) + // Cp_*sqr(liquid)*gas*fluid.drag(gas).K()*sqr(magUr) // ); return bubbleG; diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CoBlended/CoBlended.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CoBlended/CoBlended.H index 3f15520061..b282e36c93 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CoBlended/CoBlended.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CoBlended/CoBlended.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -64,6 +64,7 @@ SourceFiles #include "surfaceInterpolationScheme.H" #include "blendedSchemeBase.H" +#include "surfaceInterpolate.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -181,11 +182,6 @@ public: } - //- Destructor - virtual ~CoBlended() - {} - - // Member Functions //- Return the face-based blending factor @@ -195,39 +191,48 @@ public: ) const { const fvMesh& mesh = this->mesh(); + tmp tUflux = faceFlux_; - tmp tbf + if (faceFlux_.dimensions() == dimDensity*dimVelocity*dimArea) + { + // Currently assume that the density field + // corresponding to the mass-flux is named "rho" + const volScalarField& rho = + mesh.objectRegistry::template lookupObject + ("rho"); + + tUflux = faceFlux_/fvc::interpolate(rho); + } + else if (faceFlux_.dimensions() != dimVelocity*dimArea) + { + FatalErrorIn + ( + "CoBlended::blendingFactor()" + ) << "dimensions of faceFlux are not correct" + << exit(FatalError); + } + + return tmp ( new surfaceScalarField ( - IOobject + vf.name() + "BlendingFactor", + scalar(1) + - max ( - vf.name() + "BlendingFactor", - mesh.time().timeName(), - mesh - ), - mesh, - dimensionedScalar("blendingFactor", dimless, 0.0) + min + ( + ( + mesh.time().deltaT()*mesh.deltaCoeffs() + *mag(tUflux)/mesh.magSf() + - Co1_ + )/(Co2_ - Co1_), + scalar(1) + ), + scalar(0) + ) ) ); - - tbf() = - scalar(1) - - max - ( - min - ( - ( - mesh.time().deltaT()*mesh.deltaCoeffs() - *mag(faceFlux_)/mesh.magSf() - - Co1_ - )/(Co2_ - Co1_), - scalar(1) - ), - scalar(0) - ); - - return tbf; } @@ -240,9 +245,6 @@ public: { surfaceScalarField bf(blendingFactor(vf)); - Info<< "weights " << max(bf).value() << " " << min(bf).value() - << endl; - return bf*tScheme1_().weights(vf) + (scalar(1.0) - bf)*tScheme2_().weights(vf); diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/refinementParameters/refinementParameters.C b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/refinementParameters/refinementParameters.C index f9676fcbe6..0ed25cf81c 100644 --- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/refinementParameters/refinementParameters.C +++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/refinementParameters/refinementParameters.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,29 +30,6 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from dictionary -Foam::refinementParameters::refinementParameters -( - const dictionary& dict, - const label dummy -) -: - maxGlobalCells_(readLabel(dict.lookup("cellLimit"))), - maxLocalCells_(readLabel(dict.lookup("procCellLimit"))), - minRefineCells_(readLabel(dict.lookup("minimumRefine"))), - curvature_(readScalar(dict.lookup("curvature"))), - planarAngle_(dict.lookupOrDefault("planarAngle", curvature_)), - nBufferLayers_(readLabel(dict.lookup("nBufferLayers"))), - keepPoints_(dict.lookup("keepPoints")), - allowFreeStandingZoneFaces_(dict.lookup("allowFreeStandingZoneFaces")), - useTopologicalSnapDetection_ - ( - dict.lookupOrDefault("useTopologicalSnapDetection", true) - ), - maxLoadUnbalance_(dict.lookupOrDefault("maxLoadUnbalance", 0)) -{} - - Foam::refinementParameters::refinementParameters(const dictionary& dict) : maxGlobalCells_(readLabel(dict.lookup("maxGlobalCells"))), @@ -73,7 +50,11 @@ Foam::refinementParameters::refinementParameters(const dictionary& dict) ( dict.lookupOrDefault("useTopologicalSnapDetection", true) ), - maxLoadUnbalance_(dict.lookupOrDefault("maxLoadUnbalance", 0)) + maxLoadUnbalance_(dict.lookupOrDefault("maxLoadUnbalance", 0)), + handleSnapProblems_ + ( + dict.lookupOrDefault("handleSnapProblems", true) + ) { scalar featAngle(readScalar(dict.lookup("resolveFeatureAngle"))); diff --git a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/refinementParameters/refinementParameters.H b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/refinementParameters/refinementParameters.H index 427fbd64b1..06b90b0758 100644 --- a/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/refinementParameters/refinementParameters.H +++ b/src/mesh/autoMesh/autoHexMesh/autoHexMeshDriver/refinementParameters/refinementParameters.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -87,6 +87,7 @@ class refinementParameters //- Allowed load unbalance scalar maxLoadUnbalance_; + Switch handleSnapProblems_; // Private Member Functions @@ -101,9 +102,6 @@ public: // Constructors - //- Construct from dictionary - old syntax - refinementParameters(const dictionary& dict, const label dummy); - //- Construct from dictionary - new syntax refinementParameters(const dictionary& dict); @@ -174,6 +172,11 @@ public: return maxLoadUnbalance_; } + bool handleSnapProblems() const + { + return handleSnapProblems_; + } + // Other diff --git a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C index e2f03c4fe2..76bb6150ef 100644 --- a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C +++ b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C @@ -323,7 +323,7 @@ void Foam::meshRefinement::getBafflePatches } -Foam::Map Foam::meshRefinement::getZoneBafflePatches +Foam::Map Foam::meshRefinement::getZoneBafflePatches ( const bool allowBoundary, const labelList& globalToMasterPatch, diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/axis/sixDoFRigidBodyMotionAxisConstraint.C b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/axis/sixDoFRigidBodyMotionAxisConstraint.C index 9154e51216..c577954a36 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/axis/sixDoFRigidBodyMotionAxisConstraint.C +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/axis/sixDoFRigidBodyMotionAxisConstraint.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -80,7 +80,7 @@ void Foam::sixDoFRigidBodyMotionConstraints::axis::constrainRotation pointConstraint& pc ) const { - pc.combine(pointConstraint(Tuple2(2, vector(0,1,0)))); + pc.combine(pointConstraint(Tuple2(2, axis_))); } diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionIO.C b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionIO.C index 11670ba623..f4c0b5b7ed 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionIO.C +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionIO.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -60,14 +60,8 @@ void Foam::sixDoFRigidBodyMotion::write(Ostream& os) const os.writeKeyword("sixDoFRigidBodyMotionRestraint") << restraintType << token::END_STATEMENT << nl; - os.writeKeyword(word(restraintType + "Coeffs")) << nl; - - os << indent << token::BEGIN_BLOCK << nl << incrIndent; - restraints_[rI].write(os); - os << decrIndent << indent << token::END_BLOCK << nl; - os << decrIndent << indent << token::END_BLOCK << endl; } @@ -91,14 +85,8 @@ void Foam::sixDoFRigidBodyMotion::write(Ostream& os) const constraints_[rI].sixDoFRigidBodyMotionConstraint::write(os); - os.writeKeyword(word(constraintType + "Coeffs")) << nl; - - os << indent << token::BEGIN_BLOCK << nl << incrIndent; - constraints_[rI].write(os); - os << decrIndent << indent << token::END_BLOCK << nl; - os << decrIndent << indent << token::END_BLOCK << endl; } diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionSolver/sixDoFRigidBodyMotionSolver.C b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionSolver/sixDoFRigidBodyMotionSolver.C index e08f31d32f..da97394dc4 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionSolver/sixDoFRigidBodyMotionSolver.C +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionSolver/sixDoFRigidBodyMotionSolver.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -105,7 +105,7 @@ Foam::sixDoFRigidBodyMotionSolver::sixDoFRigidBodyMotionSolver { if (rhoName_ == "rhoInf") { - rhoInf_ = readScalar(dict.lookup("rhoInf")); + rhoInf_ = readScalar(coeffDict().lookup("rhoInf")); } // Calculate scaling factor everywhere @@ -202,8 +202,16 @@ void Foam::sixDoFRigidBodyMotionSolver::solve() f.calcForcesMoment(); - uniformDimensionedVectorField g = - db().lookupObject("g"); + dimensionedVector g("g", dimAcceleration, vector::zero); + + if (db().foundObject("g")) + { + g = db().lookupObject("g"); + } + else if (coeffDict().found("g")) + { + coeffDict().lookup("g") >> g; + } // scalar ramp = min(max((this->db().time().value() - 5)/10, 0), 1); scalar ramp = 1.0; diff --git a/tutorials/combustion/fireFoam/les/flameSpreadWaterSuppressionPanel/system/fvSchemes b/tutorials/combustion/fireFoam/les/flameSpreadWaterSuppressionPanel/system/fvSchemes index 460de94032..a5dcaf45b6 100755 --- a/tutorials/combustion/fireFoam/les/flameSpreadWaterSuppressionPanel/system/fvSchemes +++ b/tutorials/combustion/fireFoam/les/flameSpreadWaterSuppressionPanel/system/fvSchemes @@ -28,7 +28,7 @@ gradSchemes divSchemes { default none; - div(phi,U) Gauss filteredLinear2V 0.2 0.05; + div(phi,U) Gauss LUST grad(U); div(phi,k) Gauss limitedLinear 1; div(phi,K) Gauss limitedLinear 1; div(phi,Yi_h) Gauss multivariateSelection diff --git a/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/0/U b/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/0/U index 510508331e..29279adbfe 100644 --- a/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/0/U +++ b/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/0/U @@ -30,7 +30,7 @@ boundaryField outlet { - type inletOutlet; + type pressureInletOutletVelocity; inletValue uniform (0 0 0); value uniform (0 0 0); } diff --git a/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/0/p b/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/0/p index 0f1e50b4b8..ed1ce104ab 100644 --- a/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/0/p +++ b/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/0/p @@ -28,14 +28,12 @@ boundaryField outlet { type waveTransmissive; - field p; phi phi; - rho rho; psi thermo:psi; gamma 1.3; fieldInf 1e5; lInf 0.3; - value uniform 1e5; + value $internalField; } upperWall diff --git a/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/constant/thermophysicalProperties b/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/constant/thermophysicalProperties index 955bebb2d5..392e2e045b 100644 --- a/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/constant/thermophysicalProperties +++ b/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/constant/thermophysicalProperties @@ -15,34 +15,15 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -gasThermoTypes -{ - constant - { - type hePsiThermo; - mixture pureMixture; - transport const; - thermo hConst; - equationOfState perfectGas; - specie specie; - energy sensibleEnthalpy; - } - - janaf - { - type hePsiThermo; - mixture pureMixture; - transport sutherland; - thermo janaf; - equationOfState perfectGas; - specie specie; - energy sensibleEnthalpy; - } -} - thermoType { - ${:gasThermoTypes.constant}; + type hePsiThermo; + mixture pureMixture; + transport const; + thermo eConst; + equationOfState perfectGas; + specie specie; + energy sensibleInternalEnergy; } mixture @@ -54,7 +35,7 @@ mixture } thermodynamics { - Cp 1000; + Cv 712; Hf 0; } transport diff --git a/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/system/controlDict b/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/system/controlDict index 4524b42aa5..06932c9369 100644 --- a/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/system/controlDict +++ b/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/system/controlDict @@ -17,7 +17,7 @@ FoamFile application rhoPimpleFoam; -startFrom latestTime; +startFrom startTime; startTime 0; diff --git a/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/system/fvSchemes b/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/system/fvSchemes index 1b84b2505e..51d3236831 100644 --- a/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/system/fvSchemes +++ b/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/system/fvSchemes @@ -28,9 +28,10 @@ gradSchemes divSchemes { default none; - div(phi,U) Gauss filteredLinear2V 0.2 0; - div(phi,h) Gauss filteredLinear2 0.2 0; + div(phi,U) Gauss LUST grad(U); + div(phi,e) Gauss LUST grad(e); div(phi,K) Gauss linear; + div(phiv,p) Gauss linear; div(phi,k) Gauss limitedLinear 1; div(phi,B) Gauss limitedLinear 1; div(phi,muTilda) Gauss limitedLinear 1; diff --git a/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/system/fvSolution b/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/system/fvSolution index bc41567cc8..bd907a689c 100644 --- a/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/system/fvSolution +++ b/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/system/fvSolution @@ -31,15 +31,15 @@ solvers relTol 0; } - "(U|h|k|nuTilda)" + "(U|e|k|nuTilda)" { - solver PBiCG; - preconditioner DILU; + solver smoothSolver; + smoother symGaussSeidel; tolerance 1e-6; relTol 0.01; } - "(U|h|k|nuTilda)Final" + "(U|e|k|nuTilda)Final" { $U; relTol 0; @@ -63,7 +63,7 @@ relaxationFactors } equations { - "(U|h|k|epsilon|omega).*" 1; + ".*" 1; } } diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctExplicit/system/fvSolution b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctExplicit/system/fvSolution index e2bc9c870d..a61ae9a85d 100644 --- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctExplicit/system/fvSolution +++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctExplicit/system/fvSolution @@ -23,7 +23,7 @@ solvers tolerance 1e-08; relTol 0.05; smoother GaussSeidel; - cacheAgglomeration off; + cacheAgglomeration on; nCellsInCoarsestLevel 20; agglomerator faceAreaPair; mergeLevels 1; diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/system/fvSolution b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/system/fvSolution index 1fb7a16e85..13a08e5e1b 100644 --- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/system/fvSolution +++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/system/fvSolution @@ -23,7 +23,7 @@ solvers tolerance 1e-08; relTol 0.05; smoother GaussSeidel; - cacheAgglomeration off; + cacheAgglomeration on; nCellsInCoarsestLevel 20; agglomerator faceAreaPair; mergeLevels 1; diff --git a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/fvSolution b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/fvSolution index 25b10212a3..c259abc052 100644 --- a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/fvSolution +++ b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/fvSolution @@ -23,7 +23,7 @@ solvers tolerance 1e-08; relTol 0.05; smoother GaussSeidel; - cacheAgglomeration off; + cacheAgglomeration on; nCellsInCoarsestLevel 20; agglomerator faceAreaPair; mergeLevels 1; diff --git a/tutorials/incompressible/pimpleDyMFoam/propeller/Allrun.pre b/tutorials/incompressible/pimpleDyMFoam/propeller/Allrun.pre index e3b951232b..793ccb9c4f 100755 --- a/tutorials/incompressible/pimpleDyMFoam/propeller/Allrun.pre +++ b/tutorials/incompressible/pimpleDyMFoam/propeller/Allrun.pre @@ -15,6 +15,9 @@ runApplication blockMesh runApplication surfaceFeatureExtract runApplication snappyHexMesh -overwrite + +runApplication renumberMesh -overwrite + # force removal of fields generated by snappy \rm -rf 0 cp -rf 0.org 0 diff --git a/tutorials/mesh/moveDynamicMesh/simpleHarmonicMotion/constant/dynamicMeshDict b/tutorials/incompressible/pimpleDyMFoam/propeller/system/Q similarity index 59% rename from tutorials/mesh/moveDynamicMesh/simpleHarmonicMotion/constant/dynamicMeshDict rename to tutorials/incompressible/pimpleDyMFoam/propeller/system/Q index ad68458956..aaf32f8a3b 100644 --- a/tutorials/mesh/moveDynamicMesh/simpleHarmonicMotion/constant/dynamicMeshDict +++ b/tutorials/incompressible/pimpleDyMFoam/propeller/system/Q @@ -5,24 +5,17 @@ | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ -FoamFile + +// Calculate Q (from U) +Q { - version 2.0; - format ascii; - class dictionary; - object motionProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + // Where to load it from + functionObjectLibs ("libutilityFunctionObjects.so"); -dynamicFvMesh dynamicMotionSolverFvMesh; + type Q; -motionSolverLibs ("libfvMotionSolvers.so" "libsixDoFRigidBodyMotion.so"); - -solver displacementLaplacian; - -displacementLaplacianCoeffs -{ - diffusivity inverseDistance (movingBlock); + // Output every + outputControl outputTime; } diff --git a/tutorials/incompressible/pimpleDyMFoam/propeller/system/controlDict b/tutorials/incompressible/pimpleDyMFoam/propeller/system/controlDict index 2dd542c3d5..264b5c1c1b 100644 --- a/tutorials/incompressible/pimpleDyMFoam/propeller/system/controlDict +++ b/tutorials/incompressible/pimpleDyMFoam/propeller/system/controlDict @@ -58,4 +58,12 @@ adjustTimeStep yes; maxCo 2; +functions +{ + #include "readFields" + #include "Q" + #include "surfaces" + #include "forces" +} + // ************************************************************************* // diff --git a/tutorials/mesh/moveDynamicMesh/simpleHarmonicMotion/system/topoSetDict b/tutorials/incompressible/pimpleDyMFoam/propeller/system/forces similarity index 58% rename from tutorials/mesh/moveDynamicMesh/simpleHarmonicMotion/system/topoSetDict rename to tutorials/incompressible/pimpleDyMFoam/propeller/system/forces index cc3385ad76..0349e3e87e 100644 --- a/tutorials/mesh/moveDynamicMesh/simpleHarmonicMotion/system/topoSetDict +++ b/tutorials/incompressible/pimpleDyMFoam/propeller/system/forces @@ -5,34 +5,28 @@ | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ -FoamFile + +forces { - version 2.0; - format ascii; - class dictionary; - object topoSetDict; + type forces; + + functionObjectLibs ( "libforces.so" ); + + outputControl timeStep; + timeInterval 1; + + log yes; + + patches ( "propeller.*" ); + pName p; + UName U; + rhoName rhoInf; // Indicates incompressible + log true; + rhoInf 1; // Redundant for incompressible + + CofR (0 0 0); // Rotation around centre line of propeller + pitchAxis (0 1 0); } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -actions -( - { - name c0; - type cellSet; - action new; - source boxToCell; - sourceInfo - { - box (0.35 0.35 0.44) (0.65 0.65 0.56); - } - } - - { - name c0; - type cellSet; - action invert; - } -); // ************************************************************************* // diff --git a/tutorials/mesh/moveDynamicMesh/simpleHarmonicMotion/system/fvSchemes b/tutorials/incompressible/pimpleDyMFoam/propeller/system/readFields similarity index 58% rename from tutorials/mesh/moveDynamicMesh/simpleHarmonicMotion/system/fvSchemes rename to tutorials/incompressible/pimpleDyMFoam/propeller/system/readFields index 9b11d59f3d..57a93256db 100644 --- a/tutorials/mesh/moveDynamicMesh/simpleHarmonicMotion/system/fvSchemes +++ b/tutorials/incompressible/pimpleDyMFoam/propeller/system/readFields @@ -5,45 +5,16 @@ | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "system"; - object fvSchemes; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -ddtSchemes +// Make sure all fields for functionObjects are loaded. Prevents any +// problems running with execFlowFunctionObjects. +readFields { -} + // Where to load it from (if not already in solver) + functionObjectLibs ("libfieldFunctionObjects.so"); -gradSchemes -{ - default Gauss linear; -} - -divSchemes -{ -} - -laplacianSchemes -{ - default Gauss linear corrected; -} - -interpolationSchemes -{ - default linear; -} - -snGradSchemes -{ -} - -fluxRequired -{ + type readFields; + fields (p U k); } diff --git a/tutorials/incompressible/pimpleDyMFoam/propeller/system/surfaces b/tutorials/incompressible/pimpleDyMFoam/propeller/system/surfaces new file mode 100644 index 0000000000..16d7041a89 --- /dev/null +++ b/tutorials/incompressible/pimpleDyMFoam/propeller/system/surfaces @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +surfaces +{ + type surfaces; + functionObjectLibs ("libsampling.so"); + outputControl outputTime; + + surfaceFormat vtk; + fields ( p U Q); + + interpolationScheme cellPoint; + + surfaces + ( + zNormal + { + type cuttingPlane; + planeType pointAndNormal; + pointAndNormalDict + { + basePoint (0 0 0); + normalVector (0 0 1); + } + interpolate true; + } + + isoQ + { + type isoSurface; + isoField Q; + isoValue 1000; + interpolate true; + } + + propeller + { + type patch; + patches ( "propeller.*" ); + interpolate true; + } + ); +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/0.org/pointDisplacement b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/0.org/pointDisplacement index 0f8d1bdf1f..71924be16e 100644 --- a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/0.org/pointDisplacement +++ b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/0.org/pointDisplacement @@ -23,79 +23,7 @@ boundaryField { wing { - type sixDoFRigidBodyDisplacement; - mass 22.9; - centreOfMass (0.4974612746 -0.01671895744 0.125); - momentOfInertia (1.958864357 3.920839234 2.057121362); - orientation - ( - 0.9953705935 0.09611129781 0 - -0.09611129781 0.9953705935 0 - 0 0 1 - ); - velocity (0 0 0); - acceleration (0 0 0); - angularMomentum (0 0 -2.0); - torque (0 0 0); - rhoName rhoInf; - rhoInf 1; - g (0 -9.81 0); - report on; - constraints - { - maxIterations 500; - - yLine - { - sixDoFRigidBodyMotionConstraint line; - lineCoeffs - { - refPoint (0.25 0.007 0.125); - direction (0 1 0); - } - tolerance 1e-9; - relaxationFactor 0.7; - } - - zAxis - { - sixDoFRigidBodyMotionConstraint axis; - axisCoeffs - { - axis (0 0 1); - } - tolerance 1e-06; - relaxationFactor 0.7; - } - } - restraints - { - verticalSpring - { - sixDoFRigidBodyMotionRestraint linearSpring; - - linearSpringCoeffs - { - anchor (0.25 0.007 0.125); - refAttachmentPt (0.25 0.007 0.125); - stiffness 4000; - damping 2; - restLength 0; - } - } - axialSpring - { - sixDoFRigidBodyMotionRestraint linearAxialAngularSpring; - - linearAxialAngularSpringCoeffs - { - axis (0 0 1); - stiffness 700; - damping 0.5; - referenceOrientation $orientation; - } - } - } + type calculated; value uniform (0 0 0); } diff --git a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/constant/dynamicMeshDict b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/constant/dynamicMeshDict index 82d0874bde..438f0ef0ec 100644 --- a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/constant/dynamicMeshDict +++ b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/constant/dynamicMeshDict @@ -10,19 +10,75 @@ FoamFile version 2.0; format ascii; class dictionary; - object motionProperties; + object dynamicMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dynamicFvMesh dynamicMotionSolverFvMesh; -motionSolverLibs ("libfvMotionSolvers.so" "libsixDoFRigidBodyMotion.so"); +motionSolverLibs ("libsixDoFRigidBodyMotion.so"); -solver displacementLaplacian; +solver sixDoFRigidBodyMotion; -displacementLaplacianCoeffs +sixDoFRigidBodyMotionCoeffs { - diffusivity inverseDistance (wing); + patches (wing); + innerDistance 0.3; + outerDistance 1; + + mass 22.9; + centreOfMass (0.4974612746 -0.01671895744 0.125); + momentOfInertia (1.958864357 3.920839234 2.057121362); + orientation + ( + 0.9953705935 0.09611129781 0 + -0.09611129781 0.9953705935 0 + 0 0 1 + ); + angularMomentum (0 0 -2); + g (0 -9.81 0); + rhoName rhoInf; + rhoInf 1; + report on; + + constraints + { + yLine + { + sixDoFRigidBodyMotionConstraint line; + direction (0 1 0); + } + + zAxis + { + sixDoFRigidBodyMotionConstraint axis; + axis (0 0 1); + } + } + + restraints + { + verticalSpring + { + sixDoFRigidBodyMotionRestraint linearSpring; + + anchor (0.25 0.007 0.125); + refAttachmentPt (0.25 0.007 0.125); + stiffness 4000; + damping 2; + restLength 0; + } + + axialSpring + { + sixDoFRigidBodyMotionRestraint linearAxialAngularSpring; + + axis (0 0 1); + stiffness 700; + damping 0.5; + referenceOrientation $orientation; + } + } } diff --git a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/constant/polyMesh/boundary b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/constant/polyMesh/boundary index 927a3109ec..0dbb06744b 100644 --- a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/constant/polyMesh/boundary +++ b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/constant/polyMesh/boundary @@ -21,40 +21,40 @@ FoamFile { type patch; nFaces 72; - startFace 22911; + startFace 25179; } inlet { type patch; nFaces 40; - startFace 22983; + startFace 25251; } outlet { type patch; nFaces 62; - startFace 23023; + startFace 25291; } front { type empty; inGroups 1(empty); - nFaces 11431; - startFace 23085; + nFaces 12565; + startFace 25353; } back { type empty; inGroups 1(empty); - nFaces 11431; - startFace 34516; + nFaces 12565; + startFace 37918; } wing { type wall; inGroups 1(wall); nFaces 378; - startFace 45947; + startFace 50483; } ) diff --git a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/system/controlDict b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/system/controlDict index 5222f6a60c..6f65d2d656 100644 --- a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/system/controlDict +++ b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_pimpleDyMFoam/system/controlDict @@ -17,7 +17,7 @@ FoamFile application pimpleDyMFoam; -startFrom latestTime; +startFrom startTime; startTime 0; @@ -49,28 +49,4 @@ adjustTimeStep yes; maxCo 0.9; -libs -( - "libOpenFOAM.so" - "libforces.so" -); - -functions -{ - forces - { - type forces; - functionObjectLibs ("libforces.so"); - outputControl timeStep; - outputInterval 10; - patches (wing); - pName p; - UName U; - rhoName rhoInf; - log true; - rhoInf 1; - CofR (0.25 0.007 0.125); - } -} - // ************************************************************************* // diff --git a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_simpleFoam/constant/polyMesh/boundary b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_simpleFoam/constant/polyMesh/boundary index 927a3109ec..0dbb06744b 100644 --- a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_simpleFoam/constant/polyMesh/boundary +++ b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion2D_simpleFoam/constant/polyMesh/boundary @@ -21,40 +21,40 @@ FoamFile { type patch; nFaces 72; - startFace 22911; + startFace 25179; } inlet { type patch; nFaces 40; - startFace 22983; + startFace 25251; } outlet { type patch; nFaces 62; - startFace 23023; + startFace 25291; } front { type empty; inGroups 1(empty); - nFaces 11431; - startFace 23085; + nFaces 12565; + startFace 25353; } back { type empty; inGroups 1(empty); - nFaces 11431; - startFace 34516; + nFaces 12565; + startFace 37918; } wing { type wall; inGroups 1(wall); nFaces 378; - startFace 45947; + startFace 50483; } ) diff --git a/tutorials/incompressible/pisoFoam/les/pitzDailyMapped/system/fvSchemes b/tutorials/incompressible/pisoFoam/les/pitzDailyMapped/system/fvSchemes index 51df032f74..62b8ad368d 100644 --- a/tutorials/incompressible/pisoFoam/les/pitzDailyMapped/system/fvSchemes +++ b/tutorials/incompressible/pisoFoam/les/pitzDailyMapped/system/fvSchemes @@ -28,7 +28,7 @@ gradSchemes divSchemes { default none; - div(phi,U) Gauss filteredLinear2V 0.2 0; + div(phi,U) Gauss LUST grad(U); div(phi,k) Gauss limitedLinear 1; div(phi,B) Gauss limitedLinear 1; div(phi,nuTilda) Gauss limitedLinear 1; diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/system/fvSolution b/tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/system/fvSolution index 7b598444f7..3feda21ae1 100644 --- a/tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/system/fvSolution +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctExplicit/system/fvSolution @@ -23,7 +23,7 @@ solvers tolerance 1e-08; relTol 0.05; smoother GaussSeidel; - cacheAgglomeration off; + cacheAgglomeration on; nCellsInCoarsestLevel 20; agglomerator faceAreaPair; mergeLevels 1; diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/system/fvSolution b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/system/fvSolution index 27f43cb0bd..e0337498e5 100644 --- a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/system/fvSolution +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/system/fvSolution @@ -23,7 +23,7 @@ solvers tolerance 1e-08; relTol 0.05; smoother GaussSeidel; - cacheAgglomeration off; + cacheAgglomeration on; nCellsInCoarsestLevel 20; agglomerator faceAreaPair; mergeLevels 1; diff --git a/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/system/fvSolution b/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/system/fvSolution index 27f43cb0bd..688dee189f 100644 --- a/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/system/fvSolution +++ b/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/system/fvSolution @@ -23,7 +23,7 @@ solvers tolerance 1e-08; relTol 0.05; smoother GaussSeidel; - cacheAgglomeration off; + cacheAgglomeration on; nCellsInCoarsestLevel 20; agglomerator faceAreaPair; mergeLevels 1; @@ -32,7 +32,7 @@ solvers "(U|k|epsilon)" { solver smoothSolver; - smoother GaussSeidel; + smoother symGaussSeidel; nSweeps 2; tolerance 1e-07; relTol 0.1; diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/fvSolution b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/fvSolution index b30a44e775..23f65f64b3 100644 --- a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/fvSolution +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/fvSolution @@ -41,7 +41,7 @@ solvers nPreSweeps 0; nPostSweeps 2; nFinestSweeps 2; - cacheAgglomeration false; + cacheAgglomeration on; nCellsInCoarsestLevel 10; agglomerator faceAreaPair; mergeLevels 1; diff --git a/tutorials/mesh/foamyHexMesh/blob/Allclean b/tutorials/mesh/foamyHexMesh/blob/Allclean index 8a3c5a3f91..63d0864c3d 100755 --- a/tutorials/mesh/foamyHexMesh/blob/Allclean +++ b/tutorials/mesh/foamyHexMesh/blob/Allclean @@ -6,6 +6,8 @@ cd ${0%/*} || exit 1 # run from this directory cleanCase +rm -rf 0 > /dev/null 2>&1 + rm -rf constant/triSurface/blob.stl.gz > /dev/null 2>&1 rm -rf constant/cellAlignments > /dev/null 2>&1 diff --git a/tutorials/mesh/foamyHexMesh/mixerVessel/system/fvSchemes b/tutorials/mesh/foamyHexMesh/mixerVessel/system/fvSchemes index f9e967e839..6ecda2783c 100644 --- a/tutorials/mesh/foamyHexMesh/mixerVessel/system/fvSchemes +++ b/tutorials/mesh/foamyHexMesh/mixerVessel/system/fvSchemes @@ -30,7 +30,7 @@ divSchemes { div(rhoPhi,U) Gauss linearUpwind grad(U); div(phi,alpha) Gauss vanLeer; - div(phirb,alpha) Gauss interfaceCompression 1; + div(phirb,alpha) Gauss linear; div(phid1,p_rgh) Gauss upwind; div(phid2,p_rgh) Gauss upwind; div(rhoPhi,T) Gauss linearUpwind unlimited; diff --git a/tutorials/mesh/foamyHexMesh/simpleShapes/Allrun b/tutorials/mesh/foamyHexMesh/simpleShapes/Allrun index 497c84f91f..8d0a8f27c6 100755 --- a/tutorials/mesh/foamyHexMesh/simpleShapes/Allrun +++ b/tutorials/mesh/foamyHexMesh/simpleShapes/Allrun @@ -23,6 +23,9 @@ runApplication surfaceBooleanFeatures intersection \ runApplication foamyHexMesh runApplication collapseEdges -latestTime -collapseFaceSet indirectPatchFaces +mv log.collapseEdges log.collapseFaceSet + +runApplication collapseEdges -latestTime -collapseFaces # ----------------------------------------------------------------- end-of-file diff --git a/tutorials/mesh/foamyQuadMesh/OpenCFD/constant/polyMesh/boundary b/tutorials/mesh/foamyQuadMesh/OpenCFD/constant/polyMesh/boundary deleted file mode 100644 index 35a7bfe82c..0000000000 --- a/tutorials/mesh/foamyQuadMesh/OpenCFD/constant/polyMesh/boundary +++ /dev/null @@ -1,66 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class polyBoundaryMesh; - location "constant/polyMesh"; - object boundary; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -7 -( - letters_text - { - type patch; - nFaces 1064; - startFace 132063; - } - box_bottom - { - type patch; - nFaces 324; - startFace 133127; - } - box_top - { - type patch; - nFaces 324; - startFace 133451; - } - box_inlet - { - type patch; - nFaces 207; - startFace 133775; - } - box_outlet - { - type patch; - nFaces 207; - startFace 133982; - } - front - { - type empty; - inGroups 1(empty); - nFaces 64792; - startFace 134189; - } - back - { - type empty; - inGroups 1(empty); - nFaces 64792; - startFace 198981; - } -) - -// ************************************************************************* // diff --git a/tutorials/mesh/moveDynamicMesh/simpleHarmonicMotion/0.org/pointDisplacement b/tutorials/mesh/moveDynamicMesh/simpleHarmonicMotion/0.org/pointDisplacement deleted file mode 100644 index 09efbce074..0000000000 --- a/tutorials/mesh/moveDynamicMesh/simpleHarmonicMotion/0.org/pointDisplacement +++ /dev/null @@ -1,80 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class pointVectorField; - location "0.01"; - object pointDisplacement; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 1 0 0 0 0 0]; - -internalField uniform (0 0 0); - -boundaryField -{ - stationaryWalls - { - type fixedValue; - value uniform (0 0 0); - } - movingBlock - { - type uncoupledSixDoFRigidBodyDisplacement; - centreOfMass (0.5 0.5 0.5); - momentOfInertia (0.1052 0.1052 0.1778); - mass 9.6; - velocity (0 0 0); - acceleration (0 0 0); - angularMomentum (0 0 0); - torque (0 0 0); - gravity (0 0 0); - rhoInf 1; - report on; - restraints - { - topSpring - { - sixDoFRigidBodyMotionRestraint linearSpring; - - linearSpringCoeffs - { - anchor (0.5 0.5 1); - refAttachmentPt $centreOfMass; - stiffness 5000; - damping 50; - restLength 0.4; - } - } - } - constraints - { - fixedOrientation - { - sixDoFRigidBodyMotionConstraint orientation; - } - - zLine - { - sixDoFRigidBodyMotionConstraint line; - - lineCoeffs - { - direction (0 0 1); - } - } - } - value uniform (0 0 0); - } -} - - -// ************************************************************************* // diff --git a/tutorials/mesh/moveDynamicMesh/simpleHarmonicMotion/Allclean b/tutorials/mesh/moveDynamicMesh/simpleHarmonicMotion/Allclean deleted file mode 100755 index b134761b23..0000000000 --- a/tutorials/mesh/moveDynamicMesh/simpleHarmonicMotion/Allclean +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # run from this directory - -# Source tutorial clean functions -. $WM_PROJECT_DIR/bin/tools/CleanFunctions - -rm -rf 0 t_vs_cm t_vs_lv shm.eps > /dev/null 2>&1 - -cleanCase - -# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/mesh/moveDynamicMesh/simpleHarmonicMotion/Allrun b/tutorials/mesh/moveDynamicMesh/simpleHarmonicMotion/Allrun deleted file mode 100755 index a0ea6affe8..0000000000 --- a/tutorials/mesh/moveDynamicMesh/simpleHarmonicMotion/Allrun +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -cd ${0%/*} || exit 1 # run from this directory - -# Source tutorial run functions -. $WM_PROJECT_DIR/bin/tools/RunFunctions - -# Set application name -application=`getApplication` - -runApplication blockMesh -runApplication topoSet -runApplication subsetMesh -overwrite c0 -patch movingBlock -cp -r 0.org 0 > /dev/null 2>&1 -runApplication $application -./extractData log.$application -gnuplot shm.gnuplot - -# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/mesh/moveDynamicMesh/simpleHarmonicMotion/constant/polyMesh/blockMeshDict b/tutorials/mesh/moveDynamicMesh/simpleHarmonicMotion/constant/polyMesh/blockMeshDict deleted file mode 100644 index 93055e5f82..0000000000 --- a/tutorials/mesh/moveDynamicMesh/simpleHarmonicMotion/constant/polyMesh/blockMeshDict +++ /dev/null @@ -1,66 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - object blockMeshDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -convertToMeters 1; - -vertices -( - (0 0 0) - (1 0 0) - (1 1 0) - (0 1 0) - (0 0 1) - (1 0 1) - (1 1 1) - (0 1 1) -); - -blocks -( - hex (0 1 2 3 4 5 6 7) (9 9 14) simpleGrading (1 1 1) -); - -edges -( -); - -boundary -( - stationaryWalls - { - type patch; - faces - ( - (0 3 2 1) - (2 6 5 1) - (1 5 4 0) - (3 7 6 2) - (0 4 7 3) - (4 5 6 7) - ); - } - movingBlock - { - type patch; - faces (); - } -); - -mergePatchPairs -( -); - -// ************************************************************************* // diff --git a/tutorials/mesh/moveDynamicMesh/simpleHarmonicMotion/extractData b/tutorials/mesh/moveDynamicMesh/simpleHarmonicMotion/extractData deleted file mode 100755 index a3c02808aa..0000000000 --- a/tutorials/mesh/moveDynamicMesh/simpleHarmonicMotion/extractData +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -#------------------------------------------------------------------------------ -# ========= | -# \\ / 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 . -# -# Script -# extractData -# -# Description -# Extracts motion data from a simple harmonic motion dynamicMesh case -# -#------------------------------------------------------------------------------ - -grep "Centre of mass" $1 | cut -d ":" -f 2 | cut -d " " -f 4 | tr -d ")" > cM -grep "Linear velocity" $1 | cut -d ":" -f 2 | cut -d " " -f 4 | tr -d ")" > lV -grep -e "^Time = " $1 | cut -d " " -f 3 > times - -paste times cM > t_vs_cm -paste times lV > t_vs_lv - -rm cM lV times - -#------------------------------------------------------------------------------ \ No newline at end of file diff --git a/tutorials/mesh/moveDynamicMesh/simpleHarmonicMotion/shm.gnuplot b/tutorials/mesh/moveDynamicMesh/simpleHarmonicMotion/shm.gnuplot deleted file mode 100644 index 270a7f2257..0000000000 --- a/tutorials/mesh/moveDynamicMesh/simpleHarmonicMotion/shm.gnuplot +++ /dev/null @@ -1,76 +0,0 @@ -#------------------------------------------------------------------------------ -# ========= | -# \\ / 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 . -# -# Script -# shm.gnuplot -# -# Description -# Creates an .eps graph of OpenFOAM results vs analytical solution -# for a simple harmonic motion dynamicMesh case -# -#------------------------------------------------------------------------------ - -reset - -set samples 2000 - -k = 5000.0 -m = 9.6 -c = 50.0 -a = -0.1 - -omega = sqrt(k/m) -zeta = c/(2.0*m*omega) - -phi = atan((sqrt(1.0 - zeta**2))/zeta) -A = a/sin(phi) - -pos(A, t, omega, phi, zeta) = A*exp(-zeta*omega*t)*sin(sqrt(1-zeta**2)*omega*t + phi) -vel(A, t, omega, phi, zeta) = \ -A*exp(-zeta*omega*t)*\ -( \ - sqrt(1-zeta**2)*omega*cos(sqrt(1-zeta**2)*omega*t + phi) \ -- zeta*omega*sin(sqrt(1-zeta**2)*omega*t + phi) \ -) - -set xlabel "Time/[s]" -set ylabel "Position" - -set ytics nomirror -set y2tics - -set yrange [-0.1:0.1] -set y2range [-2:2] - -set xzeroaxis - -set terminal postscript eps color enhanced solid -set output "shm.eps" - -plot \ - "t_vs_cm" u 1:($2 - 0.6) w l t "Simulation, centre of mass relative to start", \ - pos(A, x, omega, phi, zeta) w l t "Analytical solution, centre of mass", \ - "t_vs_lv" u 1:2 w l axes x1y2 t "Simulation, vertical velocity", \ - vel(A, x, omega, phi, zeta) w l axes x1y2 t "Analytical solution, vertical velocity" - -#------------------------------------------------------------------------------ diff --git a/tutorials/mesh/moveDynamicMesh/simpleHarmonicMotion/system/controlDict b/tutorials/mesh/moveDynamicMesh/simpleHarmonicMotion/system/controlDict deleted file mode 100644 index bcc70cf1e2..0000000000 --- a/tutorials/mesh/moveDynamicMesh/simpleHarmonicMotion/system/controlDict +++ /dev/null @@ -1,61 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "system"; - object controlDict; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -application moveDynamicMesh; - -startFrom startTime; - -startTime 0; - -stopAt endTime; - -endTime 4; - -deltaT 0.002; - -writeControl adjustableRunTime; - -writeInterval 0.25; - -purgeWrite 0; - -writeFormat ascii; - -writePrecision 12; - -writeCompression uncompressed; - -timeFormat general; - -timePrecision 6; - -runTimeModifiable yes; - -adjustTimeStep yes; - -maxCo 0.2; - -maxDeltaT 0.025; - -libs -( - "libOpenFOAM.so" - "libincompressibleRASModels.so" - "libforces.so" -); - -// ************************************************************************* // diff --git a/tutorials/mesh/moveDynamicMesh/simpleHarmonicMotion/system/fvSolution b/tutorials/mesh/moveDynamicMesh/simpleHarmonicMotion/system/fvSolution deleted file mode 100644 index 209b3b035f..0000000000 --- a/tutorials/mesh/moveDynamicMesh/simpleHarmonicMotion/system/fvSolution +++ /dev/null @@ -1,34 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "system"; - object fvSolution; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -solvers -{ - cellDisplacement - { - solver GAMG; - tolerance 1e-06; - relTol 0; - smoother GaussSeidel; - cacheAgglomeration true; - nCellsInCoarsestLevel 10; - agglomerator faceAreaPair; - mergeLevels 1; - } -} - - -// ************************************************************************* // diff --git a/tutorials/multiphase/LTSInterFoam/wigleyHull/system/fvSchemes b/tutorials/multiphase/LTSInterFoam/wigleyHull/system/fvSchemes index da652a662a..aaf9168e32 100644 --- a/tutorials/multiphase/LTSInterFoam/wigleyHull/system/fvSchemes +++ b/tutorials/multiphase/LTSInterFoam/wigleyHull/system/fvSchemes @@ -29,7 +29,7 @@ divSchemes { div(rhoPhi,U) Gauss linearUpwind grad(U); div(phi,alpha) Gauss vanLeer; - div(phirb,alpha) Gauss interfaceCompression; + div(phirb,alpha) Gauss linear; div(phi,k) Gauss upwind; div(phi,omega) Gauss upwind; div((muEff*dev(T(grad(U))))) Gauss linear; diff --git a/tutorials/multiphase/MRFInterFoam/mixerVessel2D/system/fvSchemes b/tutorials/multiphase/MRFInterFoam/mixerVessel2D/system/fvSchemes index e6b91940f0..a90bcae2d3 100644 --- a/tutorials/multiphase/MRFInterFoam/mixerVessel2D/system/fvSchemes +++ b/tutorials/multiphase/MRFInterFoam/mixerVessel2D/system/fvSchemes @@ -29,7 +29,7 @@ divSchemes { div(rhoPhi,U) Gauss linear; div(phi,alpha) Gauss vanLeer; - div(phirb,alpha) Gauss interfaceCompression; + div(phirb,alpha) Gauss linear; div((muEff*dev(T(grad(U))))) Gauss linear; } diff --git a/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/system/fvSchemes b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/system/fvSchemes index 8c39152314..9f1495f172 100644 --- a/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/system/fvSchemes +++ b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/system/fvSchemes @@ -29,7 +29,7 @@ divSchemes { div(rhoPhi,U) Gauss limitedLinearV 1; div(phi,alpha) Gauss vanLeer; - div(phirb,alpha) Gauss interfaceCompression; + div(phirb,alpha) Gauss linear; div((muEff*dev(T(grad(U))))) Gauss linear; } diff --git a/tutorials/multiphase/compressibleInterDyMFoam/ras/sloshingTank2D/system/fvSchemes b/tutorials/multiphase/compressibleInterDyMFoam/ras/sloshingTank2D/system/fvSchemes index 85be6a2abe..0e66203335 100644 --- a/tutorials/multiphase/compressibleInterDyMFoam/ras/sloshingTank2D/system/fvSchemes +++ b/tutorials/multiphase/compressibleInterDyMFoam/ras/sloshingTank2D/system/fvSchemes @@ -28,7 +28,7 @@ gradSchemes divSchemes { div(phi,alpha) Gauss vanLeer; - div(phirb,alpha) Gauss interfaceCompression 1; + div(phirb,alpha) Gauss linear; div(rhoPhi,U) Gauss vanLeerV; div(phi,thermo:rho.water) Gauss linear; diff --git a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/system/fvSchemes b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/system/fvSchemes index 2003e43e50..273c37e720 100644 --- a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/system/fvSchemes +++ b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/system/fvSchemes @@ -28,7 +28,7 @@ gradSchemes divSchemes { div(phi,alpha) Gauss vanLeer; - div(phirb,alpha) Gauss interfaceCompression 1; + div(phirb,alpha) Gauss linear; div(rhoPhi,U) Gauss upwind; div(phi,thermo:rho.water) Gauss upwind; diff --git a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/system/fvSolution b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/system/fvSolution index 60308edee5..62218a50fb 100644 --- a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/system/fvSolution +++ b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/system/fvSolution @@ -41,7 +41,7 @@ solvers nPreSweeps 0; nPostSweeps 2; nFinestSweeps 2; - cacheAgglomeration false; + cacheAgglomeration true; nCellsInCoarsestLevel 10; agglomerator faceAreaPair; mergeLevels 1; diff --git a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/system/fvSchemes b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/system/fvSchemes index 2003e43e50..273c37e720 100644 --- a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/system/fvSchemes +++ b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/system/fvSchemes @@ -28,7 +28,7 @@ gradSchemes divSchemes { div(phi,alpha) Gauss vanLeer; - div(phirb,alpha) Gauss interfaceCompression 1; + div(phirb,alpha) Gauss linear; div(rhoPhi,U) Gauss upwind; div(phi,thermo:rho.water) Gauss upwind; diff --git a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/system/fvSolution b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/system/fvSolution index 7a04bf3624..563ce52459 100644 --- a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/system/fvSolution +++ b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/system/fvSolution @@ -36,7 +36,7 @@ solvers nPreSweeps 0; nPostSweeps 2; nFinestSweeps 2; - cacheAgglomeration false; + cacheAgglomeration true; nCellsInCoarsestLevel 10; agglomerator faceAreaPair; mergeLevels 1; diff --git a/tutorials/multiphase/compressibleMultiphaseInterFoam/laminar/damBreak4phase/system/fvSchemes b/tutorials/multiphase/compressibleMultiphaseInterFoam/laminar/damBreak4phase/system/fvSchemes index fd25001435..0fb6563e2c 100644 --- a/tutorials/multiphase/compressibleMultiphaseInterFoam/laminar/damBreak4phase/system/fvSchemes +++ b/tutorials/multiphase/compressibleMultiphaseInterFoam/laminar/damBreak4phase/system/fvSchemes @@ -29,7 +29,7 @@ divSchemes { div(rhoPhi,U) Gauss upwind; div(phi,alpha) Gauss vanLeer; - div(phirb,alpha) Gauss interfaceCompression; + div(phirb,alpha) Gauss linear; "div\(phi,.*rho.*\)" Gauss upwind; div(rhoPhi,T) Gauss upwind; div(rhoPhi,K) Gauss upwind; diff --git a/tutorials/multiphase/compressibleMultiphaseInterFoam/laminar/damBreak4phase/system/fvSolution b/tutorials/multiphase/compressibleMultiphaseInterFoam/laminar/damBreak4phase/system/fvSolution index 6f88113f81..bd2ac2e9f9 100644 --- a/tutorials/multiphase/compressibleMultiphaseInterFoam/laminar/damBreak4phase/system/fvSolution +++ b/tutorials/multiphase/compressibleMultiphaseInterFoam/laminar/damBreak4phase/system/fvSolution @@ -29,10 +29,10 @@ solvers nPreSweeps 0; nPostSweeps 2; nFinestSweeps 2; - cacheAgglomeration off; + cacheAgglomeration on; nCellsInCoarsestLevel 10; agglomerator faceAreaPair; - mergeLevels 2; + mergeLevels 1; } tolerance 1e-05; relTol 0; diff --git a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/fvSchemes b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/fvSchemes index 6a01390f25..9fe758f3d1 100644 --- a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/fvSchemes +++ b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/system/fvSchemes @@ -29,7 +29,7 @@ divSchemes { div(rhoPhi,U) Gauss upwind; div(phi,alpha) Gauss vanLeer; - div(phirb,alpha) Gauss interfaceCompression; + div(phirb,alpha) Gauss linear; div((muEff*dev(T(grad(U))))) Gauss linear; } diff --git a/tutorials/multiphase/interDyMFoam/ras/floatingObject/system/fvSchemes b/tutorials/multiphase/interDyMFoam/ras/floatingObject/system/fvSchemes index df7685da65..88424a730c 100644 --- a/tutorials/multiphase/interDyMFoam/ras/floatingObject/system/fvSchemes +++ b/tutorials/multiphase/interDyMFoam/ras/floatingObject/system/fvSchemes @@ -29,7 +29,7 @@ divSchemes { div(rhoPhi,U) Gauss vanLeerV; div(phi,alpha) Gauss vanLeer; - div(phirb,alpha) Gauss interfaceCompression; + div(phirb,alpha) Gauss linear; div(phi,k) Gauss upwind; div(phi,epsilon) Gauss upwind; div((muEff*dev(T(grad(U))))) Gauss linear; diff --git a/tutorials/multiphase/interDyMFoam/ras/mixerVesselAMI/system/fvSchemes b/tutorials/multiphase/interDyMFoam/ras/mixerVesselAMI/system/fvSchemes index 84e4f5d57d..bf1d065bca 100644 --- a/tutorials/multiphase/interDyMFoam/ras/mixerVesselAMI/system/fvSchemes +++ b/tutorials/multiphase/interDyMFoam/ras/mixerVesselAMI/system/fvSchemes @@ -30,7 +30,7 @@ divSchemes { div(rhoPhi,U) Gauss linearUpwind grad(U); div(phi,alpha) Gauss vanLeer; - div(phirb,alpha) Gauss interfaceCompression 1; + div(phirb,alpha) Gauss linear; div(phid1,p_rgh) Gauss upwind; div(phid2,p_rgh) Gauss upwind; div(rhoPhi,T) Gauss linearUpwind unlimited; diff --git a/tutorials/multiphase/interFoam/laminar/capillaryRise/system/fvSchemes b/tutorials/multiphase/interFoam/laminar/capillaryRise/system/fvSchemes index ef8581b85f..cdfd201c6e 100644 --- a/tutorials/multiphase/interFoam/laminar/capillaryRise/system/fvSchemes +++ b/tutorials/multiphase/interFoam/laminar/capillaryRise/system/fvSchemes @@ -29,7 +29,7 @@ divSchemes { div(rhoPhi,U) Gauss upwind; div(phi,alpha) Gauss vanLeer; - div(phirb,alpha) Gauss interfaceCompression; + div(phirb,alpha) Gauss linear; div((muEff*dev(T(grad(U))))) Gauss linear; } diff --git a/tutorials/multiphase/interFoam/laminar/damBreak/system/fvSchemes b/tutorials/multiphase/interFoam/laminar/damBreak/system/fvSchemes index 672ec59cc1..cdd6f1ed15 100644 --- a/tutorials/multiphase/interFoam/laminar/damBreak/system/fvSchemes +++ b/tutorials/multiphase/interFoam/laminar/damBreak/system/fvSchemes @@ -27,9 +27,9 @@ gradSchemes divSchemes { - div(rhoPhi,U) Gauss limitedLinearV 1; + div(rhoPhi,U) Gauss linearUpwind grad(U); div(phi,alpha) Gauss vanLeer; - div(phirb,alpha) Gauss interfaceCompression; + div(phirb,alpha) Gauss linear; div((muEff*dev(T(grad(U))))) Gauss linear; } diff --git a/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/fvSchemes b/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/fvSchemes index 21e1243948..ddc0a7b6e4 100644 --- a/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/fvSchemes +++ b/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/fvSchemes @@ -29,7 +29,7 @@ divSchemes { div(rhoPhi,U) Gauss linear; div(phi,alpha) Gauss vanLeer; - div(phirb,alpha) Gauss interfaceCompression; + div(phirb,alpha) Gauss linear; div(phi,k) Gauss limitedLinear 1; div(phi,B) Gauss limitedLinear 1; div(B) Gauss linear; diff --git a/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/fvSolution b/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/fvSolution index 479dee58a2..cb839db99a 100644 --- a/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/fvSolution +++ b/tutorials/multiphase/interFoam/les/nozzleFlow2D/system/fvSolution @@ -36,7 +36,7 @@ solvers nPreSweeps 0; nPostSweeps 2; nFinestSweeps 2; - cacheAgglomeration false; + cacheAgglomeration true; nCellsInCoarsestLevel 10; agglomerator faceAreaPair; mergeLevels 1; diff --git a/tutorials/multiphase/interFoam/ras/damBreak/system/fvSchemes b/tutorials/multiphase/interFoam/ras/damBreak/system/fvSchemes index ca2cd3a2b8..86fad259ec 100644 --- a/tutorials/multiphase/interFoam/ras/damBreak/system/fvSchemes +++ b/tutorials/multiphase/interFoam/ras/damBreak/system/fvSchemes @@ -29,7 +29,7 @@ divSchemes { div(rhoPhi,U) Gauss linear; div(phi,alpha) Gauss vanLeer; - div(phirb,alpha) Gauss interfaceCompression; + div(phirb,alpha) Gauss linear; div(phi,k) Gauss upwind; div(phi,epsilon) Gauss upwind; div(phi,R) Gauss upwind; diff --git a/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/system/fvSchemes b/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/system/fvSchemes index ca2cd3a2b8..86fad259ec 100644 --- a/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/system/fvSchemes +++ b/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/system/fvSchemes @@ -29,7 +29,7 @@ divSchemes { div(rhoPhi,U) Gauss linear; div(phi,alpha) Gauss vanLeer; - div(phirb,alpha) Gauss interfaceCompression; + div(phirb,alpha) Gauss linear; div(phi,k) Gauss upwind; div(phi,epsilon) Gauss upwind; div(phi,R) Gauss upwind; diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/fvSchemes b/tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/fvSchemes index 803b55e995..a05ac072d7 100644 --- a/tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/fvSchemes +++ b/tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/fvSchemes @@ -29,7 +29,7 @@ divSchemes { div(rhoPhi,U) Gauss linearUpwind grad(U); div(phi,alpha) Gauss vanLeer; - div(phirb,alpha) Gauss interfaceCompression; + div(phirb,alpha) Gauss linear; div(phi,k) Gauss upwind; div(phi,omega) Gauss upwind; div((muEff*dev(T(grad(U))))) Gauss linear; diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/fvSolution b/tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/fvSolution index cc69de4db5..1dd68d3063 100644 --- a/tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/fvSolution +++ b/tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/fvSolution @@ -36,7 +36,7 @@ solvers nPreSweeps 0; nPostSweeps 2; nFinestSweeps 2; - cacheAgglomeration false; + cacheAgglomeration true; nCellsInCoarsestLevel 10; agglomerator faceAreaPair; mergeLevels 1; diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/system/fvSchemes b/tutorials/multiphase/interFoam/ras/waterChannel/system/fvSchemes index 053e51aa7f..706b90b7b3 100644 --- a/tutorials/multiphase/interFoam/ras/waterChannel/system/fvSchemes +++ b/tutorials/multiphase/interFoam/ras/waterChannel/system/fvSchemes @@ -31,7 +31,7 @@ divSchemes div(rhoPhi,U) Gauss linearUpwind grad(U); div(phi,alpha) Gauss vanLeer; - div(phirb,alpha) Gauss interfaceCompression; + div(phirb,alpha) Gauss linear; "div\(phi,(k|omega)\)" Gauss upwind; div((muEff*dev(T(grad(U))))) Gauss linear; diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/system/fvSolution b/tutorials/multiphase/interFoam/ras/waterChannel/system/fvSolution index 1a7bff2000..ba6bfb0754 100644 --- a/tutorials/multiphase/interFoam/ras/waterChannel/system/fvSolution +++ b/tutorials/multiphase/interFoam/ras/waterChannel/system/fvSolution @@ -44,7 +44,7 @@ solvers nPreSweeps 0; nPostSweeps 2; nFinestSweeps 2; - cacheAgglomeration false; + cacheAgglomeration true; nCellsInCoarsestLevel 10; agglomerator faceAreaPair; mergeLevels 1; diff --git a/tutorials/multiphase/interFoam/ras/weirOverflow/system/fvSchemes b/tutorials/multiphase/interFoam/ras/weirOverflow/system/fvSchemes index 3869ad107b..a23cf9d48b 100644 --- a/tutorials/multiphase/interFoam/ras/weirOverflow/system/fvSchemes +++ b/tutorials/multiphase/interFoam/ras/weirOverflow/system/fvSchemes @@ -29,7 +29,7 @@ divSchemes { div(rhoPhi,U) Gauss linear; div(phi,alpha) Gauss vanLeer; - div(phirb,alpha) Gauss interfaceCompression; + div(phirb,alpha) Gauss linear; div(phi,k) Gauss upwind; div(phi,epsilon) Gauss upwind; div(phi,R) Gauss upwind; diff --git a/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/fvSchemes b/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/fvSchemes index 1de7b2421d..31b1e85b56 100644 --- a/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/fvSchemes +++ b/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/fvSchemes @@ -29,7 +29,7 @@ divSchemes { div(rhoPhi,U) Gauss limitedLinearV 1; div(phi,alpha) Gauss vanLeer; - div(phirb,alpha) Gauss interfaceCompression; + div(phirb,alpha) Gauss linear; div((muEff*dev(T(grad(U))))) Gauss linear; } diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/system/fvSchemes b/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/system/fvSchemes index e60864d7f5..b14f07a132 100644 --- a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/system/fvSchemes +++ b/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/system/fvSchemes @@ -31,7 +31,7 @@ divSchemes default none; div(phi,alpha) Gauss vanLeer; - div(phirb,alpha) Gauss interfaceCompression; + div(phirb,alpha) Gauss linear; UD Gauss upwind; div(rhoPhi,U) Gauss linearUpwind grad(U); div(phi,k) Gauss upwind; diff --git a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/fvSchemes b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/fvSchemes index bc5571af9e..2c2507cfbf 100644 --- a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/fvSchemes +++ b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/fvSchemes @@ -31,7 +31,7 @@ divSchemes div(phi,omega) Gauss linearUpwind grad(omega); div(phi,k) Gauss linearUpwind grad(k); div(phi,alpha) Gauss vanLeer; - div(phirb,alpha) Gauss interfaceCompression; + div(phirb,alpha) Gauss linear; div((muEff*dev(T(grad(U))))) Gauss linear; } diff --git a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/fvSolution b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/fvSolution index f19f2cd8b2..6e09921b2e 100644 --- a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/fvSolution +++ b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/fvSolution @@ -81,7 +81,7 @@ solvers nPostSweeps 2; nFinestSweeps 2; - cacheAgglomeration false; + cacheAgglomeration true; nCellsInCoarsestLevel 10; agglomerator faceAreaPair; mergeLevels 1; diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/fvSchemes b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/fvSchemes index 48eb9c4f98..69de4bdbcd 100644 --- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/fvSchemes +++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/fvSchemes @@ -31,7 +31,7 @@ divSchemes { div(rhoPhi,U) Gauss upwind; div(phi,alpha) Gauss vanLeer; - div(phirb,alpha) Gauss interfaceCompression; + div(phirb,alpha) Gauss linear; div((muEff*dev(T(grad(U))))) Gauss linear; } diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/fvSchemes b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/fvSchemes index 48eb9c4f98..69de4bdbcd 100644 --- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/fvSchemes +++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/fvSchemes @@ -31,7 +31,7 @@ divSchemes { div(rhoPhi,U) Gauss upwind; div(phi,alpha) Gauss vanLeer; - div(phirb,alpha) Gauss interfaceCompression; + div(phirb,alpha) Gauss linear; div((muEff*dev(T(grad(U))))) Gauss linear; } diff --git a/tutorials/multiphase/twoPhaseEulerFoam/LES/bubbleColumn/constant/phaseProperties b/tutorials/multiphase/twoPhaseEulerFoam/LES/bubbleColumn/constant/phaseProperties index 443b39213e..48d8185c6a 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/LES/bubbleColumn/constant/phaseProperties +++ b/tutorials/multiphase/twoPhaseEulerFoam/LES/bubbleColumn/constant/phaseProperties @@ -36,47 +36,124 @@ water } } -// Surface tension coefficient -sigma 0.07; +blending +{ + default + { + type linear; + residualAlpha 1e-6; + maxFullyDispersedAlpha.air 0.3; + maxPartlyDispersedAlpha.air 0.5; + maxFullyDispersedAlpha.water 0.3; + maxPartlyDispersedAlpha.water 0.5; + } +} + +sigma +( + (air and water) 0.07 +); + +aspectRatio +( + (air in water) + { + type constant; + E0 1.0; + } + + (water in air) + { + type constant; + E0 1.0; + } +); drag -{ - air SchillerNaumann; - water SchillerNaumann; -} +( + (air in water) + { + type SchillerNaumann; + residualAlpha 1e-6; + residualSlip 1e-3; + residualRe 1e-3; + swarmCorrection + { + type none; + } + } + + (water in air) + { + type SchillerNaumann; + residualAlpha 1e-6; + residualSlip 1e-3; + residualRe 1e-3; + swarmCorrection + { + type none; + } + } + + (air and water) + { + type segregated; + residualAlpha 1e-6; + residualSlip 1e-3; + residualRe 1e-3; + m 0.5; + n 8; + swarmCorrection + { + type none; + } + } +); + +virtualMass +( + (air in water) + { + type constantCoefficient; + Cvm 0.5; + } + + (water in air) + { + type constantCoefficient; + Cvm 0.5; + } +); heatTransfer -{ - air RanzMarshall; - water RanzMarshall; -} +( + (air in water) + { + type RanzMarshall; + residualRe 1e-3; + } + + (water in air) + { + type RanzMarshall; + residualRe 1e-3; + } +); lift -{ - air - { - type none; - } - water - { - type none; - } -} +( +); -dispersedPhase both; +wallLubrication +( +); -residualPhaseFraction 1e-3; -residualSlip 1e-2; - -// Virtual-mass coefficient -Cvm 0.5; - -// Dispersed-phase turbulence coefficient -Ct 1; +turbulentDispersion +( +); // Minimum allowable pressure pMin 10000; - // ************************************************************************* // diff --git a/tutorials/multiphase/twoPhaseEulerFoam/RAS/bubbleColumn/constant/phaseProperties b/tutorials/multiphase/twoPhaseEulerFoam/RAS/bubbleColumn/constant/phaseProperties index 443b39213e..48d8185c6a 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/RAS/bubbleColumn/constant/phaseProperties +++ b/tutorials/multiphase/twoPhaseEulerFoam/RAS/bubbleColumn/constant/phaseProperties @@ -36,47 +36,124 @@ water } } -// Surface tension coefficient -sigma 0.07; +blending +{ + default + { + type linear; + residualAlpha 1e-6; + maxFullyDispersedAlpha.air 0.3; + maxPartlyDispersedAlpha.air 0.5; + maxFullyDispersedAlpha.water 0.3; + maxPartlyDispersedAlpha.water 0.5; + } +} + +sigma +( + (air and water) 0.07 +); + +aspectRatio +( + (air in water) + { + type constant; + E0 1.0; + } + + (water in air) + { + type constant; + E0 1.0; + } +); drag -{ - air SchillerNaumann; - water SchillerNaumann; -} +( + (air in water) + { + type SchillerNaumann; + residualAlpha 1e-6; + residualSlip 1e-3; + residualRe 1e-3; + swarmCorrection + { + type none; + } + } + + (water in air) + { + type SchillerNaumann; + residualAlpha 1e-6; + residualSlip 1e-3; + residualRe 1e-3; + swarmCorrection + { + type none; + } + } + + (air and water) + { + type segregated; + residualAlpha 1e-6; + residualSlip 1e-3; + residualRe 1e-3; + m 0.5; + n 8; + swarmCorrection + { + type none; + } + } +); + +virtualMass +( + (air in water) + { + type constantCoefficient; + Cvm 0.5; + } + + (water in air) + { + type constantCoefficient; + Cvm 0.5; + } +); heatTransfer -{ - air RanzMarshall; - water RanzMarshall; -} +( + (air in water) + { + type RanzMarshall; + residualRe 1e-3; + } + + (water in air) + { + type RanzMarshall; + residualRe 1e-3; + } +); lift -{ - air - { - type none; - } - water - { - type none; - } -} +( +); -dispersedPhase both; +wallLubrication +( +); -residualPhaseFraction 1e-3; -residualSlip 1e-2; - -// Virtual-mass coefficient -Cvm 0.5; - -// Dispersed-phase turbulence coefficient -Ct 1; +turbulentDispersion +( +); // Minimum allowable pressure pMin 10000; - // ************************************************************************* // diff --git a/tutorials/multiphase/twoPhaseEulerFoam/RAS/fluidisedBed/constant/phaseProperties b/tutorials/multiphase/twoPhaseEulerFoam/RAS/fluidisedBed/constant/phaseProperties index c04f267f53..d79bf8cefa 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/RAS/fluidisedBed/constant/phaseProperties +++ b/tutorials/multiphase/twoPhaseEulerFoam/RAS/fluidisedBed/constant/phaseProperties @@ -35,40 +35,69 @@ air } } -// Surface tension coefficient -sigma 0; +blending +{ + default + { + type none; + residualAlpha 1e-6; + continuousPhase air; + } +} + +sigma +( + (particles and air) 0 +); + +aspectRatio +( +); drag -{ - particles GidaspowErgunWenYu; - air GidaspowErgunWenYu; -} +( + (particles in air) + { + type GidaspowErgunWenYu; + residualAlpha 1e-6; + residualSlip 1e-3; + residualRe 1e-3; + swarmCorrection + { + type none; + } + } +); + +virtualMass +( + (particles in air) + { + type constantCoefficient; + Cvm 0.5; + } +); heatTransfer -{ - particles RanzMarshall; - air RanzMarshall; -} +( + (particles in air) + { + type RanzMarshall; + residualRe 1e-3; + } +); lift -{ - particles - { - type none; - } - air - { - type none; - } -} +( +); -dispersedPhase particles; +wallLubrication +( +); -residualPhaseFraction 1e-3; -residualSlip 1e-2; - -// Virtual-mass coefficient -Cvm 0; +turbulentDispersion +( +); // Minimum allowable pressure pMin 10000; diff --git a/tutorials/multiphase/twoPhaseEulerFoam/RAS/fluidisedBed/constant/turbulenceProperties.particles b/tutorials/multiphase/twoPhaseEulerFoam/RAS/fluidisedBed/constant/turbulenceProperties.particles index 6a6c9f15c0..8042c591d1 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/RAS/fluidisedBed/constant/turbulenceProperties.particles +++ b/tutorials/multiphase/twoPhaseEulerFoam/RAS/fluidisedBed/constant/turbulenceProperties.particles @@ -31,6 +31,7 @@ RAS e 0.8; alphaMax 0.62; alphaMinFriction 0.5; + residualAlpha 1e-6; viscosityModel Gidaspow; conductivityModel Gidaspow; diff --git a/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumn/constant/phaseProperties b/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumn/constant/phaseProperties index 0da3a3d89b..48d8185c6a 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumn/constant/phaseProperties +++ b/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumn/constant/phaseProperties @@ -36,44 +36,124 @@ water } } -// Surface tension coefficient -sigma 0.07; +blending +{ + default + { + type linear; + residualAlpha 1e-6; + maxFullyDispersedAlpha.air 0.3; + maxPartlyDispersedAlpha.air 0.5; + maxFullyDispersedAlpha.water 0.3; + maxPartlyDispersedAlpha.water 0.5; + } +} + +sigma +( + (air and water) 0.07 +); + +aspectRatio +( + (air in water) + { + type constant; + E0 1.0; + } + + (water in air) + { + type constant; + E0 1.0; + } +); drag -{ - air SchillerNaumann; - water SchillerNaumann; -} +( + (air in water) + { + type SchillerNaumann; + residualAlpha 1e-6; + residualSlip 1e-3; + residualRe 1e-3; + swarmCorrection + { + type none; + } + } + + (water in air) + { + type SchillerNaumann; + residualAlpha 1e-6; + residualSlip 1e-3; + residualRe 1e-3; + swarmCorrection + { + type none; + } + } + + (air and water) + { + type segregated; + residualAlpha 1e-6; + residualSlip 1e-3; + residualRe 1e-3; + m 0.5; + n 8; + swarmCorrection + { + type none; + } + } +); + +virtualMass +( + (air in water) + { + type constantCoefficient; + Cvm 0.5; + } + + (water in air) + { + type constantCoefficient; + Cvm 0.5; + } +); heatTransfer -{ - air RanzMarshall; - water RanzMarshall; -} +( + (air in water) + { + type RanzMarshall; + residualRe 1e-3; + } + + (water in air) + { + type RanzMarshall; + residualRe 1e-3; + } +); lift -{ - air - { - type none; - } - water - { - type none; - } -} +( +); -dispersedPhase both; +wallLubrication +( +); -residualPhaseFraction 1e-3; -residualSlip 1e-2; - -// Virtual-mass ceofficient -Cvm 0.5; +turbulentDispersion +( +); // Minimum allowable pressure pMin 10000; - // ************************************************************************* // diff --git a/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumnIATE/constant/phaseProperties b/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumnIATE/constant/phaseProperties index d87591c22c..48d8185c6a 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumnIATE/constant/phaseProperties +++ b/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumnIATE/constant/phaseProperties @@ -19,31 +19,11 @@ phases (air water); air { - diameterModel IATE; - - IATECoeffs + diameterModel isothermal; + isothermalCoeffs { - dMax 1e-2; - dMin 1e-4; - - sources - ( - wakeEntrainmentCoalescence - { - Cwe 0.002; - } - randomCoalescence - { - Crc 0.04; - C 3; - alphaMax 0.75; - } - turbulentBreakUp - { - Cti 0.085; - WeCr 6; - } - ); + d0 3e-3; + p0 1e5; } } @@ -56,44 +36,124 @@ water } } -// Surface tension coefficient -sigma 0.07; +blending +{ + default + { + type linear; + residualAlpha 1e-6; + maxFullyDispersedAlpha.air 0.3; + maxPartlyDispersedAlpha.air 0.5; + maxFullyDispersedAlpha.water 0.3; + maxPartlyDispersedAlpha.water 0.5; + } +} + +sigma +( + (air and water) 0.07 +); + +aspectRatio +( + (air in water) + { + type constant; + E0 1.0; + } + + (water in air) + { + type constant; + E0 1.0; + } +); drag -{ - air SchillerNaumann; - water SchillerNaumann; -} +( + (air in water) + { + type SchillerNaumann; + residualAlpha 1e-6; + residualSlip 1e-3; + residualRe 1e-3; + swarmCorrection + { + type none; + } + } + + (water in air) + { + type SchillerNaumann; + residualAlpha 1e-6; + residualSlip 1e-3; + residualRe 1e-3; + swarmCorrection + { + type none; + } + } + + (air and water) + { + type segregated; + residualAlpha 1e-6; + residualSlip 1e-3; + residualRe 1e-3; + m 0.5; + n 8; + swarmCorrection + { + type none; + } + } +); + +virtualMass +( + (air in water) + { + type constantCoefficient; + Cvm 0.5; + } + + (water in air) + { + type constantCoefficient; + Cvm 0.5; + } +); heatTransfer -{ - air RanzMarshall; - water RanzMarshall; -} +( + (air in water) + { + type RanzMarshall; + residualRe 1e-3; + } + + (water in air) + { + type RanzMarshall; + residualRe 1e-3; + } +); lift -{ - air - { - type none; - } - water - { - type none; - } -} +( +); -dispersedPhase both; +wallLubrication +( +); -residualPhaseFraction 1e-3; -residualSlip 1e-2; - -// Virtual-mass ceofficient -Cvm 0.5; +turbulentDispersion +( +); // Minimum allowable pressure pMin 10000; - // ************************************************************************* // diff --git a/tutorials/multiphase/twoPhaseEulerFoam/laminar/fluidisedBed/constant/phaseProperties b/tutorials/multiphase/twoPhaseEulerFoam/laminar/fluidisedBed/constant/phaseProperties index 15f85c3e98..d79bf8cefa 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/laminar/fluidisedBed/constant/phaseProperties +++ b/tutorials/multiphase/twoPhaseEulerFoam/laminar/fluidisedBed/constant/phaseProperties @@ -35,40 +35,69 @@ air } } -// Surface tension coefficient -sigma 0; +blending +{ + default + { + type none; + residualAlpha 1e-6; + continuousPhase air; + } +} + +sigma +( + (particles and air) 0 +); + +aspectRatio +( +); drag -{ - particles GidaspowErgunWenYu; - air GidaspowErgunWenYu; -} +( + (particles in air) + { + type GidaspowErgunWenYu; + residualAlpha 1e-6; + residualSlip 1e-3; + residualRe 1e-3; + swarmCorrection + { + type none; + } + } +); + +virtualMass +( + (particles in air) + { + type constantCoefficient; + Cvm 0.5; + } +); heatTransfer -{ - particles RanzMarshall; - air RanzMarshall; -} +( + (particles in air) + { + type RanzMarshall; + residualRe 1e-3; + } +); lift -{ - particles - { - type none; - } - air - { - type none; - } -} +( +); -dispersedPhase particles; +wallLubrication +( +); -residualPhaseFraction 1e-3; -residualSlip 1e-2; - -// Virtual-mass ceofficient -Cvm 0; +turbulentDispersion +( +); // Minimum allowable pressure pMin 10000; diff --git a/tutorials/multiphase/twoPhaseEulerFoam/laminar/mixerVessel2D/constant/phaseProperties b/tutorials/multiphase/twoPhaseEulerFoam/laminar/mixerVessel2D/constant/phaseProperties index 8ec38de9ea..48d8185c6a 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/laminar/mixerVessel2D/constant/phaseProperties +++ b/tutorials/multiphase/twoPhaseEulerFoam/laminar/mixerVessel2D/constant/phaseProperties @@ -36,40 +36,121 @@ water } } -// Surface tension coefficient -sigma 0.07; +blending +{ + default + { + type linear; + residualAlpha 1e-6; + maxFullyDispersedAlpha.air 0.3; + maxPartlyDispersedAlpha.air 0.5; + maxFullyDispersedAlpha.water 0.3; + maxPartlyDispersedAlpha.water 0.5; + } +} + +sigma +( + (air and water) 0.07 +); + +aspectRatio +( + (air in water) + { + type constant; + E0 1.0; + } + + (water in air) + { + type constant; + E0 1.0; + } +); drag -{ - air SchillerNaumann; - water SchillerNaumann; -} +( + (air in water) + { + type SchillerNaumann; + residualAlpha 1e-6; + residualSlip 1e-3; + residualRe 1e-3; + swarmCorrection + { + type none; + } + } + + (water in air) + { + type SchillerNaumann; + residualAlpha 1e-6; + residualSlip 1e-3; + residualRe 1e-3; + swarmCorrection + { + type none; + } + } + + (air and water) + { + type segregated; + residualAlpha 1e-6; + residualSlip 1e-3; + residualRe 1e-3; + m 0.5; + n 8; + swarmCorrection + { + type none; + } + } +); + +virtualMass +( + (air in water) + { + type constantCoefficient; + Cvm 0.5; + } + + (water in air) + { + type constantCoefficient; + Cvm 0.5; + } +); heatTransfer -{ - air RanzMarshall; - water RanzMarshall; -} +( + (air in water) + { + type RanzMarshall; + residualRe 1e-3; + } + + (water in air) + { + type RanzMarshall; + residualRe 1e-3; + } +); lift -{ - air - { - type none; - } - water - { - type none; - } -} +( +); -dispersedPhase both; +wallLubrication +( +); -residualPhaseFraction 1e-3; -residualSlip 1e-2; - -// Virtual-mass coefficient -Cvm 0.5; +turbulentDispersion +( +); // Minimum allowable pressure pMin 10000;