Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev

This commit is contained in:
mattijs
2012-10-08 16:09:42 +01:00
24 changed files with 335 additions and 48 deletions

View File

@ -7,7 +7,12 @@
+ betav*fvc::ddt(rho, K) + fvc::div(phi, K) + betav*fvc::ddt(rho, K) + fvc::div(phi, K)
+ ( + (
hea.name() == "ea" hea.name() == "ea"
? fvc::div(phi, volScalarField("Ep", p/rho)) ? fvc::div
(
phi/fvc::interpolate(rho),
p,
"div(phiv,p)"
)
: -betav*dpdt : -betav*dpdt
) )
- fvm::laplacian(Db, hea) - fvm::laplacian(Db, hea)

View File

@ -8,7 +8,12 @@ if (ign.ignited())
+ (betav*fvc::ddt(rho, K) + fvc::div(phi, K))*rho/thermo.rhou() + (betav*fvc::ddt(rho, K) + fvc::div(phi, K))*rho/thermo.rhou()
+ ( + (
heau.name() == "eau" heau.name() == "eau"
? fvc::div(phi, volScalarField("Ep", p/rho))*rho/thermo.rhou() ? fvc::div
(
phi/fvc::interpolate(rho),
p,
"div(phiv,p)"
)*rho/thermo.rhou()
: -betav*dpdt*rho/thermo.rhou() : -betav*dpdt*rho/thermo.rhou()
) )
- fvm::laplacian(Db, heau) - fvm::laplacian(Db, heau)

View File

@ -7,7 +7,12 @@
+ fvc::ddt(rho, K) + fvc::div(phi, K) + fvc::ddt(rho, K) + fvc::div(phi, K)
+ ( + (
hea.name() == "ea" hea.name() == "ea"
? fvc::div(phi, volScalarField("Ep", p/rho)) ? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)
: -dpdt : -dpdt
) )
- fvm::laplacian(turbulence->alphaEff(), hea) - fvm::laplacian(turbulence->alphaEff(), hea)

View File

@ -8,7 +8,12 @@ if (ign.ignited())
+ (fvc::ddt(rho, K) + fvc::div(phi, K))*rho/thermo.rhou() + (fvc::ddt(rho, K) + fvc::div(phi, K))*rho/thermo.rhou()
+ ( + (
heau.name() == "eau" heau.name() == "eau"
? fvc::div(phi, volScalarField("Ep", p/rho))*rho/thermo.rhou() ? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)*rho/thermo.rhou()
: -dpdt*rho/thermo.rhou() : -dpdt*rho/thermo.rhou()
) )
- fvm::laplacian(turbulence->alphaEff(), heau) - fvm::laplacian(turbulence->alphaEff(), heau)

View File

@ -66,5 +66,5 @@ K = 0.5*magSqr(U);
if (thermo.dpdt()) if (thermo.dpdt())
{ {
dpdt = fvc::ddt(p); dpdt = fvc::ddt(p) - fvc::div(fvc::meshPhi(rho, U), p);
} }

View File

@ -55,7 +55,12 @@ tmp<fv::convectionScheme<scalar> > mvConvection
+ fvc::ddt(rho, K) + fvc::div(phi, K) + fvc::ddt(rho, K) + fvc::div(phi, K)
+ ( + (
he.name() == "e" he.name() == "e"
? fvc::div(phi, volScalarField("Ep", p/rho)) ? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)
: -dpdt : -dpdt
) )
- fvm::laplacian(turbulence->alphaEff(), he) - fvm::laplacian(turbulence->alphaEff(), he)

View File

@ -7,7 +7,12 @@
+ fvc::ddt(rho, K) + fvc::div(phi, K) + fvc::ddt(rho, K) + fvc::div(phi, K)
+ ( + (
he.name() == "e" he.name() == "e"
? fvc::div(phi, volScalarField("Ep", p/rho)) ? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)
: -dpdt : -dpdt
) )
- fvm::laplacian(turbulence->alphaEff(), he) - fvm::laplacian(turbulence->alphaEff(), he)

View File

@ -7,7 +7,12 @@
+ fvc::ddt(rho, K) + fvc::div(phi, K) + fvc::ddt(rho, K) + fvc::div(phi, K)
+ ( + (
he.name() == "e" he.name() == "e"
? fvc::div(phi, volScalarField("Ep", p/rho)) ? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)
: -dpdt : -dpdt
) )
- fvm::laplacian(turbulence->alphaEff(), he) - fvm::laplacian(turbulence->alphaEff(), he)

View File

@ -2,7 +2,8 @@
solve solve
( (
fvm::ddt(rho, e) + fvm::div(phi, e) fvm::ddt(rho, e) + fvm::div(phi, e)
+ fvc::ddt(rho, K) + fvc::div(phi, volScalarField("Ekp", K + p/rho)) + fvc::ddt(rho, K) + fvc::div(phi, K)
+ fvc::div(fvc::absolute(phi/fvc::interpolate(rho), U), p, "div(phiv,p)")
- fvm::laplacian(turbulence->alphaEff(), e) - fvm::laplacian(turbulence->alphaEff(), e)
); );

View File

@ -1,11 +0,0 @@
{
solve
(
fvm::ddt(rho, e) + fvm::div(phi, e)
+ fvc::ddt(rho, K) + fvc::div(phi, K)
+ fvc::div(phi/fvc::interpolate(rho) + mesh.phi(), p, "div(phiv,p)")
- fvm::laplacian(turbulence->alphaEff(), e)
);
thermo.correct();
}

View File

@ -7,7 +7,12 @@
+ fvc::ddt(rho, K) + fvc::div(phi, K) + fvc::ddt(rho, K) + fvc::div(phi, K)
+ ( + (
he.name() == "e" he.name() == "e"
? fvc::div(phi, volScalarField("Ep", p/rho)) ? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)
: -dpdt : -dpdt
) )
- fvm::laplacian(turb.alphaEff(), he) - fvm::laplacian(turb.alphaEff(), he)

View File

@ -7,7 +7,12 @@
+ fvc::ddt(rho, K) + fvc::div(phi, K) + fvc::ddt(rho, K) + fvc::div(phi, K)
+ ( + (
he.name() == "e" he.name() == "e"
? fvc::div(phi, volScalarField("Ep", p/rho)) ? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)
: -dpdt : -dpdt
) )
- fvm::laplacian(turbulence->alphaEff(), he) - fvm::laplacian(turbulence->alphaEff(), he)

View File

@ -7,7 +7,12 @@
+ fvc::ddt(rho, K) + fvc::div(phi, K) + fvc::ddt(rho, K) + fvc::div(phi, K)
+ ( + (
he.name() == "e" he.name() == "e"
? fvc::div(phi, volScalarField("Ep", p/rho)) ? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)
: -dpdt : -dpdt
) )
- fvm::laplacian(turbulence->alphaEff(), he) - fvm::laplacian(turbulence->alphaEff(), he)

View File

@ -7,7 +7,12 @@
+ fvc::ddt(rho, K) + fvc::div(phi, K) + fvc::ddt(rho, K) + fvc::div(phi, K)
+ ( + (
he.name() == "e" he.name() == "e"
? fvc::div(phi, volScalarField("Ep", p/rho)) ? fvc::div
(
fvc::absolute(phi/fvc::interpolate(rho), U),
p,
"div(phiv,p)"
)
: -dpdt : -dpdt
) )
- fvm::laplacian(turbulence->alphaEff(), he) - fvm::laplacian(turbulence->alphaEff(), he)

View File

@ -79,5 +79,5 @@ K = 0.5*magSqr(U);
if (thermo.dpdt()) if (thermo.dpdt())
{ {
dpdt = fvc::ddt(p); dpdt = fvc::ddt(p) - fvc::div(fvc::meshPhi(rho, U), p);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -148,4 +148,39 @@ void Foam::fvc::makeAbsolute
} }
Foam::tmp<Foam::surfaceScalarField> Foam::fvc::absolute
(
const tmp<surfaceScalarField>& tphi,
const volVectorField& U
)
{
if (tphi().mesh().moving())
{
return tphi + fvc::meshPhi(U);
}
else
{
return tphi;
}
}
Foam::tmp<Foam::surfaceScalarField> Foam::fvc::absolute
(
const tmp<surfaceScalarField>& tphi,
const volScalarField& rho,
const volVectorField& U
)
{
if (tphi().mesh().moving())
{
return tphi + fvc::meshPhi(rho, U);
}
else
{
return tphi;
}
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -116,6 +116,22 @@ namespace fvc
const volScalarField& rho, const volScalarField& rho,
const volVectorField& U const volVectorField& U
); );
//- Return the given relative flux in absolute form
tmp<surfaceScalarField> absolute
(
const tmp<surfaceScalarField>& tphi,
const volVectorField& U
);
//- Return the given relative flux in absolute form
tmp<surfaceScalarField> absolute
(
const tmp<surfaceScalarField>& tphi,
const volScalarField& rho,
const volVectorField& U
);
} }

View File

@ -33,11 +33,13 @@ License
#include "perfectGas.H" #include "perfectGas.H"
#include "hConstThermo.H" #include "hConstThermo.H"
#include "janafThermo.H" #include "janafThermo.H"
#include "absoluteEnthalpy.H"
#include "thermo.H" #include "thermo.H"
#include "constTransport.H" #include "constTransport.H"
#include "sutherlandTransport.H" #include "sutherlandTransport.H"
#include "absoluteEnthalpy.H"
#include "absoluteInternalEnergy.H"
#include "homogeneousMixture.H" #include "homogeneousMixture.H"
#include "inhomogeneousMixture.H" #include "inhomogeneousMixture.H"
#include "veryInhomogeneousMixture.H" #include "veryInhomogeneousMixture.H"
@ -91,6 +93,20 @@ makeReactionThermo
specie specie
); );
makeReactionThermo
(
psiThermo,
psiuReactionThermo,
heheuPsiThermo,
egrMixture,
constTransport,
absoluteEnthalpy,
hConstThermo,
perfectGas,
specie
);
makeReactionThermo makeReactionThermo
( (
psiThermo, psiThermo,
@ -136,9 +152,49 @@ makeReactionThermo
psiuReactionThermo, psiuReactionThermo,
heheuPsiThermo, heheuPsiThermo,
egrMixture, egrMixture,
constTransport, sutherlandTransport,
absoluteEnthalpy, absoluteEnthalpy,
hConstThermo, janafThermo,
perfectGas,
specie
);
makeReactionThermo
(
psiThermo,
psiuReactionThermo,
heheuPsiThermo,
homogeneousMixture,
sutherlandTransport,
absoluteInternalEnergy,
janafThermo,
perfectGas,
specie
);
makeReactionThermo
(
psiThermo,
psiuReactionThermo,
heheuPsiThermo,
inhomogeneousMixture,
sutherlandTransport,
absoluteInternalEnergy,
janafThermo,
perfectGas,
specie
);
makeReactionThermo
(
psiThermo,
psiuReactionThermo,
heheuPsiThermo,
veryInhomogeneousMixture,
sutherlandTransport,
absoluteInternalEnergy,
janafThermo,
perfectGas, perfectGas,
specie specie
); );
@ -150,7 +206,7 @@ makeReactionThermo
heheuPsiThermo, heheuPsiThermo,
egrMixture, egrMixture,
sutherlandTransport, sutherlandTransport,
absoluteEnthalpy, absoluteInternalEnergy,
janafThermo, janafThermo,
perfectGas, perfectGas,
specie specie

View File

@ -0,0 +1,140 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::absoluteInternalEnergy
Description
Thermodynamics mapping class to expose the absolute internal energy function
as the standard internal energy function e(T).
\*---------------------------------------------------------------------------*/
#ifndef absoluteInternalEnergy_H
#define absoluteInternalEnergy_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class absoluteInternalEnergy Declaration
\*---------------------------------------------------------------------------*/
template<class Thermo>
class absoluteInternalEnergy
{
public:
// Constructors
//- Construct
absoluteInternalEnergy()
{}
// Member Functions
//- Return the instantiated type name
static word typeName()
{
return "absoluteInternalEnergy";
}
// Fundamental properties
static word name()
{
return "ea";
}
// Absolute internal energy [J/kmol]
scalar he
(
const Thermo& thermo,
const scalar p,
const scalar T
) const
{
return thermo.ea(p, T);
}
// Heat capacity at constant volume [J/(kmol K)]
scalar cpv
(
const Thermo& thermo,
const scalar p,
const scalar T
) const
{
return thermo.cv(p, T);
}
//- cp/cv []
scalar cpBycpv
(
const Thermo& thermo,
const scalar p,
const scalar T
) const
{
return thermo.gamma(p, T);
}
// Absolute internal energy [J/kg]
scalar HE
(
const Thermo& thermo,
const scalar p,
const scalar T
) const
{
return thermo.Ea(p, T);
}
//- Temperature from absolute internal energy
// given an initial temperature T0
scalar THE
(
const Thermo& thermo,
const scalar e,
const scalar p,
const scalar T0
) const
{
return thermo.TEa(e, p, T0);
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -102,7 +102,7 @@ public:
return thermo.gamma(p, T); return thermo.gamma(p, T);
} }
//- Sensible enthalpy [J/kg] //- Sensible internal energy [J/kg]
scalar HE scalar HE
( (
const Thermo& thermo, const Thermo& thermo,

View File

@ -413,14 +413,14 @@ inline Foam::scalar Foam::species::thermo<Thermo, Type>::THs
template<class Thermo, template<class> class Type> template<class Thermo, template<class> class Type>
inline Foam::scalar Foam::species::thermo<Thermo, Type>::THa inline Foam::scalar Foam::species::thermo<Thermo, Type>::THa
( (
const scalar ht, const scalar ha,
const scalar p, const scalar p,
const scalar T0 const scalar T0
) const ) const
{ {
return T return T
( (
ht, ha,
p, p,
T0, T0,
&thermo<Thermo, Type>::Ha, &thermo<Thermo, Type>::Ha,
@ -453,7 +453,7 @@ inline Foam::scalar Foam::species::thermo<Thermo, Type>::TEs
template<class Thermo, template<class> class Type> template<class Thermo, template<class> class Type>
inline Foam::scalar Foam::species::thermo<Thermo, Type>::TEa inline Foam::scalar Foam::species::thermo<Thermo, Type>::TEa
( (
const scalar e, const scalar ea,
const scalar p, const scalar p,
const scalar T0 const scalar T0
) const ) const

View File

@ -24,6 +24,7 @@ thermoType
equationOfState perfectGas; equationOfState perfectGas;
specie specie; specie specie;
energy absoluteEnthalpy; energy absoluteEnthalpy;
//energy absoluteInternalEnergy;
} }
stoichiometricAirFuelMassRatio stoichiometricAirFuelMassRatio [ 0 0 0 0 0 0 0 ] 15.0336; stoichiometricAirFuelMassRatio stoichiometricAirFuelMassRatio [ 0 0 0 0 0 0 0 ] 15.0336;

View File

@ -31,6 +31,8 @@ divSchemes
div(phi,U) Gauss upwind; div(phi,U) Gauss upwind;
div(phi,K) Gauss upwind; div(phi,K) Gauss upwind;
div(phid,p) Gauss upwind; div(phid,p) Gauss upwind;
div(meshPhi,p) Gauss upwind;
div(phiv,p) Gauss upwind;
div(phi,k) Gauss upwind; div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind; div(phi,epsilon) Gauss upwind;
div(phi,R) Gauss upwind; div(phi,R) Gauss upwind;
@ -45,6 +47,8 @@ divSchemes
b limitedLinear01 1; b limitedLinear01 1;
ha limitedLinear 1; ha limitedLinear 1;
hau limitedLinear 1; hau limitedLinear 1;
ea limitedLinear 1;
eau limitedLinear 1;
}; };
div(U) Gauss linear; div(U) Gauss linear;
div((Su*grad(b))) Gauss linear; div((Su*grad(b))) Gauss linear;
@ -54,17 +58,7 @@ divSchemes
laplacianSchemes laplacianSchemes
{ {
default none; default Gauss linear limited 0.5;
laplacian(muEff,U) Gauss linear corrected;
laplacian(DkEff,k) Gauss linear limited 0.5;
laplacian(DepsilonEff,epsilon) Gauss linear limited 0.5;
laplacian(DREff,R) Gauss linear limited 0.5;
laplacian((rho*(1|A(U))),p) Gauss linear limited 0.5;
laplacian(alphaEff,b) Gauss linear limited 0.5;
laplacian(muEff,ft) Gauss linear limited 0.5;
laplacian(alphaEff,ha) Gauss linear limited 0.5;
laplacian(alphaEff,hau) Gauss linear limited 0.5;
laplacian(alphaEff,ft) Gauss linear limited 0.5;
} }
interpolationSchemes interpolationSchemes

View File

@ -47,14 +47,14 @@ solvers
relTol 0; relTol 0;
} }
"(U|Xi|hau|ft|b|ha|k|epsilon)" "(U|Xi|hau|eau|ft|b|ha|ea|k|epsilon)"
{ {
solver PBiCG; solver PBiCG;
preconditioner DILU; preconditioner DILU;
tolerance 1e-05; tolerance 1e-05;
relTol 0.1; relTol 0.1;
} }
"(U|ft|Xi|hau|b|ha|k|epsilon)Final" "(U|ft|Xi|hau|eau|b|ha|ea|k|epsilon)Final"
{ {
$U; $U;
tolerance 1e-05; tolerance 1e-05;