BUGFIX: Fixed errors in MRF, switched to rothalpy equation. Author: Hrvoje Jasak. Merge: Dominik Christ.

This commit is contained in:
Dominik Christ 2014-09-30 16:13:17 +01:00
commit 80b603ad1a
73 changed files with 978 additions and 7712 deletions

View file

@ -2,17 +2,21 @@
// Solve the enthalpy equation // Solve the enthalpy equation
T.storePrevIter(); T.storePrevIter();
surfaceScalarField faceU = phi/fvc::interpolate(rho); // Calculate face velocity from flux
surfaceScalarField faceU
(
"faceU",
phi/fvc::interpolate(rho)
);
fvScalarMatrix hEqn fvScalarMatrix hEqn
( (
fvm::ddt(rho, h) fvm::ddt(rho, h)
+ fvm::div(phi, h) + fvm::div(phi, h)
- fvm::laplacian(turbulence->alphaEff(), h) - fvm::laplacian(turbulence->alphaEff(), h)
+ fvm::SuSp((fvc::div(faceU, p, "div(U,p)") - p*fvc::div(faceU))/h, h)
== ==
// ddt(p) term removed: steady-state. HJ, 27/Apr/2010 // ddt(p) term removed: steady-state. HJ, 27/Apr/2010
fvc::div(faceU, p, "div(U,p)")
- p*fvc::div(faceU)
// Viscous heating: note sign (devRhoReff has a minus in it) // Viscous heating: note sign (devRhoReff has a minus in it)
- (turbulence->devRhoReff() && fvc::grad(U)) - (turbulence->devRhoReff() && fvc::grad(U))
); );

View file

@ -53,7 +53,7 @@ int main(int argc, char *argv[])
Info<< "\nStarting time loop\n" << endl; Info<< "\nStarting time loop\n" << endl;
for (runTime++; !runTime.end(); runTime++) while (runTime.loop())
{ {
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;

View file

@ -9,11 +9,25 @@
// Create rotational velocity (= omega x r) // Create rotational velocity (= omega x r)
Urot = U - Urel; Urot = U - Urel;
// Calculate face velocity from absolute flux
surfaceScalarField rhof = fvc::interpolate(rho);
surfaceScalarField phiAbs
(
"phiAbs",
phi
);
mrfZones.absoluteFlux(rhof, phiAbs);
surfaceScalarField faceU("faceU", phiAbs/rhof);
fvScalarMatrix iEqn fvScalarMatrix iEqn
( (
fvm::ddt(rho, i) fvm::ddt(rho, i)
+ fvm::div(phi, i) + fvm::div(phi, i)
- fvm::laplacian(turbulence->alphaEff(), i) - fvm::laplacian(turbulence->alphaEff(), i)
// u & gradP term (steady-state formulation)
+ fvm::SuSp((fvc::div(faceU, p, "div(U,p)") - fvc::div(faceU)*p)/i, i)
== ==
// Viscous heating: note sign (devRhoReff has a minus in it) // Viscous heating: note sign (devRhoReff has a minus in it)
- (turbulence->devRhoReff() && fvc::grad(Urel)) - (turbulence->devRhoReff() && fvc::grad(Urel))

View file

@ -55,7 +55,7 @@ int main(int argc, char *argv[])
Info<< "\nStarting time loop\n" << endl; Info<< "\nStarting time loop\n" << endl;
for (runTime++; !runTime.end(); runTime++) while (runTime.loop())
{ {
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;

View file

@ -85,3 +85,18 @@
), ),
Urel + SRF->U() Urel + SRF->U()
); );
// Create rothalpy, in two steps to preserve boundary conditions
volScalarField i
(
IOobject
(
"i",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
h
);
i -= 0.5*magSqr(SRF->U());

View file

@ -1,33 +0,0 @@
{
// Solve the enthalpy equation
T.storePrevIter();
surfaceScalarField faceU = phi/fvc::interpolate(rho);
fvScalarMatrix hEqn
(
fvm::ddt(rho, h)
+ fvm::div(phi, h)
- fvm::laplacian(turbulence->alphaEff(), h)
==
// ddt(p) term removed: steady-state. HJ, 27/Apr/2010
fvc::div(faceU, p, "div(U,p)")
- p*fvc::div(faceU)
// Viscous heating: note sign (devRhoReff has a minus in it)
- (turbulence->devRhoReff() && fvc::grad(Urel))
);
hEqn.relax();
eqnResidual = hEqn.solve().initialResidual();
maxResidual = max(eqnResidual, maxResidual);
// Bound the enthalpy using TMin and TMax
volScalarField Cp = thermo.Cp();
h = Foam::min(h, TMax*Cp);
h = Foam::max(h, TMin*Cp);
h.correctBoundaryConditions();
thermo.correct();
}

View file

@ -0,0 +1,47 @@
{
// Solve the enthalpy equation
T.storePrevIter();
// Calculate face velocity from flux
surfaceScalarField faceU
(
"faceU",
phi/fvc::interpolate(rho) + (SRF->faceU() & mesh.Sf())
);
fvScalarMatrix iEqn
(
fvm::ddt(rho, i)
+ fvm::div(phi, i)
- fvm::laplacian(turbulence->alphaEff(), i)
// u & gradP term (steady-state formulation)
+ fvm::SuSp((fvc::div(faceU, p, "div(U,p)") - p*fvc::div(faceU))/i, i)
==
// ddt(p) term removed: steady-state. HJ, 27/Apr/2010
// Viscous heating: note sign (devRhoReff has a minus in it)
- (turbulence->devRhoReff() && fvc::grad(Urel))
);
iEqn.relax();
eqnResidual = iEqn.solve().initialResidual();
maxResidual = max(eqnResidual, maxResidual);
// Calculate enthalpy out of rothalpy
volVectorField Urot("Urot", SRF->U());
h = i + 0.5*magSqr(Urot);
h.correctBoundaryConditions();
// Bound the enthalpy using TMin and TMax
volScalarField Cp = thermo.Cp();
h = Foam::min(h, TMax*Cp);
h = Foam::max(h, TMin*Cp);
h.correctBoundaryConditions();
// Re-initialise rothalpy based on limited enthalpy
i = h - 0.5*magSqr(Urot);
thermo.correct();
}

View file

@ -55,7 +55,7 @@ int main(int argc, char *argv[])
Info<< "\nStarting time loop\n" << endl; Info<< "\nStarting time loop\n" << endl;
for (runTime++; !runTime.end(); runTime++) while (runTime.loop())
{ {
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
@ -65,10 +65,9 @@ int main(int argc, char *argv[])
# include "initConvergenceCheck.H" # include "initConvergenceCheck.H"
# include "UEqn.H" # include "UEqn.H"
# include "iEqn.H"
# include "pEqn.H" # include "pEqn.H"
# include "hEqn.H"
# include "rhoFromP.H" # include "rhoFromP.H"
// Correct turbulence // Correct turbulence

View file

@ -208,6 +208,26 @@ Foam::tmp<Foam::volVectorField> Foam::SRF::SRFModel::U() const
} }
Foam::tmp<Foam::surfaceVectorField> Foam::SRF::SRFModel::faceU() const
{
return tmp<surfaceVectorField>
(
new surfaceVectorField
(
IOobject
(
"faceUsrf",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
omega_ ^ (mesh_.Cf() - axis_*(axis_ & mesh_.Cf()))
)
);
}
Foam::tmp<Foam::volVectorField> Foam::SRF::SRFModel::Uabs() const Foam::tmp<Foam::volVectorField> Foam::SRF::SRFModel::Uabs() const
{ {
const volVectorField Usrf = U(); const volVectorField Usrf = U();

View file

@ -171,6 +171,9 @@ public:
//- Return velocity of SRF for complete mesh //- Return velocity of SRF for complete mesh
tmp<volVectorField> U() const; tmp<volVectorField> U() const;
//- Return face velocity of SRF for complete mesh
tmp<surfaceVectorField> faceU() const;
//- Return absolute velocity for complete mesh //- Return absolute velocity for complete mesh
tmp<volVectorField> Uabs() const; tmp<volVectorField> Uabs() const;
}; };

View file

@ -25,6 +25,7 @@ derivedFvPatchFields/mixedInternalEnergy/mixedInternalEnergyFvPatchScalarField.C
derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C
derivedFvPatchFields/temperatureDirectedInletOutletVelocity/temperatureDirectedInletOutletVelocityFvPatchVectorField.C derivedFvPatchFields/temperatureDirectedInletOutletVelocity/temperatureDirectedInletOutletVelocityFvPatchVectorField.C
derivedFvPatchFields/isentropicTotalPressure/isentropicTotalPressureFvPatchScalarField.C
derivedFvPatchFields/isentropicTotalTemperature/isentropicTotalTemperatureFvPatchScalarField.C derivedFvPatchFields/isentropicTotalTemperature/isentropicTotalTemperatureFvPatchScalarField.C
LIB = $(FOAM_LIBBIN)/libbasicThermophysicalModels LIB = $(FOAM_LIBBIN)/libbasicThermophysicalModels

View file

@ -0,0 +1,212 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration |
\\ / A nd | For copyright notice see file Copyright
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of foam-extend.
foam-extend 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.
foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "isentropicTotalPressureFvPatchScalarField.H"
#include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H"
#include "basicThermo.H"
#include "isentropicTotalTemperatureFvPatchScalarField.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::isentropicTotalPressureFvPatchScalarField::
isentropicTotalPressureFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
fixedValueFvPatchScalarField(p, iF),
UName_("U"),
TName_("T"),
p0_(p.size(), 0.0)
{}
Foam::isentropicTotalPressureFvPatchScalarField::
isentropicTotalPressureFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict
)
:
fixedValueFvPatchScalarField(p, iF),
UName_(dict.lookupOrDefault<word>("U", "U")),
TName_(dict.lookupOrDefault<word>("T", "T")),
p0_("p0", dict, p.size())
{
if (dict.found("value"))
{
fvPatchField<scalar>::operator=
(
scalarField("value", dict, p.size())
);
}
else
{
fvPatchField<scalar>::operator=(p0_);
}
}
Foam::isentropicTotalPressureFvPatchScalarField::
isentropicTotalPressureFvPatchScalarField
(
const isentropicTotalPressureFvPatchScalarField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fixedValueFvPatchScalarField(ptf, p, iF, mapper),
UName_(ptf.UName_),
TName_(ptf.TName_),
p0_(ptf.p0_, mapper)
{}
Foam::isentropicTotalPressureFvPatchScalarField::
isentropicTotalPressureFvPatchScalarField
(
const isentropicTotalPressureFvPatchScalarField& ptf
)
:
fixedValueFvPatchScalarField(ptf),
UName_(ptf.UName_),
TName_(ptf.TName_),
p0_(ptf.p0_)
{}
Foam::isentropicTotalPressureFvPatchScalarField::
isentropicTotalPressureFvPatchScalarField
(
const isentropicTotalPressureFvPatchScalarField& ptf,
const DimensionedField<scalar, volMesh>& iF
)
:
fixedValueFvPatchScalarField(ptf, iF),
UName_(ptf.UName_),
TName_(ptf.TName_),
p0_(ptf.p0_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::isentropicTotalPressureFvPatchScalarField::autoMap
(
const fvPatchFieldMapper& m
)
{
fixedValueFvPatchScalarField::autoMap(m);
p0_.autoMap(m);
}
void Foam::isentropicTotalPressureFvPatchScalarField::rmap
(
const fvPatchScalarField& ptf,
const labelList& addr
)
{
fixedValueFvPatchScalarField::rmap(ptf, addr);
const isentropicTotalPressureFvPatchScalarField& tiptf =
refCast<const isentropicTotalPressureFvPatchScalarField>(ptf);
p0_.rmap(tiptf.p0_, addr);
}
void Foam::isentropicTotalPressureFvPatchScalarField::updateCoeffs()
{
if (updated())
{
return;
}
// Get velocity
const fvPatchVectorField& U =
patch().lookupPatchField<volVectorField, scalar>(UName_);
// Get temperature
const fvPatchScalarField& T =
patch().lookupPatchField<volScalarField, scalar>(TName_);
const basicThermo& thermo =
db().lookupObject<basicThermo>("thermophysicalProperties");
scalarField Cp = thermo.Cp(T, patch().index());
scalarField Cv = thermo.Cv(T, patch().index());
scalarField gamma = Cp/Cv;
scalarField R = Cp - Cv;
scalarField Ma = -(patch().nf() & U)/sqrt(gamma*R*T);
scalarField a = 1 + 0.5*(gamma - 1)*sqr(Ma);
operator==(p0_*pow(a, -gamma/(gamma - 1)));
fixedValueFvPatchScalarField::updateCoeffs();
}
void Foam::isentropicTotalPressureFvPatchScalarField::updateCoeffs
(
const vectorField& Up
)
{
updateCoeffs();
}
void Foam::isentropicTotalPressureFvPatchScalarField::write
(
Ostream& os
) const
{
fixedValueFvPatchScalarField::write(os);
writeEntryIfDifferent<word>(os, "T", "T", TName_);
p0_.writeEntry("p0", os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makePatchTypeField
(
fvPatchScalarField,
isentropicTotalPressureFvPatchScalarField
);
} // End namespace Foam
// ************************************************************************* //

View file

@ -0,0 +1,189 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration |
\\ / A nd | For copyright notice see file Copyright
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of foam-extend.
foam-extend 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.
foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::isentropicTotalPressureFvPatchScalarField
Description
Foam::isentropicTotalPressureFvPatchScalarField
SourceFiles
isentropicTotalPressureFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
#ifndef isentropicTotalPressureFvPatchScalarField_H
#define isentropicTotalPressureFvPatchScalarField_H
#include "fixedValueFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class isentropicTotalPressureFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class isentropicTotalPressureFvPatchScalarField
:
public fixedValueFvPatchScalarField
{
// Private data
//- Name of the velocity field
word UName_;
//- Name of the static temperature field
word TName_;
//- Total pressure field
scalarField p0_;
public:
//- Runtime type information
TypeName("isentropicTotalPressure");
// Constructors
//- Construct from patch and internal field
isentropicTotalPressureFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&
);
//- Construct from patch, internal field and dictionary
isentropicTotalPressureFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const dictionary&
);
//- Construct by mapping given
// isentropicTotalPressureFvPatchScalarField onto a new patch
isentropicTotalPressureFvPatchScalarField
(
const isentropicTotalPressureFvPatchScalarField&,
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
isentropicTotalPressureFvPatchScalarField
(
const isentropicTotalPressureFvPatchScalarField&
);
//- Construct and return a clone
virtual tmp<fvPatchScalarField> clone() const
{
return tmp<fvPatchScalarField>
(
new isentropicTotalPressureFvPatchScalarField(*this)
);
}
//- Construct as copy setting internal field reference
isentropicTotalPressureFvPatchScalarField
(
const isentropicTotalPressureFvPatchScalarField&,
const DimensionedField<scalar, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchScalarField> clone
(
const DimensionedField<scalar, volMesh>& iF
) const
{
return tmp<fvPatchScalarField>
(
new isentropicTotalPressureFvPatchScalarField(*this, iF)
);
}
// Member functions
// Access
//- Return the total pressure
const scalarField& p0() const
{
return p0_;
}
//- Return reference to the total pressure to allow adjustment
scalarField& p0()
{
return p0_;
}
// Mapping functions
//- Map (and resize as needed) from self given a mapping object
virtual void autoMap
(
const fvPatchFieldMapper&
);
//- Reverse map the given fvPatchField onto this fvPatchField
virtual void rmap
(
const fvPatchScalarField&,
const labelList&
);
// Evaluation functions
//- Update the coefficients associated with the patch field
// using the given patch velocity field
virtual void updateCoeffs(const vectorField& Up);
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -26,10 +26,8 @@ License
#include "isentropicTotalTemperatureFvPatchScalarField.H" #include "isentropicTotalTemperatureFvPatchScalarField.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H" #include "fvPatchFieldMapper.H"
#include "volFields.H"
#include "surfaceFields.H"
#include "basicThermo.H" #include "basicThermo.H"
#include "isentropicTotalPressureFvPatchScalarField.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -41,25 +39,8 @@ isentropicTotalTemperatureFvPatchScalarField
) )
: :
fixedValueFvPatchScalarField(p, iF), fixedValueFvPatchScalarField(p, iF),
pName_("Undefined"), pName_("p"),
T0_(p.size(), 0.0), T0_(p.size(), 0.0)
p0_(p.size(), 0.0)
{}
Foam::isentropicTotalTemperatureFvPatchScalarField::
isentropicTotalTemperatureFvPatchScalarField
(
const isentropicTotalTemperatureFvPatchScalarField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fixedValueFvPatchScalarField(ptf, p, iF, mapper),
pName_(ptf.pName_),
T0_(ptf.T0_, mapper),
p0_(ptf.p0_, mapper)
{} {}
@ -72,9 +53,8 @@ isentropicTotalTemperatureFvPatchScalarField
) )
: :
fixedValueFvPatchScalarField(p, iF), fixedValueFvPatchScalarField(p, iF),
pName_(dict.lookup("p")), pName_(dict.lookupOrDefault<word>("p", "p")),
T0_("T0", dict, p.size()), T0_("T0", dict, p.size())
p0_("p0", dict, p.size())
{ {
if (dict.found("value")) if (dict.found("value"))
{ {
@ -93,27 +73,40 @@ isentropicTotalTemperatureFvPatchScalarField
Foam::isentropicTotalTemperatureFvPatchScalarField:: Foam::isentropicTotalTemperatureFvPatchScalarField::
isentropicTotalTemperatureFvPatchScalarField isentropicTotalTemperatureFvPatchScalarField
( (
const isentropicTotalTemperatureFvPatchScalarField& tppsf const isentropicTotalTemperatureFvPatchScalarField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
) )
: :
fixedValueFvPatchScalarField(tppsf), fixedValueFvPatchScalarField(ptf, p, iF, mapper),
pName_(tppsf.pName_), pName_(ptf.pName_),
T0_(tppsf.T0_), T0_(ptf.T0_, mapper)
p0_(tppsf.p0_)
{} {}
Foam::isentropicTotalTemperatureFvPatchScalarField:: Foam::isentropicTotalTemperatureFvPatchScalarField::
isentropicTotalTemperatureFvPatchScalarField isentropicTotalTemperatureFvPatchScalarField
( (
const isentropicTotalTemperatureFvPatchScalarField& tppsf, const isentropicTotalTemperatureFvPatchScalarField& ptf
)
:
fixedValueFvPatchScalarField(ptf),
pName_(ptf.pName_),
T0_(ptf.T0_)
{}
Foam::isentropicTotalTemperatureFvPatchScalarField::
isentropicTotalTemperatureFvPatchScalarField
(
const isentropicTotalTemperatureFvPatchScalarField& ptf,
const DimensionedField<scalar, volMesh>& iF const DimensionedField<scalar, volMesh>& iF
) )
: :
fixedValueFvPatchScalarField(tppsf, iF), fixedValueFvPatchScalarField(ptf, iF),
pName_(tppsf.pName_), pName_(ptf.pName_),
T0_(tppsf.T0_), T0_(ptf.T0_)
p0_(tppsf.p0_)
{} {}
@ -126,7 +119,6 @@ void Foam::isentropicTotalTemperatureFvPatchScalarField::autoMap
{ {
fixedValueFvPatchScalarField::autoMap(m); fixedValueFvPatchScalarField::autoMap(m);
T0_.autoMap(m); T0_.autoMap(m);
p0_.autoMap(m);
} }
@ -142,7 +134,6 @@ void Foam::isentropicTotalTemperatureFvPatchScalarField::rmap
refCast<const isentropicTotalTemperatureFvPatchScalarField>(ptf); refCast<const isentropicTotalTemperatureFvPatchScalarField>(ptf);
T0_.rmap(tiptf.T0_, addr); T0_.rmap(tiptf.T0_, addr);
p0_.rmap(tiptf.p0_, addr);
} }
@ -152,24 +143,28 @@ void Foam::isentropicTotalTemperatureFvPatchScalarField::updateCoeffs()
{ {
return; return;
} }
const fvPatchField<scalar>& p =
// Get pressure and temperature
const scalarField& T = *this;
const fvPatchScalarField& pp =
patch().lookupPatchField<volScalarField, scalar>(pName_); patch().lookupPatchField<volScalarField, scalar>(pName_);
const isentropicTotalPressureFvPatchScalarField& p =
refCast<const isentropicTotalPressureFvPatchScalarField>(pp);
const basicThermo& thermo = const basicThermo& thermo =
db().lookupObject<basicThermo>("thermophysicalProperties"); db().lookupObject<basicThermo>("thermophysicalProperties");
volScalarField gamma = thermo.Cp()/thermo.Cv(); scalarField gamma =
thermo.Cp(T, patch().index())/thermo.Cv(T, patch().index());
const fvPatchField<scalar>& gammap = operator==(T0_*pow(p/p.p0(), (gamma - 1)/gamma));
patch().patchField<volScalarField, scalar>(gamma);
scalarField gM1ByG = (gammap - 1.0)/gammap;
operator==(T0_*pow(p/p0_,gM1ByG));
fixedValueFvPatchScalarField::updateCoeffs(); fixedValueFvPatchScalarField::updateCoeffs();
} }
void Foam::isentropicTotalTemperatureFvPatchScalarField::updateCoeffs void Foam::isentropicTotalTemperatureFvPatchScalarField::updateCoeffs
( (
const vectorField& Up const vectorField& Up
@ -185,9 +180,8 @@ void Foam::isentropicTotalTemperatureFvPatchScalarField::write
) const ) const
{ {
fixedValueFvPatchScalarField::write(os); fixedValueFvPatchScalarField::write(os);
os.writeKeyword("p") << pName_ << token::END_STATEMENT << nl; writeEntryIfDifferent<word>(os, "p", "p", pName_);
T0_.writeEntry("T0", os); T0_.writeEntry("T0", os);
p0_.writeEntry("p0", os);
} }

View file

@ -43,7 +43,7 @@ namespace Foam
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class isentropicTotalTemperatureFvPatch Declaration Class isentropicTotalTemperatureFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class isentropicTotalTemperatureFvPatchScalarField class isentropicTotalTemperatureFvPatchScalarField
@ -58,8 +58,6 @@ class isentropicTotalTemperatureFvPatchScalarField
//- Total temperature field //- Total temperature field
scalarField T0_; scalarField T0_;
//- Total pressure field
scalarField p0_;
public: public:

View file

@ -1,79 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 3.1 |
| \\ / A nd | Web: http://www.extend-project.de |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 1 0 0 0];
internalField uniform 300;
boundaryField
{
INLE1
{
type fixedValue;
value $internalField;
// type waveTransmissiveInlet;
// phi phi;
// rho rho;
// psi psi;
// U U;
// gamma 1.4;
// inletOutlet false;
// correctSupercritical false;
// lInf 0.01;//HJ
// fieldInf 300;
// value $internalField;
}
PRES2
{
type zeroGradient;
// type waveTransmissive;
// phi phi;
// rho rho;
// psi psi;
// U U;
// gamma 1.4;
// inletOutlet true;
// correctSupercritical false;
// lInf 0.0;
// fieldInf 300;
// value $internalField;
}
WALL3
{
type zeroGradient;
}
SYMP5
{
type empty;
}
SYMP6
{
type empty;
}
WALL4
{
type zeroGradient;
}
}
// ************************************************************************* //

View file

@ -1,83 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 3.1 |
| \\ / A nd | Web: http://www.extend-project.de |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default none;
// ddt(rho,U) steadyInertial phi rho 1;
ddt(rho,U) steadyState;
// ddt(rho,h) steadyState;
ddt(rho,h) steadyInertial phi rho 1;
ddt(psi,p) steadyInertial phi rho 1;
U steadyState;
T steadyState;
p steadyState;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
default none;
div(phi,U) Gauss upwind;
// div(phi,U) Gauss linearUpwind faceLimited Gauss linear 1.0;
// div(phi,U) Gauss blended 0.9;
// div(phi,U) Gauss vanLeerDC;
// div(phi,U) Gauss SuperBeeDC;
// div(phi,U) Gauss GammaVDC 0.5;
// div(phi,h) Gauss upwind;
// div(phi,h) Gauss GammaDC 0.5;
div(phi,h) Gauss vanLeerDC;
// div(phid,p) Gauss upwind;
div(phid,p) Gauss vanLeerDC;
div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div((muEff*dev2(grad(U).T()))) Gauss linear;
div(U,p) Gauss linear;
}
laplacianSchemes
{
default Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
fluxRequired
{
default no;
p;
}
// ************************************************************************* //

View file

@ -1,74 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 3.1 |
| \\ / A nd | Web: http://www.extend-project.de |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 1 0 0 0];
internalField uniform 300;
boundaryField
{
INLE1
{
type fixedValue;
value $internalField;
// type waveTransmissiveInlet;
// phi phi;
// rho rho;
// psi psi;
// U U;
// gamma 1.4;
// inletOutlet false;
// correctSupercritical false;
// lInf 0.01;//HJ
// fieldInf 300;
// value $internalField;
}
PRES2
{
// type zeroGradient;
type waveTransmissive;
phi phi;
rho rho;
psi psi;
U U;
gamma 1.4;
inletOutlet true;
correctSupercritical false;
lInf 0.5;
fieldInf 300;
value $internalField;
}
WALL3
{
type zeroGradient;
}
WALL4
{
type zeroGradient;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View file

@ -1,74 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 3.1 |
| \\ / A nd | Web: http://www.extend-project.de |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 101325;
boundaryField
{
INLE1
{
type zeroGradient;
// type waveTransmissiveInlet;
// phi phi;
// rho rho;
// psi psi;
// U U;
// gamma 1.4;
// inletOutlet false;
// correctSupercritical false;
// lInf 0.0;
// fieldInf 101325;
// value uniform 101325;
}
PRES2
{
// type fixedValue;
// value uniform 101325;
type waveTransmissive;
phi phi;
rho rho;
psi psi;
U U;
gamma 1.4;
inletOutlet false;
correctSupercritical true;
lInf 0.5;
fieldInf 101325;
value uniform 101325;
}
WALL3
{
type zeroGradient;
}
WALL4
{
type zeroGradient;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //

View file

@ -1,7 +0,0 @@
#!/bin/sh
# Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
cleanCase
\rm -rf VTK

View file

@ -1,8 +0,0 @@
#!/bin/sh
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
application="steadyCompressibleFoam"
runApplication blockMesh
runApplication $application

View file

@ -1,86 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 3.1 |
| \\ / A nd | Web: http://www.extend-project.de |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
vertices
(
(-1.5 0 -0.1)
(-0.5 0 -0.1)
( 0.5 0 -0.1)
( 1.5 0 -0.1)
(-1.5 1 -0.1)
(-0.5 1 -0.1)
( 0.5 1 -0.1)
( 1.5 1 -0.1)
(-1.5 0 0.1)
(-0.5 0 0.1)
( 0.5 0 0.1)
( 1.5 0 0.1)
(-1.5 1 0.1)
(-0.5 1 0.1)
( 0.5 1 0.1)
( 1.5 1 0.1)
);
blocks
(
hex (0 1 5 4 8 9 13 12) (110 160 1) simpleGrading (1 1 1)
hex (1 2 6 5 9 10 14 13) (110 160 1) simpleGrading (1 1 1)
hex (2 3 7 6 10 11 15 14) (110 160 1) simpleGrading (1 1 1)
);
edges
(
arc 1 2 (0 0.1 -0.1)
arc 9 10 (0 0.1 0.1)
);
patches
(
patch INLE1
(
(0 8 12 4)
)
patch PRES2
(
(3 7 15 11)
)
wall WALL3
(
(4 12 13 5)
(5 13 14 6)
(6 14 15 7)
)
wall WALL4
(
(0 1 9 8)
(1 2 10 9)
(2 3 11 10)
)
);
mergePatchPairs
(
);
// ************************************************************************* //

View file

@ -1,106 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 3.1 |
| \\ / A nd | Web: http://www.extend-project.de |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 10000;
deltaT 1;
writeControl timeStep;
writeInterval 50;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
graphFormat raw;
runTimeModifiable yes;
functions
(
flux
{
type divFlux;
phiName phi;
functionObjectLibs ("libutilityFunctionObjects.so");
}
Mach
{
type MachNumber;
UName U;
functionObjectLibs ("libutilityFunctionObjects.so");
}
minMaxU
{
type minMaxField;
// Where to load it from (if not already in solver)
functionObjectLibs ("libfieldFunctionObjects.so");
name U;
}
minMaxP
{
type minMaxField;
// Where to load it from (if not already in solver)
functionObjectLibs ("libfieldFunctionObjects.so");
name p;
}
minMaxRho
{
type minMaxField;
// Where to load it from (if not already in solver)
functionObjectLibs ("libfieldFunctionObjects.so");
name rho;
}
minMaxT
{
type minMaxField;
// Where to load it from (if not already in solver)
functionObjectLibs ("libfieldFunctionObjects.so");
name T;
}
);
// ************************************************************************* //

View file

@ -1,76 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 3.1 |
| \\ / A nd | Web: http://www.extend-project.de |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
p
{
solver BiCGStab;
preconditioner DILU;
minIter 0;
maxIter 1000;
tolerance 1e-8;
relTol 0.0;
};
U
{
solver BiCGStab;
preconditioner DILU;
minIter 0;
maxIter 1000;
tolerance 1e-8;
relTol 0.0;
};
h
{
solver BiCGStab;
preconditioner DILU;
minIter 0;
maxIter 1000;
tolerance 1e-8;
relTol 0.0;
};
}
PIMPLE
{
nOuterCorrectors 1;
nCorrectors 3;
nNonOrthogonalCorrectors 0;
}
relaxationFactors
{
// Note: under-relaxation factors used in wave-transmissive schemes
U 0.4;
p 0.2;
h 0.5;
rho 0.5;
T 1;
}
fieldBounds
{
// With bounding
p 50 1e6;
T 20 3000;
U 1000;
}
// ************************************************************************* //

View file

@ -9,44 +9,48 @@ FoamFile
{ {
version 2.0; version 2.0;
format ascii; format ascii;
class polyBoundaryMesh; class volScalarField;
location "constant/polyMesh"; object T;
object boundary;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
5 dimensions [0 0 0 1 0 0 0];
(
internalField uniform 300;
boundaryField
{
INLE1 INLE1
{ {
type patch; type isentropicTotalTemperature;
nFaces 160; phi phi;
startFace 152960; rho none;
psi psi;
p p;
T0 uniform 327.335857;
value uniform 300;
} }
PRES2 PRES2
{ {
type patch; type zeroGradient;
nFaces 160;
startFace 153120;
} }
WALL3 WALL3
{ {
type wall; type zeroGradient;
nFaces 480;
startFace 153280;
} }
WALL4 WALL4
{ {
type wall; type zeroGradient;
nFaces 480;
startFace 153760;
} }
defaultFaces defaultFaces
{ {
type empty; type empty;
nFaces 153600;
startFace 154240;
} }
) }
// ************************************************************************* // // ************************************************************************* //

View file

@ -16,32 +16,20 @@ FoamFile
dimensions [0 1 -1 0 0 0 0]; dimensions [0 1 -1 0 0 0 0];
internalField uniform (234 0 0); internalField uniform (234.636777 0 0);
boundaryField boundaryField
{ {
INLE1 INLE1
{ {
type fixedValue; type fixedValue;
value uniform (234 0 0); value uniform (234.636777 0 0);
} }
PRES2 PRES2
{ {
type inletOutlet; type inletOutlet;
inletValue uniform (0 0 0); inletValue uniform (0 0 0);
// type waveTransmissive;
// phi phi;
// rho rho;
// psi psi;
// U U;
// gamma 1.4;
// inletOutlet true;
// correctSupercritical false;
// lInf 0;
// fieldInf (0 0 0);
// value $internalField;
} }
WALL3 WALL3
@ -50,21 +38,17 @@ boundaryField
value uniform (0 0 0); value uniform (0 0 0);
} }
SYMP5
{
type empty;
}
SYMP6
{
type empty;
}
WALL4 WALL4
{ {
type fixedValue; type fixedValue;
value uniform (0 0 0); value uniform (0 0 0);
} }
defaultFaces
{
type empty;
}
} }
// ************************************************************************* // // ************************************************************************* //

View file

@ -22,37 +22,16 @@ boundaryField
{ {
INLE1 INLE1
{ {
type zeroGradient; type isentropicTotalPressure;
U U;
// type waveTransmissiveInlet; p0 uniform 137491.986;
// phi phi; value uniform 101325;
// rho rho;
// psi psi;
// U U;
// gamma 1.4;
// inletOutlet false;
// correctSupercritical false;
// lInf 0.0;
// fieldInf 101325;
// value uniform 101325;
} }
PRES2 PRES2
{ {
type fixedValue; type fixedValue;
value uniform 101325; value uniform 101325;
// type waveTransmissive;
// phi phi;
// rho rho;
// psi psi;
// U U;
// gamma 1.4;
// inletOutlet false;
// correctSupercritical true;
// lInf 0.1;
// fieldInf 101325;
// value uniform 101325;
} }
WALL3 WALL3
@ -60,20 +39,16 @@ boundaryField
type zeroGradient; type zeroGradient;
} }
SYMP5
{
type empty;
}
SYMP6
{
type empty;
}
WALL4 WALL4
{ {
type zeroGradient; type zeroGradient;
} }
defaultFaces
{
type empty;
}
} }
// ************************************************************************* // // ************************************************************************* //

View file

@ -23,27 +23,27 @@ vertices
( 0.5 0 -0.1) ( 0.5 0 -0.1)
( 1.5 0 -0.1) ( 1.5 0 -0.1)
(-1.5 1 -0.1) (-1.5 1.5 -0.1)
(-0.5 1 -0.1) (-0.5 1.5 -0.1)
( 0.5 1 -0.1) ( 0.5 1.5 -0.1)
( 1.5 1 -0.1) ( 1.5 1.5 -0.1)
(-1.5 0 0.1) (-1.5 0 0.1)
(-0.5 0 0.1) (-0.5 0 0.1)
( 0.5 0 0.1) ( 0.5 0 0.1)
( 1.5 0 0.1) ( 1.5 0 0.1)
(-1.5 1 0.1) (-1.5 1.5 0.1)
(-0.5 1 0.1) (-0.5 1.5 0.1)
( 0.5 1 0.1) ( 0.5 1.5 0.1)
( 1.5 1 0.1) ( 1.5 1.5 0.1)
); );
blocks blocks
( (
hex (0 1 5 4 8 9 13 12) (160 160 1) simpleGrading (1 1 1) hex (0 1 5 4 8 9 13 12) (50 75 1) simpleGrading (1 1 1)
hex (1 2 6 5 9 10 14 13) (160 160 1) simpleGrading (1 1 1) hex (1 2 6 5 9 10 14 13) (50 75 1) simpleGrading (1 1 1)
hex (2 3 7 6 10 11 15 14) (160 160 1) simpleGrading (1 1 1) hex (2 3 7 6 10 11 15 14) (50 75 1) simpleGrading (1 1 1)
); );
edges edges

View file

@ -20,32 +20,32 @@ FoamFile
INLE1 INLE1
{ {
type patch; type patch;
nFaces 160; nFaces 75;
startFace 105110; startFace 22275;
} }
PRES2 PRES2
{ {
type patch; type patch;
nFaces 160; nFaces 75;
startFace 105270; startFace 22350;
} }
WALL3 WALL3
{ {
type wall; type wall;
nFaces 330; nFaces 150;
startFace 105430; startFace 22425;
} }
WALL4 WALL4
{ {
type wall; type wall;
nFaces 330; nFaces 150;
startFace 105760; startFace 22575;
} }
defaultFaces defaultFaces
{ {
type empty; type empty;
nFaces 105600; nFaces 22500;
startFace 106090; startFace 22725;
} }
) )

View file

@ -20,7 +20,7 @@ startTime 0;
stopAt endTime; stopAt endTime;
endTime 2000; endTime 3000;
deltaT 1; deltaT 1;
@ -34,7 +34,7 @@ writeFormat ascii;
writePrecision 6; writePrecision 6;
writeCompression uncompressed; writeCompression compressed;
timeFormat general; timeFormat general;

View file

@ -18,11 +18,9 @@ ddtSchemes
{ {
default none; default none;
// ddt(rho,U) steadyInertial phi rho 1;
ddt(rho,U) steadyState; ddt(rho,U) steadyState;
// ddt(rho,h) steadyState; ddt(rho,h) steadyState;
ddt(rho,h) steadyInertial phi rho 1; ddt(psi,p) steadyInertial phi rho 0.5;
ddt(psi,p) steadyInertial phi rho 1;
U steadyState; U steadyState;
T steadyState; T steadyState;
@ -40,23 +38,21 @@ divSchemes
div(phi,U) Gauss upwind; div(phi,U) Gauss upwind;
// div(phi,U) Gauss linearUpwind faceLimited Gauss linear 1.0; // div(phi,U) Gauss linearUpwind faceLimited Gauss linear 1.0;
// div(phi,U) Gauss blended 0.9;
// div(phi,U) Gauss vanLeerDC; // div(phi,U) Gauss vanLeerDC;
// div(phi,U) Gauss SuperBeeDC;
// div(phi,U) Gauss GammaVDC 0.5;
// div(phi,h) Gauss upwind; div(phi,h) Gauss upwind;
// div(phi,h) Gauss GammaDC 0.5; // div(phi,h) Gauss vanLeerDC;
div(phi,h) Gauss vanLeerDC;
// div(phid,p) Gauss upwind; div(phid,p) Gauss upwind;
div(phid,p) Gauss vanLeerDC; // div(phid,p) Gauss vanLeerDC;
div(phi,k) Gauss upwind; div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind; div(phi,epsilon) Gauss upwind;
div((muEff*dev2(grad(U).T()))) Gauss linear; div((muEff*dev2(grad(U).T()))) Gauss linear;
div(U,p) Gauss linear; div(U,p) Gauss linear;
div(U) Gauss linear;
} }
laplacianSchemes laplacianSchemes

View file

@ -16,6 +16,20 @@ FoamFile
solvers solvers
{ {
// Coupled
Up
{
solver BiCGStab;
preconditioner Cholesky;
tolerance 1e-09;
relTol 0.0;
minIter 1;
maxIter 500;
}
// Segregated
p p
{ {
solver BiCGStab; solver BiCGStab;
@ -25,7 +39,7 @@ solvers
maxIter 1000; maxIter 1000;
tolerance 1e-8; tolerance 1e-8;
relTol 0.0; relTol 0.0;
}; }
U U
{ {
solver BiCGStab; solver BiCGStab;
@ -35,7 +49,8 @@ solvers
maxIter 1000; maxIter 1000;
tolerance 1e-8; tolerance 1e-8;
relTol 0.0; relTol 0.0;
}; }
h h
{ {
solver BiCGStab; solver BiCGStab;
@ -45,7 +60,7 @@ solvers
maxIter 1000; maxIter 1000;
tolerance 1e-8; tolerance 1e-8;
relTol 0.0; relTol 0.0;
}; }
} }
PIMPLE PIMPLE
@ -58,19 +73,19 @@ PIMPLE
relaxationFactors relaxationFactors
{ {
// Note: under-relaxation factors used in wave-transmissive schemes // Note: under-relaxation factors used in wave-transmissive schemes
U 0.4; U 0.1;
p 0.2; p 0.25;
h 0.5; h 0.1;
rho 0.5; rho 0.5;
T 1; T 0.5;
} }
fieldBounds fieldBounds
{ {
// With bounding // With bounding
p 50 1e6; p 5e4 3e5;
T 20 3000; T 230 500;
U 1000; U 500;
} }
// ************************************************************************* // // ************************************************************************* //

View file

@ -25,7 +25,7 @@ solvers
maxIter 1000; maxIter 1000;
tolerance 1e-8; tolerance 1e-8;
relTol 0.001; relTol 0.001;
}; }
U U
{ {
solver BiCGStab; solver BiCGStab;
@ -78,14 +78,13 @@ PIMPLE
relaxationFactors relaxationFactors
{ {
// Note: under-relaxation factors used in wave-transmissive schemes // Note: under-relaxation factors used in wave-transmissive schemes
U 0.5; U 0.7;
p 0.2; p 1;
i 0.1; i 0.1;
h 0.5;
rho 0.25; rho 0.25;
k 0.2; k 0.5;
epsilon 0.2; epsilon 0.5;
} }
fieldBounds fieldBounds

View file

@ -27,7 +27,7 @@ deltaT 1;
writeControl timeStep; writeControl timeStep;
writeInterval 50; writeInterval 200;
purgeWrite 0; purgeWrite 0;

View file

@ -42,10 +42,6 @@ divSchemes
div(phi,i) Gauss upwind; div(phi,i) Gauss upwind;
div(phid,p) Gauss upwind; div(phid,p) Gauss upwind;
// div(phi,U) Gauss vanLeerDC;
// div(phi,h) Gauss vanLeerDC;
// div(phid,p) Gauss vanLeerDC;
div(phi,k) Gauss upwind; div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind; div(phi,epsilon) Gauss upwind;
div((muEff*dev2(grad(U).T()))) Gauss linear; div((muEff*dev2(grad(U).T()))) Gauss linear;

View file

@ -24,8 +24,8 @@ solvers
minIter 0; minIter 0;
maxIter 1000; maxIter 1000;
tolerance 1e-8; tolerance 1e-8;
relTol 0.001; relTol 0.01;
}; }
U U
{ {
solver BiCGStab; solver BiCGStab;
@ -90,11 +90,6 @@ relaxationFactors
fieldBounds fieldBounds
{ {
// No bounding
// p 0 1e7;
// T 0 10000;
// U 1e6;
// With bounding // With bounding
p 2e4 1e6; p 2e4 1e6;
T 200 500; T 200 500;

View file

@ -22,24 +22,19 @@ boundaryField
{ {
inlet inlet
{ {
type fixedValue; type totalTemperature;
phi phi;
rho none;
psi psi;
U Uabs;
gamma 1.4;
T0 uniform 300;
value $internalField; value $internalField;
} }
outlet outlet
{ {
// type zeroGradient; type zeroGradient;
type waveTransmissive;
phi phi;
rho rho;
psi psi;
U Urel;
gamma 1.4;
inletOutlet true;
correctSupercritical false;
lInf 0.0;
fieldInf 300;
value $internalField; value $internalField;
} }

View file

@ -16,34 +16,20 @@ FoamFile
dimensions [0 1 -1 0 0 0 0]; dimensions [0 1 -1 0 0 0 0];
internalField uniform (234 0 0); internalField uniform (100 0 0);
boundaryField boundaryField
{ {
inlet inlet
{ {
type SRFVelocity; type pressureInletVelocity;
relative yes; value uniform (100 0 0);
inletValue uniform (234 0 0);
value uniform (234 0 0);
} }
outlet outlet
{ {
type inletOutlet; type inletOutlet;
inletValue uniform (0 0 0); inletValue uniform (0 0 0);
// type waveTransmissive;
// phi phi;
// rho rho;
// psi psi;
// U U;
// gamma 1.4;
// inletOutlet true;
// correctSupercritical false;
// lInf 0;
// fieldInf (0 0 0);
// value $internalField;
} }
blade blade

View file

@ -52,7 +52,6 @@ boundaryField
frontAndBack frontAndBack
{ {
type cyclic; type cyclic;
value uniform 0;
} }
} }

File diff suppressed because it is too large Load diff

View file

@ -58,7 +58,6 @@ boundaryField
frontAndBack frontAndBack
{ {
type cyclic; type cyclic;
value uniform 0;
} }
} }

View file

@ -22,36 +22,20 @@ boundaryField
{ {
inlet inlet
{ {
type zeroGradient; type totalPressure;
phi phi;
// type waveTransmissiveInlet; rho none;
// phi phi; psi psi;
// rho rho; U Uabs;
// psi psi; gamma 1.4;
// U Urel; p0 uniform 1.4e5;
// gamma 1.4; value $internalField;
// inletOutlet false;
// correctSupercritical false;
// lInf 0.0;
// fieldInf 101325;
// value uniform 101325;
} }
outlet outlet
{ {
// type fixedValue; type fixedValue;
value $internalField;
type waveTransmissive;
phi phi;
rho rho;
psi psi;
U Urel;
gamma 1.4;
inletOutlet false;
correctSupercritical true;
lInf 0.1;
fieldInf 101325;
value uniform 101325;
} }
blade blade

View file

@ -17,12 +17,10 @@ FoamFile
SRFModel rpm; SRFModel rpm;
axis (1 0 0); axis (1 0 0);
// axis (-1 0 0);
rpmCoeffs rpmCoeffs
{ {
rpm 30000; rpm 30000;
// rpm 9600;
} }
// ************************************************************************* // // ************************************************************************* //

View file

@ -16,6 +16,7 @@ FoamFile
thermoType hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>; thermoType hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>;
// name, nMoles, mol weight, CP, Hf, mu, Pr;
mixture air 1 28.9 1007 0 1.48e-5 0.7; mixture air 1 28.9 1007 0 1.48e-5 0.7;
// ************************************************************************* // // ************************************************************************* //

View file

@ -20,13 +20,13 @@ startTime 0;
stopAt endTime; stopAt endTime;
endTime 1500; endTime 2000;
deltaT 1; deltaT 1;
writeControl timeStep; writeControl timeStep;
writeInterval 50; writeInterval 200;
purgeWrite 0; purgeWrite 0;

View file

@ -19,9 +19,8 @@ ddtSchemes
default none; default none;
ddt(rho,Urel) steadyState; ddt(rho,Urel) steadyState;
ddt(rho,h) steadyState; ddt(rho,i) steadyState;
// ddt(rho,h) steadyInertial phi rho 1; ddt(psi,p) steadyInertial phi rho 0.25;
ddt(psi,p) steadyInertial phi rho 0.7;
ddt(rho,k) steadyState; ddt(rho,k) steadyState;
ddt(rho,epsilon) steadyState; ddt(rho,epsilon) steadyState;
@ -39,13 +38,9 @@ gradSchemes
divSchemes divSchemes
{ {
default none; default none;
// div(phi,Urel) Gauss upwind; div(phi,Urel) Gauss upwind;
// div(phi,h) Gauss upwind; div(phi,i) Gauss upwind;
// div(phid,p) Gauss upwind; div(phid,p) Gauss upwind;
div(phi,Urel) Gauss vanLeerDC;
div(phi,h) Gauss vanLeerDC;
div(phid,p) Gauss vanLeerDC;
div(phi,k) Gauss upwind; div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind; div(phi,epsilon) Gauss upwind;

View file

@ -24,8 +24,8 @@ solvers
minIter 0; minIter 0;
maxIter 1000; maxIter 1000;
tolerance 1e-8; tolerance 1e-8;
relTol 0.001; relTol 0.01;
}; }
Urel Urel
{ {
solver BiCGStab; solver BiCGStab;
@ -35,8 +35,8 @@ solvers
maxIter 1000; maxIter 1000;
tolerance 1e-8; tolerance 1e-8;
relTol 0.01; relTol 0.01;
}; }
h i
{ {
solver BiCGStab; solver BiCGStab;
preconditioner DILU; preconditioner DILU;
@ -45,7 +45,7 @@ solvers
maxIter 1000; maxIter 1000;
tolerance 1e-8; tolerance 1e-8;
relTol 0.01; relTol 0.01;
}; }
k k
{ {
solver BiCGStab; solver BiCGStab;
@ -54,8 +54,8 @@ solvers
minIter 0; minIter 0;
maxIter 1000; maxIter 1000;
tolerance 1e-8; tolerance 1e-8;
relTol 0.01; relTol 0.0;
}; }
epsilon epsilon
{ {
solver BiCGStab; solver BiCGStab;
@ -64,14 +64,14 @@ solvers
minIter 0; minIter 0;
maxIter 1000; maxIter 1000;
tolerance 1e-8; tolerance 1e-8;
relTol 0.01; relTol 0.0;
}; }
} }
PIMPLE PIMPLE
{ {
nOuterCorrectors 1; nOuterCorrectors 1;
nCorrectors 3; nCorrectors 2;
nNonOrthogonalCorrectors 0; nNonOrthogonalCorrectors 0;
} }
@ -80,24 +80,19 @@ relaxationFactors
// Note: under-relaxation factors used in wave-transmissive schemes // Note: under-relaxation factors used in wave-transmissive schemes
Urel 0.5; Urel 0.5;
p 0.2; p 0.2;
h 0.5; i 0.1;
rho 0.5; rho 0.5;
k 0.3; k 0.2;
epsilon 0.3; epsilon 0.2;
} }
fieldBounds fieldBounds
{ {
// No bounding
// p 0 1e7;
// T 0 10000;
// Urel 1e6;
// With bounding // With bounding
p 50 1e6; p 2e4 1e6;
T 20 3000; T 200 500;
Urel 1000; Urel 500;
} }
// ************************************************************************* // // ************************************************************************* //

View file

@ -22,24 +22,19 @@ boundaryField
{ {
inlet inlet
{ {
type fixedValue; type totalTemperature;
phi phi;
rho none;
psi psi;
U Uabs;
gamma 1.4;
T0 uniform 300;
value $internalField; value $internalField;
} }
outlet outlet
{ {
// type zeroGradient; type zeroGradient;
type waveTransmissive;
phi phi;
rho rho;
psi psi;
U Urel;
gamma 1.4;
inletOutlet true;
correctSupercritical false;
lInf 0.0;
fieldInf 300;
value $internalField; value $internalField;
} }

View file

@ -16,34 +16,20 @@ FoamFile
dimensions [0 1 -1 0 0 0 0]; dimensions [0 1 -1 0 0 0 0];
internalField uniform (234 0 0); internalField uniform (100 0 0);
boundaryField boundaryField
{ {
inlet inlet
{ {
type SRFVelocity; type pressureInletVelocity;
relative yes; value uniform (100 0 0);
inletValue uniform (234 0 0);
value uniform (234 0 0);
} }
outlet outlet
{ {
type inletOutlet; type inletOutlet;
inletValue uniform (0 0 0); inletValue uniform (0 0 0);
// type waveTransmissive;
// phi phi;
// rho rho;
// psi psi;
// U U;
// gamma 1.4;
// inletOutlet true;
// correctSupercritical false;
// lInf 0;
// fieldInf (0 0 0);
// value $internalField;
} }
blade blade

View file

@ -52,7 +52,6 @@ boundaryField
frontAndBack frontAndBack
{ {
type cyclic; type cyclic;
value uniform 0;
} }
} }

View file

@ -65,7 +65,6 @@ boundaryField
frontAndBack frontAndBack
{ {
type cyclic; type cyclic;
value uniform 100;
} }
} }

View file

@ -58,7 +58,6 @@ boundaryField
frontAndBack frontAndBack
{ {
type cyclic; type cyclic;
value uniform 0;
} }
} }

View file

@ -22,36 +22,20 @@ boundaryField
{ {
inlet inlet
{ {
type zeroGradient; type totalPressure;
phi phi;
// type waveTransmissiveInlet; rho none;
// phi phi; psi psi;
// rho rho; U Uabs;
// psi psi; gamma 1.4;
// U Urel; p0 uniform 1.4e5;
// gamma 1.4; value $internalField;
// inletOutlet false;
// correctSupercritical false;
// lInf 0.0;
// fieldInf 101325;
// value uniform 101325;
} }
outlet outlet
{ {
// type fixedValue; type fixedValue;
value $internalField;
type waveTransmissive;
phi phi;
rho rho;
psi psi;
U Urel;
gamma 1.4;
inletOutlet false;
correctSupercritical true;
lInf 0.1;
fieldInf 101325;
value uniform 101325;
} }
blade blade

View file

@ -20,7 +20,6 @@ axis (-1 0 0);
rpmCoeffs rpmCoeffs
{ {
// rpm 15000;
rpm 20000; rpm 20000;
} }

View file

@ -26,7 +26,7 @@ deltaT 1;
writeControl timeStep; writeControl timeStep;
writeInterval 50; writeInterval 200;
purgeWrite 0; purgeWrite 0;

View file

@ -19,9 +19,8 @@ ddtSchemes
default none; default none;
ddt(rho,Urel) steadyState; ddt(rho,Urel) steadyState;
ddt(rho,h) steadyState; ddt(rho,i) steadyState;
// ddt(rho,h) steadyInertial phi rho 1; ddt(psi,p) steadyInertial phi rho 0.25;
ddt(psi,p) steadyInertial phi rho 0.8;
ddt(rho,k) steadyState; ddt(rho,k) steadyState;
ddt(rho,epsilon) steadyState; ddt(rho,epsilon) steadyState;
@ -40,7 +39,7 @@ divSchemes
{ {
default none; default none;
div(phi,Urel) Gauss upwind; div(phi,Urel) Gauss upwind;
div(phi,h) Gauss upwind; div(phi,i) Gauss upwind;
div(phid,p) Gauss upwind; div(phid,p) Gauss upwind;
div(phi,k) Gauss upwind; div(phi,k) Gauss upwind;

View file

@ -25,7 +25,7 @@ solvers
maxIter 1000; maxIter 1000;
tolerance 1e-8; tolerance 1e-8;
relTol 0.01; relTol 0.01;
}; }
Urel Urel
{ {
solver BiCGStab; solver BiCGStab;
@ -35,8 +35,8 @@ solvers
maxIter 1000; maxIter 1000;
tolerance 1e-8; tolerance 1e-8;
relTol 0.01; relTol 0.01;
}; }
h i
{ {
solver BiCGStab; solver BiCGStab;
preconditioner DILU; preconditioner DILU;
@ -45,7 +45,7 @@ solvers
maxIter 1000; maxIter 1000;
tolerance 1e-8; tolerance 1e-8;
relTol 0.01; relTol 0.01;
}; }
k k
{ {
solver BiCGStab; solver BiCGStab;
@ -55,7 +55,7 @@ solvers
maxIter 1000; maxIter 1000;
tolerance 1e-8; tolerance 1e-8;
relTol 0.0; relTol 0.0;
}; }
epsilon epsilon
{ {
solver BiCGStab; solver BiCGStab;
@ -65,7 +65,7 @@ solvers
maxIter 1000; maxIter 1000;
tolerance 1e-8; tolerance 1e-8;
relTol 0.0; relTol 0.0;
}; }
} }
PIMPLE PIMPLE
@ -79,25 +79,20 @@ relaxationFactors
{ {
// Note: under-relaxation factors used in wave-transmissive schemes // Note: under-relaxation factors used in wave-transmissive schemes
Urel 0.5; Urel 0.5;
p 0.3; p 0.2;
h 0.5; i 0.1;
rho 0.5; rho 0.5;
k 0.5; k 0.2;
epsilon 0.5; epsilon 0.2;
} }
fieldBounds fieldBounds
{ {
// No bounding
// p 0 1e7;
// T 0 10000;
// Urel 1e6;
// With bounding // With bounding
p 50 1e6; p 2e4 1e6;
T 20 3000; T 200 500;
Urel 1000; Urel 500;
} }
// ************************************************************************* // // ************************************************************************* //

View file

@ -50,4 +50,28 @@ maxCo 0.8;
maxDeltaT 0.01; maxDeltaT 0.01;
functions
(
minMaxU
{
type minMaxField;
// Where to load it from (if not already in solver)
functionObjectLibs (/*"libsampling.so"*/ "libfieldFunctionObjects.so");
name U;
}
minMaxP
{
type minMaxField;
// Where to load it from (if not already in solver)
functionObjectLibs ("libfieldFunctionObjects.so");
name p;
}
);
// ************************************************************************* // // ************************************************************************* //

View file

@ -14,12 +14,6 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- Keep owner and neighbour on same processor for faces in zones:
// preserveFaceZones ( interface1_faces interface2_faces );
//- Keep owner and neighbour on same processor for faces in patches:
// preservePatches ( interface1 interface2 );
globalFaceZones globalFaceZones
( (
interface1_faces interface1_faces
@ -28,10 +22,9 @@ globalFaceZones
rotor_cyclic_lower_faces rotor_cyclic_lower_faces
); // Those are the names of the face zones created previously ); // Those are the names of the face zones created previously
numberOfSubdomains 4; // The problem will be decomposed in 4 different processors numberOfSubdomains 4;
method scotch; method scotch;
// method metis;
simpleCoeffs simpleCoeffs
{ {
@ -39,32 +32,6 @@ simpleCoeffs
delta 0.001; delta 0.001;
} }
metisCoeffs
{
/*
processorWeights
(
1
1
1
1
);
*/
}
scotchCoeffs
{
//processorWeights
//(
// 1
// 1
// 1
// 1
//);
//writeGraph true;
//strategy "b";
}
distributed no; distributed no;
roots roots

View file

@ -33,12 +33,7 @@ divSchemes
laplacianSchemes laplacianSchemes
{ {
default none; default Gauss linear corrected;
laplacian(nu,U) Gauss linear corrected;
laplacian(rAU,pcorr) Gauss linear corrected;
laplacian(rAU,p) Gauss linear corrected;
laplacian((1|A(U)),p) Gauss linear corrected;
} }
interpolationSchemes interpolationSchemes

View file

@ -10,56 +10,62 @@ FoamFile
version 2.0; version 2.0;
format ascii; format ascii;
class volVectorField; class volVectorField;
location "0";
object U; object U;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0]; dimensions [0 1 -1 0 0 0 0];
internalField uniform (173 0 0); internalField uniform (0 0 0);
boundaryField boundaryField
{ {
INLE1 upstreamMixingPlanePatch
{ {
type fixedValue; type mixingPlane;
value uniform (173 0 0);
} }
downstreamMixingPlanePatch
PRES2
{ {
// type inletOutlet; type mixingPlane;
// inletValue uniform (0 0 0);
type waveTransmissive;
phi phi;
rho rho;
psi psi;
U U;
gamma 1.4;
inletOutlet true;
correctSupercritical false;
lInf 0.5;
fieldInf (0 0 0);
value $internalField;
} }
upstreamPerio1
WALL3
{ {
type fixedValue; type cyclicGgi;
}
upstreamPerio2
{
type cyclicGgi;
}
downstreamPerio1
{
type cyclicGgi;
}
downstreamPerio2
{
type cyclicGgi;
}
downstreamWall
{
type symmetryPlane;
}
upstreamWall
{
type symmetryPlane;
}
inflow
{
type surfaceNormalFixedValue;
refValue uniform -10;
value uniform (0 0 0); value uniform (0 0 0);
} }
outflow
WALL4
{ {
type fixedValue; type inletOutlet;
inletValue uniform (0 0 0);
value uniform (0 0 0); value uniform (0 0 0);
} }
defaultFaces
{
type empty;
}
} }
// ************************************************************************* // // ************************************************************************* //

View file

@ -0,0 +1,68 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 3.1 |
| \\ / A nd | Web: http://www.extend-project.de |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 0 2 -3 0 0 0 0 ];
internalField uniform 0.1;
boundaryField
{
downstreamMixingPlanePatch
{
type mixingPlane;
}
upstreamMixingPlanePatch
{
type mixingPlane;
}
downstreamWall
{
type symmetryPlane;
}
upstreamWall
{
type symmetryPlane;
}
downstreamPerio1
{
type cyclicGgi;
}
downstreamPerio2
{
type cyclicGgi;
}
upstreamPerio1
{
type cyclicGgi;
}
upstreamPerio2
{
type cyclicGgi;
}
inflow
{
type fixedValue;
value uniform 0.1;
}
outflow
{
type zeroGradient;
}
}
// ************************************************************************* //

View file

@ -9,14 +9,61 @@ FoamFile
{ {
version 2.0; version 2.0;
format ascii; format ascii;
class dictionary; class volScalarField;
object thermophysicalProperties; location "0";
object k;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
thermoType hPsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>; dimensions [ 0 2 -2 0 0 0 0 ];
// name, nMoles, mol weight, CP, Hf, mu, Pr; internalField uniform 0.01;
mixture air 1 28.9 1007 0 0 0.7;
boundaryField
{
downstreamPerio1
{
type cyclicGgi;
}
downstreamPerio2
{
type cyclicGgi;
}
upstreamPerio1
{
type cyclicGgi;
}
upstreamPerio2
{
type cyclicGgi;
}
downstreamWall
{
type symmetryPlane;
}
upstreamWall
{
type symmetryPlane;
}
downstreamMixingPlanePatch
{
type mixingPlane;
}
upstreamMixingPlanePatch
{
type mixingPlane;
}
inflow
{
type fixedValue;
value uniform 0.01;
}
outflow
{
type zeroGradient;
}
}
// ************************************************************************* // // ************************************************************************* //

View file

@ -9,24 +9,60 @@ FoamFile
{ {
version 2.0; version 2.0;
format ascii; format ascii;
class dictionary; class volScalarField;
object RASProperties; location "0";
object p;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
RASModel laminar; dimensions [ 0 2 -2 0 0 0 0 ];
turbulence on; internalField uniform 0;
printCoeffs on; boundaryField
laminarCoeffs
{}
wallFunctionCoeffs
{ {
kappa 0.4187; downstreamMixingPlanePatch
E 9; {
type mixingPlane;
}
upstreamMixingPlanePatch
{
type mixingPlane;
}
downstreamWall
{
type symmetryPlane;
}
upstreamWall
{
type symmetryPlane;
}
upstreamPerio1
{
type cyclicGgi;
}
upstreamPerio2
{
type cyclicGgi;
}
downstreamPerio1
{
type cyclicGgi;
}
downstreamPerio2
{
type cyclicGgi;
}
inflow
{
type zeroGradient;
}
outflow
{
type fixedValue;
value uniform 0;
}
} }
// ************************************************************************* // // ************************************************************************* //

View file

@ -5,4 +5,4 @@
cleanCase cleanCase
\rm constant/polyMesh/blockMeshDict constant/polyMesh/boundary \rm constant/polyMesh/blockMeshDict constant/polyMesh/boundary
\rm -r 0 \rm -rf 0 ; cp -r save 0

View file

@ -9,11 +9,7 @@ runApplication blockMesh
runApplication setSet -batch setBatch.batch runApplication setSet -batch setBatch.batch
runApplication setsToZones -noFlipMap runApplication setsToZones -noFlipMap
cp -r save 0
runApplication potentialFoam runApplication potentialFoam
runApplication simpleFoam runApplication simpleFoam

View file

@ -14,9 +14,10 @@ FoamFile
} }
numberOfSubdomains 4; numberOfSubdomains 4;
method manual; //metis; //simple; method metis; //metis; //simple;
globalFaceZones ( globalFaceZones
(
ggi1DomBZone ggi1DomBZone
ggi1DomAZone ggi1DomAZone
ggi2DomBZone ggi2DomBZone