diff --git a/applications/solvers/multiphase/compressibleInterFoam/Allwclean b/applications/solvers/multiphase/compressibleInterFoam/Allwclean index deb5e2378ba964821faf55e012c1ea79efafeb16..71bff64a720d8dad7966d6f5c0a950e306afd85c 100755 --- a/applications/solvers/multiphase/compressibleInterFoam/Allwclean +++ b/applications/solvers/multiphase/compressibleInterFoam/Allwclean @@ -2,6 +2,7 @@ cd ${0%/*} || exit 1 # Run from this directory wclean libso twoPhaseMixtureThermo +wclean libso surfaceTensionModels wclean wclean compressibleInterDyMFoam diff --git a/applications/solvers/multiphase/compressibleInterFoam/Allwmake b/applications/solvers/multiphase/compressibleInterFoam/Allwmake index 20da00c472977322985e8067f4a32b45ea37d735..29bafc3a616ce699e97f28278add05166ad997e1 100755 --- a/applications/solvers/multiphase/compressibleInterFoam/Allwmake +++ b/applications/solvers/multiphase/compressibleInterFoam/Allwmake @@ -5,6 +5,7 @@ cd ${0%/*} || exit 1 # Run from this directory . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments wmake $targetType twoPhaseMixtureThermo +wmake $targetType surfaceTensionModels wmake $targetType wmake $targetType compressibleInterDyMFoam diff --git a/applications/solvers/multiphase/compressibleInterFoam/Make/options b/applications/solvers/multiphase/compressibleInterFoam/Make/options index b947836f65eda540a6d54e4770c67f263be75458..29b12f3114097bdc6a5051da6c79f091bd1c2504 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/Make/options +++ b/applications/solvers/multiphase/compressibleInterFoam/Make/options @@ -13,6 +13,7 @@ EXE_INC = \ EXE_LIBS = \ -ltwoPhaseMixtureThermo \ + -ltwoPhaseSurfaceTension \ -lcompressibleTransportModels \ -lfluidThermophysicalModels \ -lspecie \ diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/Make/options b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/Make/options index b44af44a7231a401a9421a4c641e382e69b5bec7..4de8fd2713cc8f52111c21c78782cf9bd60b68b4 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/Make/options +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/Make/options @@ -16,6 +16,7 @@ EXE_INC = \ EXE_LIBS = \ -ltwoPhaseMixtureThermo \ + -ltwoPhaseSurfaceTension \ -lcompressibleTransportModels \ -lfluidThermophysicalModels \ -lspecie \ diff --git a/applications/solvers/multiphase/compressibleInterFoam/surfaceTensionModels/Make/files b/applications/solvers/multiphase/compressibleInterFoam/surfaceTensionModels/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..fa34a838247fdba4426893587e08ca5ed788d755 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/surfaceTensionModels/Make/files @@ -0,0 +1,3 @@ +liquidProperties/liquidPropertiesSurfaceTension.C + +LIB = $(FOAM_LIBBIN)/libtwoPhaseSurfaceTension diff --git a/applications/solvers/multiphase/compressibleInterFoam/surfaceTensionModels/Make/options b/applications/solvers/multiphase/compressibleInterFoam/surfaceTensionModels/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..0d8cc30e2d52ef0d81c7e0365da30c786ce8b076 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/surfaceTensionModels/Make/options @@ -0,0 +1,15 @@ +EXE_INC = \ + -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ + -I$(LIB_SRC)/transportModels/compressible/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude + +LIB_LIBS = \ + -linterfaceProperties \ + -lcompressibleTransportModels \ + -lfluidThermophysicalModels \ + -lspecie \ + -lthermophysicalProperties \ + -lfiniteVolume diff --git a/applications/solvers/multiphase/compressibleInterFoam/surfaceTensionModels/liquidProperties/liquidPropertiesSurfaceTension.C b/applications/solvers/multiphase/compressibleInterFoam/surfaceTensionModels/liquidProperties/liquidPropertiesSurfaceTension.C new file mode 100644 index 0000000000000000000000000000000000000000..71e10898023f6bf6e8c3129825cd8f2ee56bdcf3 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/surfaceTensionModels/liquidProperties/liquidPropertiesSurfaceTension.C @@ -0,0 +1,155 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2017 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "liquidPropertiesSurfaceTension.H" +#include "liquidThermo.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace surfaceTensionModels +{ + defineTypeNameAndDebug(liquidProperties, 0); + addToRunTimeSelectionTable + ( + surfaceTensionModel, + liquidProperties, + dictionary + ); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::surfaceTensionModels::liquidProperties::liquidProperties +( + const dictionary& dict, + const fvMesh& mesh +) +: + surfaceTensionModel(mesh), + phaseName_(dict.lookup("phase")) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::surfaceTensionModels::liquidProperties::~liquidProperties() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp<Foam::volScalarField> +Foam::surfaceTensionModels::liquidProperties::sigma() const +{ + const heRhoThermopureMixtureliquidProperties& thermo = + mesh_.lookupObject<heRhoThermopureMixtureliquidProperties> + ( + IOobject::groupName(basicThermo::dictName, phaseName_) + ); + + const Foam::liquidProperties& liquid = thermo.mixture().properties(); + + tmp<volScalarField> tsigma + ( + new volScalarField + ( + IOobject + ( + "sigma", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + mesh_, + dimSigma + ) + ); + volScalarField& sigma = tsigma.ref(); + + const volScalarField& T = thermo.T(); + const volScalarField& p = thermo.p(); + + volScalarField::Internal& sigmai = sigma; + const volScalarField::Internal& pi = p; + const volScalarField::Internal& Ti = T; + + forAll(sigmai, celli) + { + sigmai[celli] = liquid.sigma(pi[celli], Ti[celli]); + } + + volScalarField::Boundary& sigmaBf = sigma.boundaryFieldRef(); + const volScalarField::Boundary& pBf = p.boundaryField(); + const volScalarField::Boundary& TBf = T.boundaryField(); + + forAll(sigmaBf, patchi) + { + scalarField& sigmaPf = sigmaBf[patchi]; + const scalarField& pPf = pBf[patchi]; + const scalarField& TPf = TBf[patchi]; + + forAll(sigmaPf, facei) + { + sigmaPf[facei] = liquid.sigma(pPf[facei], TPf[facei]); + } + } + + return tsigma; +} + + +bool Foam::surfaceTensionModels::liquidProperties::read +( + const dictionary& dict +) +{ + return true; +} + + +bool Foam::surfaceTensionModels::liquidProperties::writeData +( + Ostream& os +) const +{ + if (surfaceTensionModel::writeData(os)) + { + return os.good(); + } + else + { + return false; + } +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/compressibleInterFoam/surfaceTensionModels/liquidProperties/liquidPropertiesSurfaceTension.H b/applications/solvers/multiphase/compressibleInterFoam/surfaceTensionModels/liquidProperties/liquidPropertiesSurfaceTension.H new file mode 100644 index 0000000000000000000000000000000000000000..b209dfc9d6e34ef2a1163e04637ddf859102b901 --- /dev/null +++ b/applications/solvers/multiphase/compressibleInterFoam/surfaceTensionModels/liquidProperties/liquidPropertiesSurfaceTension.H @@ -0,0 +1,123 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2017 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +Class + Foam::surfaceTensionModels::liquidProperties + +Description + Temperature-dependent surface tension model in which the surface tension + function provided by the phase Foam::liquidProperties class is used. + +Usage + \table + Property | Description | Required | Default value + phase | Phase name | yes | + \endtable + + Example of the surface tension specification: + \verbatim + sigma + { + type liquidProperties; + phase water; + } + \endverbatim + +See also + Foam::surfaceTensionModel + +SourceFiles + liquidPropertiesSurfaceTension.C + +\*---------------------------------------------------------------------------*/ + +#ifndef liquidPropertiesSurfaceTension_H +#define liquidPropertiesSurfaceTension_H + +#include "surfaceTensionModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +namespace surfaceTensionModels +{ + +/*---------------------------------------------------------------------------*\ + Class liquidProperties Declaration +\*---------------------------------------------------------------------------*/ + +class liquidProperties +: + public surfaceTensionModel +{ + // Private data + + //- Name of the liquid phase + word phaseName_; + + +public: + + //- Runtime type information + TypeName("liquidProperties"); + + + // Constructors + + //- Construct from dictionary and mesh + liquidProperties + ( + const dictionary& dict, + const fvMesh& mesh + ); + + + //- Destructor + virtual ~liquidProperties(); + + + // Member Functions + + //- Surface tension coefficient + virtual tmp<volScalarField> sigma() const; + + //- Update surface tension coefficient from given dictionary + virtual bool read(const dictionary& dict); + + //- Write in dictionary format + virtual bool writeData(Ostream& os) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace surfaceTensionModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/mixtures/pureMixture/pureMixture.H b/src/thermophysicalModels/basic/mixtures/pureMixture/pureMixture.H index d49aa797ff73b20bd387f4a530adf9fecd0b524b..f7f213f10a9781eccb0983f21c7f7fb4e53b3875 100644 --- a/src/thermophysicalModels/basic/mixtures/pureMixture/pureMixture.H +++ b/src/thermophysicalModels/basic/mixtures/pureMixture/pureMixture.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -73,6 +73,11 @@ public: // Member functions + const ThermoType& mixture() const + { + return mixture_; + } + const ThermoType& cellMixture(const label) const { return mixture_; diff --git a/src/thermophysicalModels/basic/rhoThermo/liquidThermo.C b/src/thermophysicalModels/basic/rhoThermo/liquidThermo.C index c023c506838c94851da381c0a38a6c28aea2449b..de4a576b10cb4dac64be11b207ade5f918274865 100644 --- a/src/thermophysicalModels/basic/rhoThermo/liquidThermo.C +++ b/src/thermophysicalModels/basic/rhoThermo/liquidThermo.C @@ -23,16 +23,7 @@ License \*---------------------------------------------------------------------------*/ -#include "rhoThermo.H" -#include "heRhoThermo.H" -#include "pureMixture.H" -#include "thermo.H" -#include "sensibleEnthalpy.H" -#include "sensibleInternalEnergy.H" - -#include "thermophysicalPropertiesSelector.H" -#include "liquidProperties.H" - +#include "liquidThermo.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -42,19 +33,6 @@ namespace Foam /* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */ -typedef heRhoThermo -< - rhoThermo, - pureMixture - < - species::thermo - < - thermophysicalPropertiesSelector<liquidProperties>, - sensibleInternalEnergy - > - > -> heRhoThermopureMixtureliquidProperties; - defineTemplateTypeNameAndDebugWithName ( heRhoThermopureMixtureliquidProperties, diff --git a/src/thermophysicalModels/basic/rhoThermo/liquidThermo.H b/src/thermophysicalModels/basic/rhoThermo/liquidThermo.H new file mode 100644 index 0000000000000000000000000000000000000000..de5aed514337bbfe834b9514d2a7407217f4653c --- /dev/null +++ b/src/thermophysicalModels/basic/rhoThermo/liquidThermo.H @@ -0,0 +1,59 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2017 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "rhoThermo.H" +#include "heRhoThermo.H" +#include "pureMixture.H" +#include "thermo.H" +#include "sensibleInternalEnergy.H" +#include "thermophysicalPropertiesSelector.H" +#include "liquidProperties.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */ + +typedef heRhoThermo +< + rhoThermo, + pureMixture + < + species::thermo + < + thermophysicalPropertiesSelector<liquidProperties>, + sensibleInternalEnergy + > + > +> heRhoThermopureMixtureliquidProperties; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/thermophysicalModels/thermophysicalProperties/thermophysicalPropertiesSelector/thermophysicalPropertiesSelector.H b/src/thermophysicalModels/thermophysicalProperties/thermophysicalPropertiesSelector/thermophysicalPropertiesSelector.H index 690e4a950534d689aacf58899d9fc1c8fbfc5787..7edd6225af44da03d08f5b703d219c46d8386732 100644 --- a/src/thermophysicalModels/thermophysicalProperties/thermophysicalPropertiesSelector/thermophysicalPropertiesSelector.H +++ b/src/thermophysicalModels/thermophysicalProperties/thermophysicalPropertiesSelector/thermophysicalPropertiesSelector.H @@ -80,6 +80,10 @@ public: // Member Functions + //- Return reference to the selected physical properties class + inline const ThermophysicalProperties& properties() const; + + // Physical constants which define the specie //- Molecular weight [kg/kmol] diff --git a/src/thermophysicalModels/thermophysicalProperties/thermophysicalPropertiesSelector/thermophysicalPropertiesSelectorI.H b/src/thermophysicalModels/thermophysicalProperties/thermophysicalPropertiesSelector/thermophysicalPropertiesSelectorI.H index 870aa1dbed32356788193b0c45f498ade1d6383e..a074d3714690e29d73f59fe68a73f530c4fccead 100644 --- a/src/thermophysicalModels/thermophysicalProperties/thermophysicalPropertiesSelector/thermophysicalPropertiesSelectorI.H +++ b/src/thermophysicalModels/thermophysicalProperties/thermophysicalPropertiesSelector/thermophysicalPropertiesSelectorI.H @@ -25,6 +25,14 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template<class ThermophysicalProperties> +inline const ThermophysicalProperties& +Foam::thermophysicalPropertiesSelector<ThermophysicalProperties> +::properties() const +{ + return propertiesPtr_(); +} + template<class ThermophysicalProperties> inline Foam::scalar Foam::thermophysicalPropertiesSelector<ThermophysicalProperties>::W() const diff --git a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/constant/thermophysicalProperties b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/constant/thermophysicalProperties index 39d2517cd86d45a05d71b0355cdf13421fc97525..be327980e06cf326a199e7c78118c40d8f979d58 100644 --- a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/constant/thermophysicalProperties +++ b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/constant/thermophysicalProperties @@ -19,6 +19,10 @@ phases (water air); pMin 10000; -sigma 0.07; +sigma +{ + type liquidProperties; + phase water; +} // ************************************************************************* //