mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
surfaceTensionModels::liquidProperties: New temperature-dependent surface tension model
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
for use with e.g. compressibleInterFoam, see
tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
wclean libso twoPhaseMixtureThermo
|
||||
wclean libso surfaceTensionModels
|
||||
wclean
|
||||
wclean compressibleInterDyMFoam
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -13,6 +13,7 @@ EXE_INC = \
|
||||
|
||||
EXE_LIBS = \
|
||||
-ltwoPhaseMixtureThermo \
|
||||
-ltwoPhaseSurfaceTension \
|
||||
-lcompressibleTransportModels \
|
||||
-lfluidThermophysicalModels \
|
||||
-lspecie \
|
||||
|
||||
@ -16,6 +16,7 @@ EXE_INC = \
|
||||
|
||||
EXE_LIBS = \
|
||||
-ltwoPhaseMixtureThermo \
|
||||
-ltwoPhaseSurfaceTension \
|
||||
-lcompressibleTransportModels \
|
||||
-lfluidThermophysicalModels \
|
||||
-lspecie \
|
||||
|
||||
@ -0,0 +1,3 @@
|
||||
liquidProperties/liquidPropertiesSurfaceTension.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libtwoPhaseSurfaceTension
|
||||
@ -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
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -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
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -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_;
|
||||
|
||||
@ -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,
|
||||
|
||||
59
src/thermophysicalModels/basic/rhoThermo/liquidThermo.H
Normal file
59
src/thermophysicalModels/basic/rhoThermo/liquidThermo.H
Normal file
@ -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
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -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]
|
||||
|
||||
@ -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
|
||||
|
||||
@ -19,6 +19,10 @@ phases (water air);
|
||||
|
||||
pMin 10000;
|
||||
|
||||
sigma 0.07;
|
||||
sigma
|
||||
{
|
||||
type liquidProperties;
|
||||
phase water;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
Reference in New Issue
Block a user