diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/UEqns.H b/applications/solvers/multiphase/twoPhaseEulerFoam/UEqns.H index fad73cfeb8dd8ec1a517f164d2cfdf3f20ba0f68..7cddcb800401e26895b5983bd0e88e110b04813d 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* - ( + + phase1.turbulence().divDevReff(U1) + == + - fvm::Sp(dragCoeff/rho1, U1) + - alpha1*alpha2/rho1 + *( + liftForce + + wallLubricationForce + + turbulentDispersionForce + ) + - virtualMassCoeff/rho1 + *( fvm::ddt(U1) + fvm::div(phi1, U1) - fvm::Sp(fvc::div(phi1), U1) + - DDtU2 ) - - + phase1.turbulence().divDevReff(U1) - == - - fvm::Sp(dragCoeff/rho1, U1) - - alpha1*alpha2/rho1*(liftForce - fluid.Cvm()*rho2*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* - ( + + phase2.turbulence().divDevReff(U2) + == + - fvm::Sp(dragCoeff/rho2, U2) + + alpha1*alpha2/rho2 + *( + liftForce + + wallLubricationForce + + turbulentDispersionForce + ) + - virtualMassCoeff/rho2 + *( fvm::ddt(U2) + fvm::div(phi2, U2) - fvm::Sp(fvc::div(phi2), U2) + - DDtU1 ) - + phase2.turbulence().divDevReff(U2) - == - - fvm::Sp(dragCoeff/rho2, U2) - + alpha1*alpha2/rho2*(liftForce + fluid.Cvm()*rho2*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 a382b769b53cbd05bce45cff5861435b19903f83..bee664540773dc5dd51769380bb8bec0ab74f11f 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 a8f1b61119bee3288dc5e376d08632b151198cb7..04aeedd8a6e9c888ce36c3beb8499d38a381800c 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/Vakhrushev/Vakhrushev.C LIB = $(FOAM_LIBBIN)/libcompressibleEulerianInterfacialModels diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/Make/options b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/Make/options index e7e60696ec115958097f3014006ebf9c93889980..95c5844e381270013320965569b3af3e37a0231b 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/Vakhrushev/Vakhrushev.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/Vakhrushev/Vakhrushev.C new file mode 100644 index 0000000000000000000000000000000000000000..601481a87dda878b8b206c32924d12b1d6aa7758 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/Vakhrushev/Vakhrushev.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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "Vakhrushev.H" +#include "orderedPhasePair.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace aspectRatioModels +{ + defineTypeNameAndDebug(Vakhrushev, 0); + addToRunTimeSelectionTable + ( + aspectRatioModel, + Vakhrushev, + dictionary + ); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::aspectRatioModels::Vakhrushev::Vakhrushev +( + const dictionary& dict, + const orderedPhasePair& pair +) +: + aspectRatioModel(dict, pair) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::aspectRatioModels::Vakhrushev::~Vakhrushev() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +Foam::tmp<Foam::volScalarField> +Foam::aspectRatioModels::Vakhrushev::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/Vakhrushev/Vakhrushev.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/Vakhrushev/Vakhrushev.H new file mode 100644 index 0000000000000000000000000000000000000000..4f9d1370f90425ee0b9f4b93548ec828f937803d --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/Vakhrushev/Vakhrushev.H @@ -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 <http://www.gnu.org/licenses/>. + +Class + Foam::Vakhrushev + +Description + +SourceFiles + Vakhrushev.C + +\*---------------------------------------------------------------------------*/ + +#ifndef Vakhrushev_H +#define Vakhrushev_H + +#include "aspectRatioModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace aspectRatioModels +{ + +/*---------------------------------------------------------------------------*\ + Class Vakhrushev Declaration +\*---------------------------------------------------------------------------*/ + +class Vakhrushev +: + public aspectRatioModel +{ +public: + + //- Runtime type information + TypeName("Vakhrushev"); + + + // Constructors + + //- Construct from a dictionary and an ordered phase pair + Vakhrushev + ( + const dictionary& dict, + const orderedPhasePair& pair + ); + + + //- Destructor + virtual ~Vakhrushev(); + + + // Member Functions + + //- Aspect ratio + virtual tmp<volScalarField> 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 0000000000000000000000000000000000000000..dc55e278681096428d4074405faa26896e37e2d0 --- /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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#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 0000000000000000000000000000000000000000..cd953e2b971257835098c66c2a5278057012f6d5 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/aspectRatioModel/aspectRatioModel.H @@ -0,0 +1,120 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 <http://www.gnu.org/licenses/>. + +Class + Foam::aspectRatioModel + +Description + +SourceFiles + aspectRatioModel.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<aspectRatioModel> New + ( + const dictionary& dict, + const orderedPhasePair& pair + ); + + + // Member Functions + + //- Aspect ratio + virtual tmp<volScalarField> 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 0000000000000000000000000000000000000000..cf65f1110f05a62167e0da6513bfed2f289215eb --- /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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "aspectRatioModel.H" +#include "orderedPhasePair.H" + +// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // + +Foam::autoPtr<Foam::aspectRatioModel > +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 0000000000000000000000000000000000000000..c17b6dd068ba8e963f7dfbe26d0ce3c5c94623a3 --- /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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#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::volScalarField> +Foam::aspectRatioModels::constantAspectRatio::E() const +{ + const fvMesh& mesh(this->pair_.phase1().mesh()); + + return + tmp<volScalarField> + ( + 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 0000000000000000000000000000000000000000..9b98a123025af4324b98d1cbefe611beb6b4fa9d --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.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 <http://www.gnu.org/licenses/>. + +Class + Foam::constantAspectRatio + +Description + +SourceFiles + constantAspectRatioI.H + constantAspectRatio.C + constantAspectRatioIO.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<volScalarField> 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 ced13ced8f44f1cc9fb00aecfcb713e1e730189a..c4a23d3cf35335c1bc2075d469b6721443fd2455 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::volScalarField> Foam::dragModels::Ergun::K -( - const volScalarField& Ur -) const +Foam::tmp<Foam::volScalarField> 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 75d5de107abae091f778e54e1c658365cf82fa17..91c8ded67429ed5f5532278e12c25e3a72cc1250 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<volScalarField> K(const volScalarField& Ur) const; + //- Drag coefficient + virtual tmp<volScalarField> 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 093b86d70a14be93f703c6e40afcd4fd498fcd46..a03258b356f18ee9cf6f258215c2990ce9fdeffa 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::volScalarField> Foam::dragModels::Gibilaro::K -( - const volScalarField& Ur -) const +Foam::tmp<Foam::volScalarField> 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 2a922c86d91ee171b7e5655d5fad7dc3bdefdf2b..ef63e826a398de50c86ecbcfb6c4fa8560e0cc16 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<volScalarField> K(const volScalarField& Ur) const; + //- Drag coefficient + virtual tmp<volScalarField> 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 deb949de21d048643f92871d05f16a8bb53987d7..8ef32322263f38811ea038971b9896858e0b5a79 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::volScalarField> Foam::dragModels::GidaspowErgunWenYu::K -( - const volScalarField& Ur -) const +Foam::tmp<Foam::volScalarField> +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 9c2a25ac0ab4aee941de66a52b0c5b73cd6afe86..f796977c1625a50aa78677365070da7029e1621f 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> Ergun_; + + //- Wen Yu drag model + autoPtr<WenYu> 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<volScalarField> K(const volScalarField& Ur) const; + //- Drag coefficient + virtual tmp<volScalarField> 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 c6ebe660929bc902827cb2a6c3b25f58a8312871..3e389a7a6b32aa5356b1f286bfd5150f24244186 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::volScalarField> Foam::dragModels::GidaspowSchillerNaumann::K -( - const volScalarField& Ur -) const +Foam::tmp<Foam::volScalarField> +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 dcc07aec6cf51cbbf6f0d4d3ed1f6d8c033e2dee..9277781bc357367370c80a54b69377446be501e1 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<volScalarField> K(const volScalarField& Ur) const; + //- Drag coefficient + virtual tmp<volScalarField> 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 4ab62e14a7124e8b631ed59a69b49febc818d73e..7cfc98d29814c272769e294968795d21ddad7ff2 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::volScalarField> Foam::dragModels::SchillerNaumann::K -( - const volScalarField& Ur -) const +Foam::tmp<Foam::volScalarField> 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 00aacd44695ac691e927cf24e427b8ed1c23572e..72d0d2c1b770689551fc2ebd658544541efc3f1e 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<volScalarField> K(const volScalarField& Ur) const; + //- Drag coefficient + virtual tmp<volScalarField> 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 ff6abc1857ff757e08fcda48e5bccfe727ae89f8..d2c0f800b191788336bcd7e885ade6d7846abf36 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::volScalarField> Foam::dragModels::SyamlalOBrien::K -( - const volScalarField& Ur -) const +Foam::tmp<Foam::volScalarField> 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 210b49d20002d25d15fc4997307859c6d6142013..652013aae2e53ce0d34a920dc40d37881583ced2 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<volScalarField> K(const volScalarField& Ur) const; + //- Drag coefficient + virtual tmp<volScalarField> 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 0000000000000000000000000000000000000000..7770579a8659da660e5001ba9479a68e62134771 --- /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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#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::volScalarField> 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 0000000000000000000000000000000000000000..4cb8bad69b6e5f5a5af972a236e6fd87042e8229 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/TomiyamaAnalytic/TomiyamaAnalytic.H @@ -0,0 +1,104 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 <http://www.gnu.org/licenses/>. + +Class + Foam::dragModels::TomiyamaAnalytic + +Description + +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<volScalarField> 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 0000000000000000000000000000000000000000..c7b0eecae660586e142a7bc2f450c27e0255f707 --- /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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#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::volScalarField> +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 0000000000000000000000000000000000000000..b82c99b630a05696d38cb7c017d9b96b3c162385 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/TomiyamaCorrelated/TomiyamaCorrelated.H @@ -0,0 +1,104 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 <http://www.gnu.org/licenses/>. + +Class + Foam::dragModels::TomiyamaCorrelated + +Description + +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<volScalarField> 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 b31aa21fb6aa97f346a37019a12944a7e6ee6d9f..707ce6268399008f4fcbafdec1f68adb506fe2f5 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::volScalarField> Foam::dragModels::WenYu::K -( - const volScalarField& Ur -) const +Foam::tmp<Foam::volScalarField> 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 6d9affca9fe84b90795c29c0bbf5148af6086787..e471c38546fd48ec57163854b56e314310841773 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<volScalarField> K(const volScalarField& Ur) const; + //- Drag coefficient + virtual tmp<volScalarField> 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 0d2ed1c6202d9963fca758a9d7e477bae5320cae..83b1dee2ffa02a8f2f89cf046f27a360efef7fd7 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 * * * * * * * * * * * * * // @@ -38,16 +40,48 @@ namespace Foam 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 +91,27 @@ Foam::dragModel::~dragModel() {} +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp<Foam::volScalarField> 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 6e47aedb4d12ad54bd1a9c1102df8ad18ebc3d3f..7349b4a02c752d8205e2d64a16aacb1cc335b01c 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 @@ -28,7 +28,6 @@ Description SourceFiles dragModel.C - newDragModel.C \*---------------------------------------------------------------------------*/ @@ -37,27 +36,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> swarmCorrection_; + + //- Residual phase fraction + const dimensionedScalar residualAlpha_; + + //- Residual slip velocity + const dimensionedScalar residualSlip_; public: @@ -74,23 +85,26 @@ 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) ); // Constructors + // Construct without residual constants + dragModel + ( + const phasePair& pair + ); + + // Construct with residual constants dragModel ( - const dictionary& interfaceDict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const dictionary& dict, + const phasePair& pair ); @@ -102,25 +116,28 @@ public: static autoPtr<dragModel> 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<volScalarField> 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<volScalarField> K(const volScalarField& Ur) const = 0; + virtual tmp<volScalarField> 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 9f20a3c22d1585ac4058f528de298616197fd229..b2c9657e4f9ffd3ba1463f0cbe830706370ecd99 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> 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> 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 0000000000000000000000000000000000000000..f12e3bf972a625dbaed9a277b7ee4a227faffb35 --- /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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#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::volScalarField> Foam::dragModels::noDrag::Cd() const +{ + const fvMesh& mesh(this->pair_.phase1().mesh()); + + return + tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "Cd", + mesh.time().timeName(), + mesh + ), + mesh, + dimensionedScalar("Cd", dimless, 0) + ) + ); +} + + +Foam::tmp<Foam::volScalarField> 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 0000000000000000000000000000000000000000..356c08c4383bc8af34b591ad0a626358b588d293 --- /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 <http://www.gnu.org/licenses/>. + +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<volScalarField> Cd() const; + + //- The drag function used in the momentum equation + virtual tmp<volScalarField> 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 0000000000000000000000000000000000000000..ef862d58754b5b3146215fc0e25ef2eb6ac009ea --- /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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#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")), + mSeg_("mSeg", dimless, dict.lookup("mSeg")), + nSeg_("nSeg", dimless, dict.lookup("nSeg")) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::dragModels::segregated::~segregated() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp<Foam::volScalarField> 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::volScalarField> 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<volScalarField> tnu1(pair_.phase1().nu()); + tmp<volScalarField> 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<scalar>::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(mSeg_*ReI + nSeg_*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 0000000000000000000000000000000000000000..26ce2aa8bfdfac03a96b91fd468366e08655186c --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/segregated/segregated.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 <http://www.gnu.org/licenses/>. + +Class + Foam::dragModels::segregated + +Description + +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 segregated coefficient + const dimensionedScalar mSeg_; + + //- N segregated coefficient + const dimensionedScalar nSeg_; + + +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<volScalarField> Cd() const; + + //- The drag function used in the momentum equation + virtual tmp<volScalarField> 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 95ade6ba05944fc306d26ce7c7ed1ffff4d97d2d..019926b34be860a16ebffd9207f5e61c621501cd 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::volScalarField> Foam::heatTransferModels::RanzMarshall::K -( - const volScalarField& Ur -) const +Foam::tmp<Foam::volScalarField> +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 8bcad969a8635bf57895f8617a9b44bcbdb6b4a3..1d7b52f13259b1d30814bd2ac739724e6e71b416 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,12 @@ class RanzMarshall : public heatTransferModel { +private: + + // Private data + + const dimensionedScalar residualRe_; + public: @@ -63,10 +72,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 +83,8 @@ public: // Member Functions - tmp<volScalarField> K(const volScalarField& Ur) const; + //- The heat transfer function K used in the enthalpy equation + tmp<volScalarField> 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 40facd1fe63efb4f88db5687a617d51278f05353..71eeb7620a5fd59448a1062b046c303c3802dbce 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 * * * * * * * * * * * * * // @@ -38,16 +39,11 @@ namespace Foam 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 f869f8c0e9ca15b16cbcffa920d2a8086296159f..b7cc4f917f543afea32e6f134a4b3b8e2bf23dc7 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,20 @@ 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) ); // 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 +98,22 @@ public: static autoPtr<heatTransferModel> 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<volScalarField> K(const volScalarField& Ur) const = 0; + virtual tmp<volScalarField> 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 757fb94351072024c726c568d45b133cd2e25828..bceb23cacc36f8debe6c3ebf2455e86a6ebf7c97 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> 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> 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 0000000000000000000000000000000000000000..1a4b3744e83ce69bb8c5586c5009027e55a8434e --- /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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#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::volScalarField> +Foam::heatTransferModels::noHeatTransfer::K() const +{ + const fvMesh& mesh(this->pair_.phase1().mesh()); + + return + tmp<volScalarField> + ( + 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 0000000000000000000000000000000000000000..9fbef6f212fd32eb5ae7a1072543b1b66c68ce58 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/heatTransferModels/noHeatTransfer/noHeatTransfer.H @@ -0,0 +1,94 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 <http://www.gnu.org/licenses/>. + +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<volScalarField> 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 0000000000000000000000000000000000000000..a789fd20791bf7b8be90423a8333778cf780f1ad --- /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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#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::volScalarField> 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 0000000000000000000000000000000000000000..4ad925c5c8c9b76ab4b2c406f3d27d35b3e76de6 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/TomiyamaLift/TomiyamaLift.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 <http://www.gnu.org/licenses/>. + +Class + Foam::liftModels::TomiyamaLift + +Description + +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<volScalarField> 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 0000000000000000000000000000000000000000..f070c55424f5ad4b0272a17a04ba722b9d7ac921 --- /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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#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::volScalarField> +Foam::liftModels::constantLiftCoefficient::Cl() const +{ + const fvMesh& mesh(this->pair_.phase1().mesh()); + + return + tmp<volScalarField> + ( + 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 8eb5cdeeac7874de5e3167e18871e4c2b2e9ed33..d4e99b82464035fd16d9a1562dc8bdb794f3b469 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/constantCoefficient/constantCoefficient.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/liftModels/constantLiftCoefficient/constantLiftCoefficient.H @@ -22,17 +22,17 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::liftModels::constantCoefficient + Foam::liftModels::constantLiftCoefficient Description SourceFiles - constantCoefficient.C + constantLiftCoefficient.C \*---------------------------------------------------------------------------*/ -#ifndef constantCoefficient_H -#define constantCoefficient_H +#ifndef constantLiftCoefficient_H +#define constantLiftCoefficient_H #include "liftModel.H" @@ -40,24 +40,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 +68,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<volVectorField> F(const volVectorField& U) const; + //- Lift coefficient + virtual tmp<volScalarField> 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 36dbde08ee1edd74883e36d4431a21b7240aff92..67c19b6876f9c0e53794e416768be3402db26b62 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 * * * * * * * * * * * * * // @@ -39,15 +41,10 @@ namespace Foam 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 +54,17 @@ Foam::liftModel::~liftModel() {} +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp<Foam::volVectorField> 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 3c22be1f00a96ff6ff543b47d73984d7658c9f88..fe6581b2b1c1ad4683f4a2a19c4e4d408c83ce05 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,19 @@ public: dictionary, ( const dictionary& dict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const phasePair& pair ), - (dict, alpha1, phase1, phase2) + (dict, pair) ); // 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 +100,17 @@ public: static autoPtr<liftModel> New ( const dictionary& dict, - const volScalarField& alpha1, - const phaseModel& phase1, - const phaseModel& phase2 + const phasePair& pair ); // Member Functions + //- Lift coefficient + virtual tmp<volScalarField> Cl() const = 0; + //- Lift force - virtual tmp<volVectorField> F(const volVectorField& U) const = 0; + virtual tmp<volVectorField> 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 96b0e2f064772d0633bfa816a33921ba45ba7f70..e8a476d441426add85f54f55b6e66e085b5ada3c 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> 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> 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 98d07249559e1a94952d2b1527a0ba3213bf0899..d6ad1c89f862ed9d212b709f85fbbfb2f56592ee 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::volVectorField> Foam::liftModels::noLift::F -( - const volVectorField& U -) const +Foam::tmp<Foam::volScalarField> Foam::liftModels::noLift::Cl() const { + const fvMesh& mesh(this->pair_.phase1().mesh()); + return - tmp<volVectorField> + tmp<volScalarField> ( - 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::volVectorField> 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 68af5802a4460b26c9acdc956a595c41a178a298..0b0760a67db0a612a6e88ca503199cf42026372a 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<volScalarField> Cl() const; + //- Lift force - tmp<volVectorField> F(const volVectorField& U) const; + virtual tmp<volVectorField> 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 0000000000000000000000000000000000000000..7cc49195d8686bde1a535936986c2f8974e973e1 --- /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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#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::volScalarField> +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 0000000000000000000000000000000000000000..83050784c143029cfbbdc3de6b16e9157b108215 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/swarmCorrections/TomiyamaSwarm/TomiyamaSwarm.H @@ -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 <http://www.gnu.org/licenses/>. + +Class + Foam::TomiyamaSwarm + +Description + +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<volScalarField> 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 0000000000000000000000000000000000000000..9239585d7dcccc353f79387f715fcc52709d192b --- /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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#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::volScalarField> Foam::swarmCorrections::noSwarm::Cs() const +{ + const fvMesh& mesh(this->pair_.phase1().mesh()); + + return + tmp<volScalarField> + ( + 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 0000000000000000000000000000000000000000..59682c9bb7d346b4c34a4db7af3a5bfe881faf93 --- /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 <http://www.gnu.org/licenses/>. + +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<volScalarField> 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 0000000000000000000000000000000000000000..8c8f096a2ea194ca71173f1f6a28509f4054c8c9 --- /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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "swarmCorrection.H" +#include "phasePair.H" + +// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // + +Foam::autoPtr<Foam::swarmCorrection> +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 0000000000000000000000000000000000000000..50730c5f96429d4326bf74ab75c5886a0bd8866b --- /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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#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 0000000000000000000000000000000000000000..4f725c42a24436701069a2fd318b3cbfb4f12f10 --- /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 <http://www.gnu.org/licenses/>. + +Class + Foam::swarmCorrection + +Description + +SourceFiles + swarmCorrection.C + newDragModel.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<swarmCorrection> New + ( + const dictionary& dict, + const phasePair& pair + ); + + + // Member Functions + + //- Swarm correction coefficient + virtual tmp<volScalarField> 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 0000000000000000000000000000000000000000..33a144df680d8fda1efafedbb4cb42bfa9c480ba --- /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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#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::volVectorField> +Foam::turbulentDispersionModels::Gosman::F() const +{ + const fvMesh& mesh(pair_.phase1().mesh()); + const dragModel& + drag + ( + mesh.lookupObject<dragModel> + ( + 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 0000000000000000000000000000000000000000..29711d58e9118afca7528045dfa0af8ba6247c8b --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/Gosman/Gosman.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 <http://www.gnu.org/licenses/>. + +Class + Foam::turbulentDispersionModels::Gosman + +Description + +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 + + 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<volVectorField> 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 0000000000000000000000000000000000000000..47dd0bd9bb23ffb64b6fd2ebb5f9b792818c4da8 --- /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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#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::volVectorField> +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 0000000000000000000000000000000000000000..abfcb9529ce01ba301184751f6e5c589094403f4 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/constantTurbulentDispersionCoefficient/constantTurbulentDispersionCoefficient.H @@ -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 <http://www.gnu.org/licenses/>. + +Class + Foam::turbulentDispersionModels::constantTurbulentDispersionCoefficient + +Description + +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 + 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<volVectorField> 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 0000000000000000000000000000000000000000..99c8e8581ce8044a1e37a1ccc30ba6227eadc692 --- /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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#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::volVectorField> +Foam::turbulentDispersionModels::noTurbulentDispersion::F() const +{ + const fvMesh& mesh(this->pair_.phase1().mesh()); + + return + tmp<volVectorField> + ( + 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 0000000000000000000000000000000000000000..7c9adf6d2c6ff278b1478e0d1d75c58203995be7 --- /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 <http://www.gnu.org/licenses/>. + +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<volVectorField> 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 0000000000000000000000000000000000000000..fa267e80d5b055c4948c56fd7cf4d61700f28853 --- /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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "turbulentDispersionModel.H" +#include "phasePair.H" + +// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // + +Foam::autoPtr<Foam::turbulentDispersionModel> +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 0000000000000000000000000000000000000000..2b71f89feedd33029738006675a716f82ccfff0a --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "turbulentDispersionModel.H" +#include "phasePair.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(turbulentDispersionModel, 0); + defineRunTimeSelectionTable(turbulentDispersionModel, dictionary); +} + + +// * * * * * * * * * * * * * * * * 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 0000000000000000000000000000000000000000..19359079ea544cd9fef817b6eeeaa0cec6f27304 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.H @@ -0,0 +1,122 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 <http://www.gnu.org/licenses/>. + +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) + ); + + + // Constructors + + //- Construct from a dictionary and a phase pair + turbulentDispersionModel + ( + const dictionary& dict, + const phasePair& pair + ); + + + //- Destructor + virtual ~turbulentDispersionModel(); + + + // Selectors + + static autoPtr<turbulentDispersionModel> New + ( + const dictionary& dict, + const phasePair& pair + ); + + + // Member Functions + + //- Turbulent dispersion force + virtual tmp<volVectorField> 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 110f92e7d441902e812ba65817ce201ad44869b6..9ddcc4e358e3f476229542e8271d541d32545562 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::volVectorField> Foam::liftModels::constantCoefficient::F -( - const volVectorField& U -) const +Foam::tmp<Foam::volScalarField> 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 0000000000000000000000000000000000000000..f7214f8ba8b7adec2ff385d271e5182adfb78af3 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/Lamb/Lamb.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 <http://www.gnu.org/licenses/>. + +Class + Foam::virtualMassModels::Lamb + +Description + +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<volScalarField> 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 0000000000000000000000000000000000000000..b76ec41c6cc5d406c64991d8e00feb8cd779aad3 --- /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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#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::volScalarField> +Foam::virtualMassModels::constantVirtualMassCoefficient::Cvm() const +{ + const fvMesh& mesh(this->pair_.phase1().mesh()); + + return + tmp<volScalarField> + ( + 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 0000000000000000000000000000000000000000..d1a79bd42366c823a677bd2ebfb6f5e5918f3d6d --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/constantVirtualMassCoefficient/constantVirtualMassCoefficient.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 <http://www.gnu.org/licenses/>. + +Class + Foam::virtualMassModels::constantVirtualMassCoefficient + +Description + +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<volScalarField> 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 0000000000000000000000000000000000000000..674bd63b9bc0b6f455415131a5f7eaf67b413550 --- /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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#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::volScalarField> +Foam::virtualMassModels::noVirtualMass::Cvm() const +{ + const fvMesh& mesh(this->pair_.phase1().mesh()); + + return + tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "zero", + mesh.time().timeName(), + mesh + ), + mesh, + dimensionedScalar("zero", dimless, 0) + ) + ); +} + + +Foam::tmp<Foam::volScalarField> +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 0000000000000000000000000000000000000000..ca498c4606a786cce5d4136f6f26274fb64eca5d --- /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 <http://www.gnu.org/licenses/>. + +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<volScalarField> Cvm() const; + + virtual tmp<volScalarField> 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 0000000000000000000000000000000000000000..d8df3a8b506a68015ec95c5474d3468057b9c019 --- /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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "virtualMassModel.H" +#include "phasePair.H" + +// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // + +Foam::autoPtr<Foam::virtualMassModel> 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 0000000000000000000000000000000000000000..43973243ef495011da1cc93596c34e0685ae0735 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModel.C @@ -0,0 +1,79 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "virtualMassModel.H" +#include "phasePair.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(virtualMassModel, 0); + defineRunTimeSelectionTable(virtualMassModel, dictionary); +} + + +// * * * * * * * * * * * * * * * * 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::volScalarField> 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 0000000000000000000000000000000000000000..7a6112710cc27569c3d3cb3d953d5e06d8bd8daa --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/virtualMassModels/virtualMassModel/virtualMassModel.H @@ -0,0 +1,137 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 <http://www.gnu.org/licenses/>. + +Class + Foam::virtualMassModel + +Description + +SourceFiles + virtualMassModel.C + newDragModel.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) + ); + + + // Constructors + + //- Construct from a dictionary and a phase pair + virtualMassModel + ( + const dictionary& dict, + const phasePair& pair + ); + + + //- Destructor + virtual ~virtualMassModel(); + + + // Selectors + + static autoPtr<virtualMassModel> New + ( + const dictionary& dict, + const phasePair& pair + ); + + + // Member Functions + + //- Virtual mass coefficient + virtual tmp<volScalarField> 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<volScalarField> 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 0000000000000000000000000000000000000000..aea563edd85fa78cb954a71070903fff08d78a44 --- /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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#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::volVectorField> 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 0000000000000000000000000000000000000000..f38f9b6812af5588af72a523fc36c483139c559d --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/Antal/Antal.H @@ -0,0 +1,104 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 <http://www.gnu.org/licenses/>. + +Class + Foam::wallLubricationModels::Antal + +Description + +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<volVectorField> 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 0000000000000000000000000000000000000000..4fbdffc08588bb739d54a57054c8f83b6081e2e3 --- /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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#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::volVectorField> +Foam::wallLubricationModels::noWallLubrication::F() const +{ + const fvMesh& mesh(this->pair_.phase1().mesh()); + + return + tmp<volVectorField> + ( + 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 0000000000000000000000000000000000000000..4861c25675c271db9f6a9c1436fbfd45ea19e697 --- /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 <http://www.gnu.org/licenses/>. + +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<volVectorField> 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 0000000000000000000000000000000000000000..b9766e7d52b62cb1be07604ebdc4baa4c6066256 --- /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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "wallLubricationModel.H" +#include "phasePair.H" + +// * * * * * * * * * * * * * * * * Selector * * * * * * * * * * * * * * * * // + +Foam::autoPtr<Foam::wallLubricationModel> 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 0000000000000000000000000000000000000000..0dbedbf020cb839e43d9acc3154669f0abf4a730 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.C @@ -0,0 +1,57 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "wallLubricationModel.H" +#include "phasePair.H" + +// * * * * * * * * * * * * * * 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<volScalarField>("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 0000000000000000000000000000000000000000..e246ac9f2236a98470cb8021194c7ead65576cae --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/wallLubricationModel/wallLubricationModel.H @@ -0,0 +1,125 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 <http://www.gnu.org/licenses/>. + +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) + ); + + + // Constructors + + //- Construct from components + wallLubricationModel + ( + const dictionary& dict, + const phasePair& pair + ); + + + //- Destructor + virtual ~wallLubricationModel(); + + + // Selectors + + static autoPtr<wallLubricationModel> New + ( + const dictionary& dict, + const phasePair& pair + ); + + + // Member Functions + + //- Wall lubrication force + virtual tmp<volVectorField> 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 1a9e2e14195cd6f57de0004f9695e18014b22860..20428f9c0cbdb2fadfeb03e81e2ca16792b39aa1 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 750fa33503d396c7c350d86c1d2ec217bf631d8a..a24b5aaae6e194c699bd80c04c935eb2be774afc 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 1f31befdd2f219e456e6b7041aa8c7de32ff2026..8a038c434ede8638f12782eb32d9c08820f31cff 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 4f32564a482f0ae76245dcb76b256aefb1ad0c3b..0000000000000000000000000000000000000000 --- 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 69682a9a3d52f6209b787b43d6e0eca11b4b1aea..a8d8631dd1a32a6340545faa5ee76d425b99cebc 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 0000000000000000000000000000000000000000..809d177d1a5a91c0c5950b1c7186c4bcd541bd32 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.C @@ -0,0 +1,173 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "BlendedInterfacialModel.H" +#include "fixedValueFvsPatchFields.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template<class modelType> +template<class Type> +void Foam::BlendedInterfacialModel<modelType>::correctFixedFluxBCs +( + GeometricField<Type, fvPatchField, volMesh>& field +) const +{ + forAll(pair_.phase1().phi().boundaryField(), patchI) + { + if + ( + isA<fixedValueFvsPatchScalarField> + ( + pair_.phase1().phi().boundaryField()[patchI] + ) + ) + { + field.boundaryField()[patchI] = pTraits<Type>::zero; + } + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class modelType> +Foam::BlendedInterfacialModel<modelType>::BlendedInterfacialModel +( + const phasePair::dictTable& modelTable, + const dictionary& blendingDict, + const phasePair& pair, + const orderedPhasePair& pair1In2, + const orderedPhasePair& pair2In1 +) +: + pair_(pair), + pair1In2_(pair1In2), + pair2In1_(pair2In1), + model_ + ( + modelType::New + ( + modelTable[pair_], + pair_ + ) + ), + model1In2_ + ( + modelType::New + ( + modelTable[pair1In2_], + pair1In2_ + ) + ), + model2In1_ + ( + modelType::New + ( + modelTable[pair2In1_], + pair2In1_ + ) + ), + blending_ + ( + blendingMethod::New + ( + blendingDict, + pair1In2_.dispersed(), + pair1In2_.continuous() + ) + ), + residualAlpha_ + ( + "residualAlpha", + dimless, + blendingDict.lookup("residualAlpha") + ) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template<class modelType> +Foam::BlendedInterfacialModel<modelType>::~BlendedInterfacialModel() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +template<class modelType> +Foam::tmp<Foam::volScalarField> +Foam::BlendedInterfacialModel<modelType>::K() const +{ + tmp<volScalarField> f1(blending_->f1()); + tmp<volScalarField> f2(blending_->f2()); + + tmp<volScalarField> c + ( + model_->K()*(f1() - f2()) + + model1In2_->K()*(1 - f1) + + model2In1_->K()*f2 + ); + + c() *= max(pair_.phase1()*pair_.phase2(), residualAlpha_); + + correctFixedFluxBCs(c()); + + return c; +} + + +template<class modelType> +template<class Type> +Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> > +Foam::BlendedInterfacialModel<modelType>::F() const +{ + tmp<volScalarField> f1(blending_->f1()); + tmp<volScalarField> f2(blending_->f2()); + + tmp<GeometricField<Type, fvPatchField, volMesh> > v + ( + model_->F()*(f1() - f2()) + + model1In2_->F()*(1 - f1) + - model2In1_->F()*f2 + ); + + correctFixedFluxBCs(v()); + + return v; +} + + +template<class modelType> +const modelType& Foam::BlendedInterfacialModel<modelType>::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 0000000000000000000000000000000000000000..a5c81e26bfb57e64d0feaf16c58a8d674680ad26 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.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 <http://www.gnu.org/licenses/>. + +Class + Foam::BlendedInterfacialModel + +Description + +SourceFiles + BlendedInterfacialModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef BlendedInterfacialModel_H +#define BlendedInterfacialModel_H + +#include "blendingMethod.H" +#include "phasePair.H" +#include "orderedPhasePair.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class BlendedInterfacialModel Declaration +\*---------------------------------------------------------------------------*/ + +template<class modelType> +class BlendedInterfacialModel +{ + // 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<modelType> model_; + + //- Model for dispersed phase 1 in continuous phase 2 + autoPtr<modelType> model1In2_; + + //- Model for dispersed phase 2 in continuous phase 1 + autoPtr<modelType> model2In1_; + + //- Blending model + autoPtr<blendingMethod> blending_; + + //- Residual phase fraction + const dimensionedScalar residualAlpha_; + + + // Private Member Functions + + //- Disallow default bitwise copy construct + BlendedInterfacialModel(const BlendedInterfacialModel<modelType>&); + + //- Disallow default bitwise assignment + void operator=(const BlendedInterfacialModel<modelType>&); + + //- Correct coeff/value on fixed flux boundary conditions + template<class Type> + void correctFixedFluxBCs + ( + GeometricField<Type, fvPatchField, volMesh>& field + ) const; + + +public: + + // Constructors + + //- Construct from the model table, dictionary and pairs + BlendedInterfacialModel + ( + const phasePair::dictTable& modelTable, + const dictionary& blendingDict, + const phasePair& pair, + const orderedPhasePair& pair1In2, + const orderedPhasePair& pair2In1 + ); + + + //- Destructor + ~BlendedInterfacialModel(); + + + // Member Functions + + //- Return the implicit coefficient + tmp<volScalarField> K() const; + + //- Return the explicit value + template<class Type> + tmp<GeometricField<Type, fvPatchField, volMesh> > 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 0000000000000000000000000000000000000000..29c961e01aaf441d6b380ad1fe2eacebeb34a56c --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethod.C @@ -0,0 +1,57 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "blendingMethod.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(blendingMethod, 0); + defineRunTimeSelectionTable(blendingMethod, dictionary); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::blendingMethod::blendingMethod +( + const dictionary& dict, + const phaseModel& phase1, + const phaseModel& phase2 +) +: + phase1_(phase1), + phase2_(phase2) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::blendingMethod::~blendingMethod() +{} + + +// ************************************************************************* // 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 0000000000000000000000000000000000000000..73494c7553375fb325f7c38993f09bd88075ea57 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/blendingMethod/blendingMethod.H @@ -0,0 +1,136 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 <http://www.gnu.org/licenses/>. + +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 +{ + // Private Member Functions + + //- Disallow default bitwise copy construct + blendingMethod(const blendingMethod&); + + //- Disallow default bitwise assignment + void operator=(const blendingMethod&); + + +protected: + + // Protected data + + //- Phase 1 + const phaseModel& phase1_; + + //- Phase 2 + const phaseModel& phase2_; + + +public: + + //- Runtime type information + TypeName("blendingMethod"); + + + // Declare runtime construction + declareRunTimeSelectionTable + ( + autoPtr, + blendingMethod, + dictionary, + ( + const dictionary& dict, + const phaseModel& phase1, + const phaseModel& phase2 + ), + (dict, phase1, phase2) + ); + + + // Constructors + + //- Construct from a dictionary and two phases + blendingMethod + ( + const dictionary& dict, + const phaseModel& phase1, + const phaseModel& phase2 + ); + + + // Selector + + static autoPtr<blendingMethod> New + ( + const dictionary& dict, + const phaseModel& phase1, + const phaseModel& phase2 + ); + + + //- Destructor + virtual ~blendingMethod(); + + + // Member Functions + + //- Factor for first phase + virtual tmp<volScalarField> f1() const = 0; + + //- Factor for second phase + virtual tmp<volScalarField> f2() 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 0000000000000000000000000000000000000000..108c0425d5f6163ebf181e8bcb190d889e3b6bb9 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/blendingMethod/newBlendingMethod.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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "blendingMethod.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +Foam::autoPtr<Foam::blendingMethod> Foam::blendingMethod::New +( + const dictionary& dict, + const phaseModel& phase1, + const phaseModel& phase2 +) +{ + word blendingMethodType(dict.lookup("type")); + + Info<< "Selecting blendingMethod for " + << phase1.name() << " and " << phase2.name() << ": " + << 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, phase1, phase2); +} + + +// ************************************************************************* // 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 0000000000000000000000000000000000000000..712e36f6c443dabd4d80af41fcfa54504c4b6b53 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/hyperbolic/hyperbolic.C @@ -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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#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 phaseModel& phase1, + const phaseModel& phase2 +) +: + blendingMethod(dict, phase1, phase2), + maxDispersedAlpha1_ + ( + "maxDispersedAlpha1", + dimless, + dict.lookup + ( + IOobject::groupName("maxDispersedAlpha", phase1.name()) + ) + ), + maxDispersedAlpha2_ + ( + "maxDispersedAlpha2", + dimless, + dict.lookup + ( + IOobject::groupName("maxDispersedAlpha", phase2.name()) + ) + ), + transitionAlphaScale_ + ( + "transitionAlphaScale", + dimless, + dict.lookup("transitionAlphaScale") + ) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::blendingMethods::hyperbolic::~hyperbolic() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +Foam::tmp<Foam::volScalarField> Foam::blendingMethods::hyperbolic::f1() const +{ + return + ( + 1 + + tanh + ( + (4/transitionAlphaScale_) + *(phase1_ - maxDispersedAlpha1_) + ) + )/2; +} + + +Foam::tmp<Foam::volScalarField> Foam::blendingMethods::hyperbolic::f2() const +{ + return + ( + 1 + + tanh + ( + (4/transitionAlphaScale_) + *(maxDispersedAlpha2_ - 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 0000000000000000000000000000000000000000..78048b0927df3361a69e01f0f9fdde8e41dea128 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/hyperbolic/hyperbolic.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 <http://www.gnu.org/licenses/>. + +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 phase 1 which can be considered dispersed + const dimensionedScalar maxDispersedAlpha1_; + + //- Maximum fraction of phase 2 which can be considered dispersed + const dimensionedScalar maxDispersedAlpha2_; + + //- Width of the transition + const dimensionedScalar transitionAlphaScale_; + + +public: + + //- Runtime type information + TypeName("hyperbolic"); + + + // Constructors + + //- Construct from a dictionary and two phases + hyperbolic + ( + const dictionary& dict, + const phaseModel& phase1, + const phaseModel& phase2 + ); + + + //- Destructor + ~hyperbolic(); + + + // Member Functions + + //- Factor for primary phase + virtual tmp<volScalarField> f1() const; + + //- Factor for secondary phase + virtual tmp<volScalarField> f2() 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 0000000000000000000000000000000000000000..bf5fdd9c4b08d8fd8653fd776ec4c943c91afc7b --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/linear/linear.C @@ -0,0 +1,154 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#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 phaseModel& phase1, + const phaseModel& phase2 +) +: + blendingMethod(dict, phase1, phase2), + maxFullyDispersedAlpha1_ + ( + "maxFullyDispersedAlpha1", + dimless, + dict.lookup + ( + IOobject::groupName("maxFullyDispersedAlpha", phase1.name()) + ) + ), + maxPartlyDispersedAlpha1_ + ( + "maxPartlyDispersedAlpha1", + dimless, + dict.lookup + ( + IOobject::groupName("maxPartlyDispersedAlpha", phase1.name()) + ) + ), + maxFullyDispersedAlpha2_ + ( + "maxFullyDispersedAlpha2", + dimless, + dict.lookup + ( + IOobject::groupName("maxFullyDispersedAlpha", phase2.name()) + ) + ), + maxPartlyDispersedAlpha2_ + ( + "maxPartlyDispersedAlpha2", + dimless, + dict.lookup + ( + IOobject::groupName("maxPartlyDispersedAlpha", phase2.name()) + ) + ) +{ + if + ( + maxFullyDispersedAlpha1_ > maxPartlyDispersedAlpha1_ + || maxFullyDispersedAlpha2_ > maxPartlyDispersedAlpha2_ + ) + { + FatalErrorIn + ( + "Foam::blendingMethods::linear::linear" + "(" + "const dictionary& dict," + "const phaseModel& phase1," + "const phaseModel& phase2" + ")" + ) << "The supplied fully dispersed volume fraction is greater than " + << "the partly dispersed value" + << endl << exit(FatalError); + } +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::blendingMethods::linear::~linear() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +Foam::tmp<Foam::volScalarField> Foam::blendingMethods::linear::f1() const +{ + return + min + ( + max + ( + (phase1_ - maxFullyDispersedAlpha1_) + /(maxPartlyDispersedAlpha1_ - maxFullyDispersedAlpha1_ + SMALL), + 0.0 + ), + 1.0 + ); +} + + +Foam::tmp<Foam::volScalarField> Foam::blendingMethods::linear::f2() const +{ + return + min + ( + max + ( + (maxPartlyDispersedAlpha2_ - phase2_) + /(maxPartlyDispersedAlpha2_ - maxFullyDispersedAlpha2_ + 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 0000000000000000000000000000000000000000..dd319629dd935d6f919f1e6bcfac710961203889 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/linear/linear.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 <http://www.gnu.org/licenses/>. + +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 + + //- Max fraction of phase 1 which can be considered fully dispersed + const dimensionedScalar maxFullyDispersedAlpha1_; + + //- Max fraction of phase 1 which can be considered partly dispersed + const dimensionedScalar maxPartlyDispersedAlpha1_; + + //- Max fraction of phase 2 which can be considered fully dispersed + const dimensionedScalar maxFullyDispersedAlpha2_; + + //- Max fraction of phase 2 which can be considered partly dispersed + const dimensionedScalar maxPartlyDispersedAlpha2_; + + +public: + + //- Runtime type information + TypeName("linear"); + + + // Constructors + + //- Construct from a dictionary and two phases + linear + ( + const dictionary& dict, + const phaseModel& phase1, + const phaseModel& phase2 + ); + + + //- Destructor + ~linear(); + + + // Member Functions + + //- Factor for primary phase + virtual tmp<volScalarField> f1() const; + + //- Factor for secondary phase + virtual tmp<volScalarField> f2() 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 0de9e8939cb8c1efbe265dc11d65836963512eb6..5f2bd1d764ddee9850f4b2ae9fce563c9a8cd277 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/Make/files +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/Make/files @@ -10,6 +10,15 @@ 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/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 ef4bc12d0c79f51af6b87d92c32d543474d725f0..c25cedb14e8c0b99d63988cb547c85039c767106 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 f599fb9959f858e422c2ad11b570413dbe9b1afd..7109bc18aeba499360e35f974b2c540956c69f65 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 0000000000000000000000000000000000000000..fc0c2cbbbea73ac668a6a519719acffba10a50d1 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/phasePair/orderedPhasePair/orderedPhasePair.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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#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), + aspectRatio_ + ( + aspectRatioModel::New + ( + aspectRatioTable[*this], + *this + ) + ) +{} + + +// * * * * * * * * * * * * * * * * 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::volScalarField> Foam::orderedPhasePair::E() const +{ + 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 0000000000000000000000000000000000000000..e3530b06c91a254b7c3c3353738eb41a64f80746 --- /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 <http://www.gnu.org/licenses/>. + +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<aspectRatioModel> 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<volScalarField> 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 0000000000000000000000000000000000000000..b6089eb220936b3209f93653a2b21120a3caeafa --- /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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "phasePair.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +Foam::tmp<Foam::volScalarField> 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::volScalarField> Foam::phasePair::rho() const +{ + return phase1()*phase1().rho() + phase2()*phase2().rho(); +} + + +Foam::tmp<Foam::volScalarField> Foam::phasePair::magUr() const +{ + return mag(phase1().U() - phase2().U()); +} + + +Foam::tmp<Foam::volVectorField> Foam::phasePair::Ur() const +{ + return dispersed().U() - continuous().U(); +} + + +Foam::tmp<Foam::volScalarField> Foam::phasePair::Re() const +{ + return magUr()*dispersed().d()/continuous().nu(); +} + + +Foam::tmp<Foam::volScalarField> Foam::phasePair::Pr() const +{ + return + dispersed().nu()*dispersed().Cp()*dispersed().rho() + /dispersed().kappa(); +} + + +Foam::tmp<Foam::volScalarField> Foam::phasePair::Eo() const +{ + return EoH(dispersed().d()); +} + + +Foam::tmp<Foam::volScalarField> Foam::phasePair::EoH1() const +{ + return + EoH + ( + dispersed().d() + *cbrt(1 + 0.163*pow(Eo(), 0.757)) + ); +} + + +Foam::tmp<Foam::volScalarField> Foam::phasePair::EoH2() const +{ + return + EoH + ( + dispersed().d() + /cbrt(Eo()) + ); +} + + +Foam::tmp<Foam::volScalarField> Foam::phasePair::Mo() const +{ + return + mag(g()) + *continuous().nu() + *pow3(continuous().nu()*continuous().rho()/sigma()); +} + + +Foam::tmp<Foam::volScalarField> Foam::phasePair::Ta() const +{ + return Re()*pow(Mo(), 0.23); +} + + +Foam::tmp<Foam::volScalarField> Foam::phasePair::E() const +{ + FatalErrorIn("Foam::phasePair::dispersed() 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 0000000000000000000000000000000000000000..fb942c47f66726dbeb05bc87ae155a60bc5e3b2f --- /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 <http://www.gnu.org/licenses/>. + +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<dictionary, phasePairKey, phasePairKey::hash> + dictTable; + + //- Scalar hash table + typedef HashTable<scalar, phasePairKey, phasePairKey::hash> + 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<volScalarField> 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<volScalarField> rho() const; + + //- Relative velocity magnitude + tmp<volScalarField> magUr() const; + + //- Relative velocity + tmp<volVectorField> Ur() const; + + //- Reynolds number + tmp<volScalarField> Re() const; + + //- Prandtl number + tmp<volScalarField> Pr() const; + + //- Eotvos number + tmp<volScalarField> Eo() const; + + //- Eotvos number based on hydraulic diameter type 1 + tmp<volScalarField> EoH1() const; + + //- Eotvos number based on hydraulic diameter type 2 + tmp<volScalarField> EoH2() const; + + //- Morton Number + tmp<volScalarField> Mo() const; + + //- Takahashi Number + tmp<volScalarField> Ta() const; + + //- Aspect ratio + virtual tmp<volScalarField> 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 0000000000000000000000000000000000000000..9f2f428ea3a10699d74bf1c9eb4da4609708911d --- /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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +// * * * * * * * * * * * * * * * 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 0000000000000000000000000000000000000000..4280dd5fb3b92e6a72708f3b26acb27a16283877 --- /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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "phasePairKey.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::phasePairKey::hash::hash() +{} + + +Foam::phasePairKey::phasePairKey() +{} + + +Foam::phasePairKey::phasePairKey +( + const word& name1, + const word& name2, + const bool ordered +) +: + Pair<word>(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<word>::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<word, 3> 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 0000000000000000000000000000000000000000..d514d6406ca29f8342e47b55ada65b4025938aaf --- /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 <http://www.gnu.org/licenses/>. + +Class + Foam::phasePairKey + +Description + +SourceFiles + +\*---------------------------------------------------------------------------*/ + +#ifndef phasePairKey_H +#define phasePairKey_H + +#include "Pair.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class phasePairKey Declaration +\*---------------------------------------------------------------------------*/ + +class phasePairKey +: + public Pair<word> +{ +public: + + class hash + : + public Hash<phasePairKey> + { + 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 e1f9b221a35d38f187f33942878164f2201dd465..871c276e4f69a2e712008b6aa0f0b25e035352da 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" @@ -42,7 +50,8 @@ License Foam::twoPhaseSystem::twoPhaseSystem ( - const fvMesh& mesh + const fvMesh& mesh, + const dimensionedVector& g ) : IOdictionary @@ -97,119 +106,169 @@ Foam::twoPhaseSystem::twoPhaseSystem pos(phase2_)*fvc::div(phi_)/max(phase2_, scalar(0.0001)) ), - sigma_ + yWall_ ( - "sigma", - dimensionSet(1, 0, -2, 0, 0), - lookup("sigma") - ), + IOobject + ( + "yWall", + mesh.time().timeName(), + mesh + ), + wallDist(mesh).y() + ) +{ + phase2_.volScalarField::operator=(scalar(1) - phase1_); - Cvm_ - ( - "Cvm", - dimless, - lookup("Cvm") - ), - drag1_ + // Pairs + // ~~~~~ + + phasePair::scalarTable sigmaTable(lookup("sigma")); + phasePair::dictTable aspectRatioTable(lookup("aspectRatio")); + + pair_.set ( - dragModel::New + new phasePair ( - subDict("drag"), phase1_, - phase1_, - phase2_ + phase2_, + g, + sigmaTable ) - ), + ); - drag2_ + pair1In2_.set ( - dragModel::New + new orderedPhasePair ( - subDict("drag"), - phase2_, + phase1_, phase2_, - phase1_ + g, + sigmaTable, + aspectRatioTable ) - ), + ); - heatTransfer1_ + pair2In1_.set ( - heatTransferModel::New + new orderedPhasePair ( - subDict("heatTransfer"), - phase1_, + phase2_, phase1_, - phase2_ + g, + sigmaTable, + aspectRatioTable ) - ), + ); + + + // Models + // ~~~~~~ + + const dictionary& blendingDict(subDict("blending")); - heatTransfer2_ + drag_.set ( - heatTransferModel::New + new BlendedInterfacialModel<dragModel> ( - subDict("heatTransfer"), - phase2_, - phase2_, - phase1_ + lookup("drag"), + ( + blendingDict.isDict("drag") + ? blendingDict.subDict("drag") + : blendingDict.subDict("default") + ), + pair_, + pair1In2_, + pair2In1_ ) - ), + ); - lift1_ + virtualMass_.set ( - liftModel::New + new BlendedInterfacialModel<virtualMassModel> ( - subDict("lift"), - phase1_, - phase1_, - phase2_ + lookup("virtualMass"), + ( + blendingDict.isDict("virtualMass") + ? blendingDict.subDict("virtualMass") + : blendingDict.subDict("default") + ), + pair_, + pair1In2_, + pair2In1_ ) - ), + ); - lift2_ + heatTransfer_.set ( - liftModel::New + new BlendedInterfacialModel<heatTransferModel> ( - subDict("lift"), - phase2_, - phase2_, - phase1_ + lookup("heatTransfer"), + ( + blendingDict.isDict("heatTransfer") + ? blendingDict.subDict("heatTransfer") + : blendingDict.subDict("default") + ), + pair_, + pair1In2_, + pair2In1_ ) - ), - - dispersedPhase_(lookup("dispersedPhase")), + ); - residualPhaseFraction_ + lift_.set ( - readScalar(lookup("residualPhaseFraction")) - ), - - residualSlip_ + new BlendedInterfacialModel<liftModel> + ( + lookup("lift"), + ( + blendingDict.isDict("lift") + ? blendingDict.subDict("lift") + : blendingDict.subDict("default") + ), + pair_, + pair1In2_, + pair2In1_ + ) + ); + + wallLubrication_.set ( - "residualSlip", - dimVelocity, - lookup("residualSlip") - ) -{ - if + new BlendedInterfacialModel<wallLubricationModel> + ( + lookup("wallLubrication"), + ( + blendingDict.isDict("wallLubrication") + ? blendingDict.subDict("wallLubrication") + : blendingDict.subDict("default") + ), + pair_, + pair1In2_, + pair2In1_ + ) + ); + + turbulentDispersion_.set ( - !( - dispersedPhase_ == phase1_.name() - || dispersedPhase_ == phase2_.name() - || dispersedPhase_ == "both" + new BlendedInterfacialModel<turbulentDispersionModel> + ( + lookup("turbulentDispersion"), + ( + blendingDict.isDict("turbulentDispersion") + ? blendingDict.subDict("turbulentDispersion") + : blendingDict.subDict("default") + ), + pair_, + pair1In2_, + pair2In1_ ) - ) - { - FatalErrorIn("twoPhaseSystem::twoPhaseSystem(const fvMesh& mesh)") - << "invalid dispersedPhase " << dispersedPhase_ - << exit(FatalError); - } + ); +} - Info << "dispersedPhase is " << dispersedPhase_ << endl; - // Ensure the phase-fractions sum to 1 - phase2_.volScalarField::operator=(scalar(1) - phase1_); -} +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::twoPhaseSystem::~twoPhaseSystem() +{} // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // @@ -236,206 +295,39 @@ Foam::tmp<Foam::surfaceScalarField> Foam::twoPhaseSystem::calcPhi() const Foam::tmp<Foam::volScalarField> Foam::twoPhaseSystem::dragCoeff() const { - tmp<volScalarField> 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<fixedValueFvsPatchScalarField> - ( - phase1_.phi().boundaryField()[patchi] - ) - ) - { - dragCoeff.boundaryField()[patchi] = 0.0; - } - } - - return tdragCoeff; + return drag_->K(); } -Foam::tmp<Foam::volVectorField> Foam::twoPhaseSystem::liftForce -( - const volVectorField& U -) const +Foam::tmp<Foam::volScalarField> Foam::twoPhaseSystem::virtualMassCoeff() const { - tmp<volVectorField> 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<fixedValueFvsPatchScalarField> - ( - phase1_.phi().boundaryField()[patchi] - ) - ) - { - liftForce.boundaryField()[patchi] = vector::zero; - } - } - - return tliftForce; + return virtualMass_->K(); } Foam::tmp<Foam::volScalarField> Foam::twoPhaseSystem::heatTransferCoeff() const { - tmp<volScalarField> 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::volVectorField> Foam::twoPhaseSystem::liftForce() const +{ + return lift_->F<vector>(); +} - volScalarField alphaCoeff(max(phase1_*phase2_, residualPhaseFraction_)); - heatTransferCoeff *= alphaCoeff; - // Remove heatTransfer at fixed-flux boundaries - forAll(phase1_.phi().boundaryField(), patchi) - { - if - ( - isA<fixedValueFvsPatchScalarField> - ( - phase1_.phi().boundaryField()[patchi] - ) - ) - { - heatTransferCoeff.boundaryField()[patchi] = 0.0; - } - } +Foam::tmp<Foam::volVectorField> +Foam::twoPhaseSystem::wallLubricationForce() const +{ + return wallLubrication_->F<vector>(); +} - return theatTransferCoeff; + +Foam::tmp<Foam::volVectorField> +Foam::twoPhaseSystem::turbulentDispersionForce() const +{ + return turbulentDispersion_->F<vector>(); } @@ -661,18 +553,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 +564,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 cc781bcbc12c3ff3dc2f455e290c2803ec43f3b9..762dcf6d87f1c38accc4f6e2b96b084cd3a7ca6f 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,14 @@ SourceFiles namespace Foam { -// Forward declarations class dragModel; +class virtualMassModel; class heatTransferModel; class liftModel; +class wallLubricationModel; +class turbulentDispersionModel; + +template <class modelType> class BlendedInterfacialModel; /*---------------------------------------------------------------------------*\ Class twoPhaseSystem Declaration @@ -68,6 +63,8 @@ class twoPhaseSystem : public IOdictionary { +private: + // Private data //- Reference to the mesh @@ -85,38 +82,37 @@ class twoPhaseSystem //- Dilatation term volScalarField dgdt_; - //- Surface tension coefficient - dimensionedScalar sigma_; + //- Wall distance + volScalarField yWall_; - //- Virtual mass coefficient - dimensionedScalar Cvm_; + //- Unordered phase pair + autoPtr<phasePair> pair_; - //- Drag model for phase 1 - autoPtr<dragModel> drag1_; + //- Phase pair for phase 1 dispersed in phase 2 + autoPtr<orderedPhasePair> pair1In2_; - //- Drag model for phase 2 - autoPtr<dragModel> drag2_; + //- Phase pair for phase 2 dispersed in phase 1 + autoPtr<orderedPhasePair> pair2In1_; - //- Heat transfer model for phase 1 - autoPtr<heatTransferModel> heatTransfer1_; + //- Drag model + autoPtr<BlendedInterfacialModel<dragModel> > drag_; - //- Heat transfer model for phase 2 - autoPtr<heatTransferModel> heatTransfer2_; + //- Virtual mass model + autoPtr<BlendedInterfacialModel<virtualMassModel> > virtualMass_; - //- Lift model for phase 1 - autoPtr<liftModel> lift1_; + //- Heat transfer model + autoPtr<BlendedInterfacialModel<heatTransferModel> > heatTransfer_; - //- Lift model for phase 2 - autoPtr<liftModel> lift2_; + //- Lift model + autoPtr<BlendedInterfacialModel<liftModel> > lift_; - //- Name of the dispersed phase, or "both" - word dispersedPhase_; + //- Wall lubrication model + autoPtr<BlendedInterfacialModel<wallLubricationModel> > + wallLubrication_; - //- Residual phase fraction - scalar residualPhaseFraction_; - - //- Redisual slip - dimensionedScalar residualSlip_; + //- Wall lubrication model + autoPtr<BlendedInterfacialModel<turbulentDispersionModel> > + turbulentDispersion_; // Private member functions @@ -130,30 +126,38 @@ public: // Constructors //- Construct from fvMesh - twoPhaseSystem(const fvMesh&); + twoPhaseSystem(const fvMesh&, const dimensionedVector& g); //- Destructor - virtual ~twoPhaseSystem() - {} + virtual ~twoPhaseSystem(); // Member Functions + //- Return the mixture density + tmp<volScalarField> rho() const; + + //- Return the mixture velocity + tmp<volVectorField> U() const; + //- Return the drag coefficient tmp<volScalarField> dragCoeff() const; + //- Return the virtual mass coefficient + tmp<volScalarField> virtualMassCoeff() const; + //- Return the heat transfer coefficient tmp<volScalarField> heatTransferCoeff() const; //- Return the lift force - tmp<volVectorField> liftForce(const volVectorField& U) const; + tmp<volVectorField> liftForce() const; - //- Return the mixture density - tmp<volScalarField> rho() const; + //- Return the wall lubrication force + tmp<volVectorField> wallLubricationForce() const; - //- Return the mixture velocity - tmp<volVectorField> U() const; + //- Return the wall lubrication force + tmp<volVectorField> turbulentDispersionForce() const; //- Solve for the two-phase-fractions void solve(); @@ -169,145 +173,44 @@ public: // Access + //- Return the drag model for the supplied phase + const dragModel& drag(const phaseModel& phase) const; + + //- Return the virtual mass model for the supplied phase + const virtualMassModel& virtualMass(const phaseModel& phase) const; + + //- Return the surface tension coefficient + const dimensionedScalar& sigma() const; + //- Return the mesh - const fvMesh& mesh() const - { - return mesh_; - } + inline const fvMesh& mesh() const; //- Return phase model 1 - const phaseModel& phase1() const - { - return phase1_; - } + inline const phaseModel& phase1() const; //- Return non-const access to phase model 1 - phaseModel& phase1() - { - return phase1_; - } + inline phaseModel& phase1(); //- Return phase model 2 - const phaseModel& phase2() const - { - return phase2_; - } + inline const phaseModel& phase2() const; //- Return non-const access to phase model 2 - phaseModel& phase2() - { - return phase2_; - } + inline phaseModel& phase2(); //- Return the phase not given as an argument - const phaseModel& otherPhase(const phaseModel& phase) const - { - if (&phase == &phase1_) - { - return phase2_; - } - else - { - return phase1_; - } - } + inline const phaseModel& otherPhase(const phaseModel& phase) const; //- Return the mixture flux - const surfaceScalarField& phi() const - { - return phi_; - } + inline const surfaceScalarField& phi() const; //- Return non-const access to the the mixture flux - surfaceScalarField& phi() - { - return phi_; - } + inline surfaceScalarField& 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_(); - } + inline const volScalarField& dgdt() const; - //- Return the drag model for the supplied phase - const dragModel& drag(const phaseModel& phase) const - { - if (&phase == &phase1_) - { - return drag1_(); - } - else - { - return drag2_(); - } - } - - //- 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 surface tension coefficient - dimensionedScalar sigma() const - { - return sigma_; - } - - //- Return the virtual-mass coefficient - dimensionedScalar Cvm() const - { - return Cvm_; - } + //- Return non-const access to the dilatation parameter + inline volScalarField& dgdt(); }; @@ -317,6 +220,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 0000000000000000000000000000000000000000..e832b0fa1e626e37a7ae72541d209a2fc7e792d3 --- /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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +// * * * * * * * * * * * * * * * 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/src/TurbulenceModels/phaseIncompressible/LES/Niceno/NicenoKEqn.C b/src/TurbulenceModels/phaseIncompressible/LES/Niceno/NicenoKEqn.C index cadaafc818a59944af787bc35b48595f053fd7b8..07002a6a1ec6c2190403e7b0a50efc9a17a9bc44 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<volScalarField> NicenoKEqn<BasicTurbulenceModel>::bubbleG() const tmp<volScalarField> 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 6613d81636819164a8aedefbbeca362f37e8aea7..b55fa8870808e450cdce715243faf04ef62528fb 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 6119b835798469dd452bacc8ca7661d629706aa3..8454103e3b8ef1851fffa3df41867c99ae146b7c 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<volScalarField> LaheyKEpsilon<BasicTurbulenceModel>::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 6fc1832bdf824312d2d3c36899183177db2f5303..b6eef980952c987fb3a6f193b9c075094ffb077e 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<BasicTurbulenceModel>::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 1c811169fefec56f8f77e7a952508af80846d3f9..c759c5f6add2722d9cb2f8831fadb6ff4495e4ed 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<volScalarField> mixtureKEpsilon<BasicTurbulenceModel>::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<volScalarField> mixtureKEpsilon<BasicTurbulenceModel>::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<volScalarField> mixtureKEpsilon<BasicTurbulenceModel>::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<volScalarField> mixtureKEpsilon<BasicTurbulenceModel>::bubbleG() const // Simple model // tmp<volScalarField> bubbleG // ( - // Cp_*sqr(liquid)*gas*fluid.drag(gas).K(magUr)*sqr(magUr) + // Cp_*sqr(liquid)*gas*fluid.drag(gas).K()*sqr(magUr) // ); return bubbleG;