compressibleInterFoam: Add support for run-time selectable equation of state

This commit is contained in:
Henry
2012-04-16 15:54:08 +01:00
parent 1d167418e9
commit 629bca4de9
22 changed files with 1076 additions and 135 deletions

View File

@ -2,6 +2,7 @@
cd ${0%/*} || exit 1 # run from this directory
set -x
wclean libso phaseEquationsOfState
wclean
wclean compressibleInterDyMFoam

View File

@ -2,6 +2,7 @@
cd ${0%/*} || exit 1 # run from this directory
set -x
wmake libso phaseEquationsOfState
wmake
wmake compressibleInterDyMFoam

View File

@ -2,12 +2,14 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
-IphaseEquationsOfState/lnInclude \
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-ltwoPhaseInterfaceProperties \
-lincompressibleTransportModels \
-lphaseEquationsOfState \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \
-lincompressibleLESModels \

View File

@ -15,6 +15,6 @@
);
// Update compressibilities
psi1 = 1.0/(R1*T);
psi2 = 1.0/(R2*T);
psi1 = eos1->psi(p, T);
psi2 = eos2->psi(p, T);
}

View File

@ -3,6 +3,7 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
-I../phaseEquationsOfState/lnInclude \
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
@ -12,6 +13,7 @@ EXE_INC = \
EXE_LIBS = \
-ltwoPhaseInterfaceProperties \
-lincompressibleTransportModels \
-lphaseEquationsOfState \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \
-lincompressibleLESModels \

View File

@ -43,6 +43,7 @@ Description
#include "subCycle.H"
#include "interfaceProperties.H"
#include "twoPhaseMixture.H"
#include "phaseEquationOfState.H"
#include "turbulenceModel.H"
#include "pimpleControl.H"

View File

@ -40,6 +40,7 @@ Description
#include "subCycle.H"
#include "interfaceProperties.H"
#include "twoPhaseMixture.H"
#include "phaseEquationOfState.H"
#include "turbulenceModel.H"
#include "pimpleControl.H"

View File

@ -28,83 +28,6 @@
#include "createPhi.H"
Info<< "Reading transportProperties\n" << endl;
twoPhaseMixture twoPhaseProperties(U, phi);
volScalarField& alpha1(twoPhaseProperties.alpha1());
Info<< "Calculating phase-fraction alpha" << twoPhaseProperties.phase2Name()
<< nl << endl;
volScalarField alpha2
(
"alpha" + twoPhaseProperties.phase2Name(),
scalar(1) - alpha1
);
dimensionedScalar rho10
(
twoPhaseProperties.subDict
(
twoPhaseProperties.phase1Name()
).lookup("rho0")
);
dimensionedScalar rho20
(
twoPhaseProperties.subDict
(
twoPhaseProperties.phase2Name()
).lookup("rho0")
);
dimensionedScalar k1
(
twoPhaseProperties.subDict
(
twoPhaseProperties.phase1Name()
).lookup("k")
);
dimensionedScalar k2
(
twoPhaseProperties.subDict
(
twoPhaseProperties.phase2Name()
).lookup("k")
);
dimensionedScalar Cv1
(
twoPhaseProperties.subDict
(
twoPhaseProperties.phase1Name()
).lookup("Cv")
);
dimensionedScalar Cv2
(
twoPhaseProperties.subDict
(
twoPhaseProperties.phase2Name()
).lookup("Cv")
);
dimensionedScalar R1
(
twoPhaseProperties.subDict
(
twoPhaseProperties.phase1Name()
).lookup("R")
);
dimensionedScalar R2
(
twoPhaseProperties.subDict
(
twoPhaseProperties.phase2Name()
).lookup("R")
);
Info<< "Reading field T\n" << endl;
volScalarField T
(
@ -119,6 +42,95 @@
mesh
);
volScalarField p
(
IOobject
(
"p",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
p_rgh
);
Info<< "Reading transportProperties\n" << endl;
twoPhaseMixture twoPhaseProperties(U, phi);
volScalarField& alpha1(twoPhaseProperties.alpha1());
Info<< "Calculating phase-fraction alpha" << twoPhaseProperties.phase2Name()
<< nl << endl;
volScalarField alpha2
(
"alpha" + twoPhaseProperties.phase2Name(),
scalar(1) - alpha1
);
dimensionedScalar k1
(
"k",
dimensionSet(1, 1, -3, -1, 0),
twoPhaseProperties.subDict
(
twoPhaseProperties.phase1Name()
).lookup("k")
);
dimensionedScalar k2
(
"k",
dimensionSet(1, 1, -3, -1, 0),
twoPhaseProperties.subDict
(
twoPhaseProperties.phase2Name()
).lookup("k")
);
dimensionedScalar Cv1
(
"Cv",
dimensionSet(0, 2, -2, -1, 0),
twoPhaseProperties.subDict
(
twoPhaseProperties.phase1Name()
).lookup("Cv")
);
dimensionedScalar Cv2
(
"Cv",
dimensionSet(0, 2, -2, -1, 0),
twoPhaseProperties.subDict
(
twoPhaseProperties.phase2Name()
).lookup("Cv")
);
autoPtr<phaseEquationOfState> eos1
(
phaseEquationOfState::New
(
twoPhaseProperties.subDict
(
twoPhaseProperties.phase1Name()
)
)
);
autoPtr<phaseEquationOfState> eos2
(
phaseEquationOfState::New
(
twoPhaseProperties.subDict
(
twoPhaseProperties.phase2Name()
)
)
);
volScalarField psi1
(
IOobject
@ -127,8 +139,9 @@
runTime.timeName(),
mesh
),
1.0/(R1*T)
eos1->psi(p, T)
);
psi1.oldTime();
volScalarField psi2
(
@ -138,7 +151,7 @@
runTime.timeName(),
mesh
),
1.0/(R2*T)
eos2->psi(p, T)
);
psi2.oldTime();
@ -148,26 +161,8 @@
volScalarField gh("gh", g & mesh.C());
surfaceScalarField ghf("ghf", g & mesh.Cf());
volScalarField p
(
IOobject
(
"p",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
max
(
(p_rgh + gh*(alpha1*rho10 + alpha2*rho20))
/(1.0 - gh*(alpha1*psi1 + alpha2*psi2)),
pMin
)
);
volScalarField rho1(rho10 + psi1*p);
volScalarField rho2(rho20 + psi2*p);
volScalarField rho1(eos1->rho(p, T));
volScalarField rho2(eos2->rho(p, T));
volScalarField rho
(

View File

@ -1,6 +1,6 @@
{
rho1 = rho10 + psi1*p;
rho2 = rho20 + psi2*p;
rho1 = eos1->rho(p, T);
rho2 = eos2->rho(p, T);
volScalarField rAU = 1.0/UEqn.A();
surfaceScalarField rAUf = fvc::interpolate(rAU);
@ -81,15 +81,10 @@
U += rAU*fvc::reconstruct((phi - phiU)/rAUf);
U.correctBoundaryConditions();
p = max
(
(p_rgh + gh*(alpha1*rho10 + alpha2*rho20))
/(1.0 - gh*(alpha1*psi1 + alpha2*psi2)),
pMin
);
p = max(p_rgh + (alpha1*rho1 + alpha2*rho2)*gh, pMin);
rho1 = rho10 + psi1*p;
rho2 = rho20 + psi2*p;
rho1 = eos1->rho(p, T);
rho2 = eos2->rho(p, T);
Info<< "max(U) " << max(mag(U)).value() << endl;
Info<< "min(p_rgh) " << min(p_rgh).value() << endl;

View File

@ -0,0 +1,7 @@
phaseEquationOfState/phaseEquationOfState.C
phaseEquationOfState/newPhaseEquationOfState.C
constant/constant.C
linear/linear.C
perfectFluid/perfectFluid.C
LIB = $(FOAM_LIBBIN)/libphaseEquationsOfState

View File

@ -0,0 +1,6 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude
LIB_LIBS = \
-lincompressibleTransportModels

View File

@ -0,0 +1,114 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "constant.H"
#include "volFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace phaseEquationsOfState
{
defineTypeNameAndDebug(constant, 0);
addToRunTimeSelectionTable
(
phaseEquationOfState,
constant,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::phaseEquationsOfState::constant::constant
(
const dictionary& dict
)
:
phaseEquationOfState(dict),
rho_("rho", dimDensity, dict.lookup("rho"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::phaseEquationsOfState::constant::~constant()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::phaseEquationsOfState::constant::rho
(
const volScalarField& p,
const volScalarField& T
) const
{
return tmp<Foam::volScalarField>
(
new volScalarField
(
IOobject
(
"rho",
p.time().timeName(),
p.mesh()
),
p.mesh(),
rho_
)
);
}
Foam::tmp<Foam::volScalarField> Foam::phaseEquationsOfState::constant::psi
(
const volScalarField& p,
const volScalarField& T
) const
{
return tmp<Foam::volScalarField>
(
new volScalarField
(
IOobject
(
"psi",
p.time().timeName(),
p.mesh()
),
p.mesh(),
dimensionedScalar("psi", dimDensity/dimPressure, 0)
)
);
}
// ************************************************************************* //

View File

@ -0,0 +1,106 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::phaseEquationsOfState::constant
Description
Constant phase density model.
SourceFiles
constant.C
\*---------------------------------------------------------------------------*/
#ifndef constant_H
#define constant_H
#include "phaseEquationOfState.H"
#include "dimensionedTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace phaseEquationsOfState
{
/*---------------------------------------------------------------------------*\
Class constant Declaration
\*---------------------------------------------------------------------------*/
class constant
:
public phaseEquationOfState
{
// Private data
//- The constant density of the phase
dimensionedScalar rho_;
public:
//- Runtime type information
TypeName("constant");
// Constructors
//- Construct from components
constant
(
const dictionary& dict
);
//- Destructor
virtual ~constant();
// Member Functions
tmp<volScalarField> rho
(
const volScalarField& p,
const volScalarField& T
) const;
tmp<volScalarField> psi
(
const volScalarField& p,
const volScalarField& T
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace phaseEquationsOfState
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,114 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 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 "volFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace phaseEquationsOfState
{
defineTypeNameAndDebug(linear, 0);
addToRunTimeSelectionTable
(
phaseEquationOfState,
linear,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::phaseEquationsOfState::linear::linear
(
const dictionary& dict
)
:
phaseEquationOfState(dict),
rho0_("rho0", dimDensity, dict.lookup("rho0")),
psi_("psi", dimDensity/dimPressure, dict.lookup("psi"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::phaseEquationsOfState::linear::~linear()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::phaseEquationsOfState::linear::rho
(
const volScalarField& p,
const volScalarField& T
) const
{
return tmp<Foam::volScalarField>
(
new volScalarField
(
IOobject
(
"rho",
p.time().timeName(),
p.mesh()
),
rho0_ + psi_*p
)
);
}
Foam::tmp<Foam::volScalarField> Foam::phaseEquationsOfState::linear::psi
(
const volScalarField& p,
const volScalarField& T
) const
{
return tmp<Foam::volScalarField>
(
new volScalarField
(
IOobject
(
"psi",
p.time().timeName(),
p.mesh()
),
p.mesh(),
psi_
)
);
}
// ************************************************************************* //

View File

@ -0,0 +1,109 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 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::phaseEquationsOfState::linear
Description
Linear phase density model.
SourceFiles
linear.C
\*---------------------------------------------------------------------------*/
#ifndef linear_H
#define linear_H
#include "phaseEquationOfState.H"
#include "dimensionedTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace phaseEquationsOfState
{
/*---------------------------------------------------------------------------*\
Class linear Declaration
\*---------------------------------------------------------------------------*/
class linear
:
public phaseEquationOfState
{
// Private data
//- The reference density of the phase
dimensionedScalar rho0_;
//- The constant compressibility of the phase
dimensionedScalar psi_;
public:
//- Runtime type information
TypeName("linear");
// Constructors
//- Construct from components
linear
(
const dictionary& dict
);
//- Destructor
virtual ~linear();
// Member Functions
tmp<volScalarField> rho
(
const volScalarField& p,
const volScalarField& T
) const;
tmp<volScalarField> psi
(
const volScalarField& p,
const volScalarField& T
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace phaseEquationsOfState
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,113 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 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 "perfectFluid.H"
#include "volFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace phaseEquationsOfState
{
defineTypeNameAndDebug(perfectFluid, 0);
addToRunTimeSelectionTable
(
phaseEquationOfState,
perfectFluid,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::phaseEquationsOfState::perfectFluid::perfectFluid
(
const dictionary& dict
)
:
phaseEquationOfState(dict),
rho0_("rho0", dimDensity, dict.lookup("rho0")),
R_("R", dimensionSet(0, 2, -2, -1, 0), dict.lookup("R"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::phaseEquationsOfState::perfectFluid::~perfectFluid()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volScalarField> Foam::phaseEquationsOfState::perfectFluid::rho
(
const volScalarField& p,
const volScalarField& T
) const
{
return tmp<Foam::volScalarField>
(
new volScalarField
(
IOobject
(
"rho",
p.time().timeName(),
p.mesh()
),
rho0_ + psi(p, T)*p
)
);
}
Foam::tmp<Foam::volScalarField> Foam::phaseEquationsOfState::perfectFluid::psi
(
const volScalarField& p,
const volScalarField& T
) const
{
return tmp<Foam::volScalarField>
(
new volScalarField
(
IOobject
(
"psi",
p.time().timeName(),
p.mesh()
),
1.0/(R_*T)
)
);
}
// ************************************************************************* //

View File

@ -0,0 +1,109 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 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::phaseEquationsOfState::perfectFluid
Description
PerfectFluid phase density model.
SourceFiles
perfectFluid.C
\*---------------------------------------------------------------------------*/
#ifndef perfectFluid_H
#define perfectFluid_H
#include "phaseEquationOfState.H"
#include "dimensionedTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace phaseEquationsOfState
{
/*---------------------------------------------------------------------------*\
Class perfectFluid Declaration
\*---------------------------------------------------------------------------*/
class perfectFluid
:
public phaseEquationOfState
{
// Private data
//- The reference density of the phase
dimensionedScalar rho0_;
//- The fluid constant of the phase
dimensionedScalar R_;
public:
//- Runtime type information
TypeName("perfectFluid");
// Constructors
//- Construct from components
perfectFluid
(
const dictionary& dict
);
//- Destructor
virtual ~perfectFluid();
// Member Functions
tmp<volScalarField> rho
(
const volScalarField& p,
const volScalarField& T
) const;
tmp<volScalarField> psi
(
const volScalarField& p,
const volScalarField& T
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace phaseEquationsOfState
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,60 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 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 "phaseEquationOfState.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::phaseEquationOfState> Foam::phaseEquationOfState::New
(
const dictionary& dict
)
{
word phaseEquationOfStateType
(
dict.subDict("equationOfState").lookup("type")
);
Info<< "Selecting phaseEquationOfState "
<< phaseEquationOfStateType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(phaseEquationOfStateType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorIn("phaseEquationOfState::New")
<< "Unknown phaseEquationOfStateType type "
<< phaseEquationOfStateType << endl << endl
<< "Valid phaseEquationOfState types are : " << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return cstrIter()(dict.subDict("equationOfState"));
}
// ************************************************************************* //

View File

@ -0,0 +1,54 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 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 "phaseEquationOfState.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(phaseEquationOfState, 0);
defineRunTimeSelectionTable(phaseEquationOfState, dictionary);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::phaseEquationOfState::phaseEquationOfState
(
const dictionary& dict
)
:
dict_(dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::phaseEquationOfState::~phaseEquationOfState()
{}
// ************************************************************************* //

View File

@ -0,0 +1,127 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 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::phaseEquationOfState
Description
A2stract base-class for dispersed-phase particle diameter models.
SourceFiles
phaseEquationOfState.C
newDiameterModel.C
\*---------------------------------------------------------------------------*/
#ifndef phaseEquationOfState_H
#define phaseEquationOfState_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "dictionary.H"
#include "volFieldsFwd.H"
#include "runTimeSelectionTables.H"
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class phaseEquationOfState Declaration
\*---------------------------------------------------------------------------*/
class phaseEquationOfState
{
protected:
// Protected data
const dictionary& dict_;
public:
//- Runtime type information
TypeName("phaseEquationOfState");
// Declare runtime construction
declareRunTimeSelectionTable
(
autoPtr,
phaseEquationOfState,
dictionary,
(
const dictionary& dict
),
(dict)
);
// Constructors
phaseEquationOfState
(
const dictionary& dict
);
//- Destructor
virtual ~phaseEquationOfState();
// Selectors
static autoPtr<phaseEquationOfState> New
(
const dictionary& dict
);
// Member Functions
//- Return the phase density
virtual tmp<volScalarField> rho
(
const volScalarField& p,
const volScalarField& T
) const = 0;
//- Return the phase compressibility
virtual tmp<volScalarField> psi
(
const volScalarField& p,
const volScalarField& T
) const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -20,23 +20,35 @@ phases (water air);
water
{
transportModel Newtonian;
nu nu [ 0 2 -1 0 0 0 0 ] 1e-06;
k k [1 1 -3 -1 0 0 0] 0; //0.613;
rho rho [ 1 -3 0 0 0 0 0 ] 1000;
rho0 rho0 [ 1 -3 0 0 0 0 0 ] 1000;
R R [0 2 -2 -1 0] 3000;
Cv Cv [0 2 -2 -1 0] 4179;
nu 1e-06;
rho 1000;
k 0; // 0.613;
Cv 4179;
equationOfState
{
type perfectFluid;
rho0 1000;
R 3000;
}
}
air
{
transportModel Newtonian;
nu nu [ 0 2 -1 0 0 0 0 ] 1.589e-05;
k k [1 1 -3 -1 0 0 0] 0; //2.63e-2;
rho rho [ 1 -3 0 0 0 0 0 ] 1;
rho0 rho0 [ 1 -3 0 0 0 0 0 ] 0;
R R [0 2 -2 -1 0] 287;
Cv Cv [0 2 -2 -1 0] 721;
nu 1.589e-05;
rho 1;
k 0; // 2.63e-2;
Cv 721;
equationOfState
{
type perfectFluid;
rho0 0;
R 287;
}
}
pMin pMin [ 1 -1 -2 0 0 0 0 ] 10000;

View File

@ -20,23 +20,35 @@ phases (water air);
water
{
transportModel Newtonian;
nu nu [ 0 2 -1 0 0 0 0 ] 1e-06;
k k [1 1 -3 -1 0 0 0] 0; //0.613;
rho rho [ 1 -3 0 0 0 0 0 ] 1000;
rho0 rho0 [ 1 -3 0 0 0 0 0 ] 1000;
R R [0 2 -2 -1 0] 3000;
Cv Cv [0 2 -2 -1 0] 4179;
nu 1e-06;
rho 1000;
k 0; // 0.613;
Cv 4179;
equationOfState
{
type perfectFluid;
rho0 1000;
R 3000;
}
}
air
{
transportModel Newtonian;
nu nu [ 0 2 -1 0 0 0 0 ] 1.589e-05;
k k [1 1 -3 -1 0 0 0] 0; //2.63e-2;
rho rho [ 1 -3 0 0 0 0 0 ] 1;
rho0 rho0 [ 1 -3 0 0 0 0 0 ] 0;
R R [0 2 -2 -1 0] 287;
Cv Cv [0 2 -2 -1 0] 721;
nu 1.589e-05;
rho 1;
k 0; // 2.63e-2;
Cv 721;
equationOfState
{
type perfectFluid;
rho0 0;
R 287;
}
}
pMin pMin [ 1 -1 -2 0 0 0 0 ] 10000;