mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
GIT: Initial commit after latest foundation merge
This commit is contained in:
@ -6,4 +6,4 @@ wclean libso BCs
|
||||
wclean
|
||||
wclean rhoCentralDyMFoam
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -1,7 +1,11 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Parse arguments for library compilation
|
||||
targetType=libso
|
||||
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
|
||||
set -x
|
||||
|
||||
(wmake libso BCs && wmake && wmake rhoCentralDyMFoam)
|
||||
(wmake $targetType BCs && wmake && wmake rhoCentralDyMFoam)
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -26,15 +26,10 @@ License
|
||||
#include "mixedFixedValueSlipFvPatchField.H"
|
||||
#include "symmTransformField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
mixedFixedValueSlipFvPatchField<Type>::mixedFixedValueSlipFvPatchField
|
||||
Foam::mixedFixedValueSlipFvPatchField<Type>::mixedFixedValueSlipFvPatchField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, volMesh>& iF
|
||||
@ -47,7 +42,21 @@ mixedFixedValueSlipFvPatchField<Type>::mixedFixedValueSlipFvPatchField
|
||||
|
||||
|
||||
template<class Type>
|
||||
mixedFixedValueSlipFvPatchField<Type>::mixedFixedValueSlipFvPatchField
|
||||
Foam::mixedFixedValueSlipFvPatchField<Type>::mixedFixedValueSlipFvPatchField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, volMesh>& iF,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
transformFvPatchField<Type>(p, iF),
|
||||
refValue_("refValue", dict, p.size()),
|
||||
valueFraction_("valueFraction", dict, p.size())
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::mixedFixedValueSlipFvPatchField<Type>::mixedFixedValueSlipFvPatchField
|
||||
(
|
||||
const mixedFixedValueSlipFvPatchField<Type>& ptf,
|
||||
const fvPatch& p,
|
||||
@ -62,21 +71,7 @@ mixedFixedValueSlipFvPatchField<Type>::mixedFixedValueSlipFvPatchField
|
||||
|
||||
|
||||
template<class Type>
|
||||
mixedFixedValueSlipFvPatchField<Type>::mixedFixedValueSlipFvPatchField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, volMesh>& iF,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
transformFvPatchField<Type>(p, iF),
|
||||
refValue_("refValue", dict, p.size()),
|
||||
valueFraction_("valueFraction", dict, p.size())
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
mixedFixedValueSlipFvPatchField<Type>::mixedFixedValueSlipFvPatchField
|
||||
Foam::mixedFixedValueSlipFvPatchField<Type>::mixedFixedValueSlipFvPatchField
|
||||
(
|
||||
const mixedFixedValueSlipFvPatchField<Type>& ptf
|
||||
)
|
||||
@ -86,8 +81,9 @@ mixedFixedValueSlipFvPatchField<Type>::mixedFixedValueSlipFvPatchField
|
||||
valueFraction_(ptf.valueFraction_)
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
mixedFixedValueSlipFvPatchField<Type>::mixedFixedValueSlipFvPatchField
|
||||
Foam::mixedFixedValueSlipFvPatchField<Type>::mixedFixedValueSlipFvPatchField
|
||||
(
|
||||
const mixedFixedValueSlipFvPatchField<Type>& ptf,
|
||||
const DimensionedField<Type, volMesh>& iF
|
||||
@ -101,9 +97,8 @@ mixedFixedValueSlipFvPatchField<Type>::mixedFixedValueSlipFvPatchField
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
// Map from self
|
||||
template<class Type>
|
||||
void mixedFixedValueSlipFvPatchField<Type>::autoMap
|
||||
void Foam::mixedFixedValueSlipFvPatchField<Type>::autoMap
|
||||
(
|
||||
const fvPatchFieldMapper& m
|
||||
)
|
||||
@ -114,9 +109,8 @@ void mixedFixedValueSlipFvPatchField<Type>::autoMap
|
||||
}
|
||||
|
||||
|
||||
// Reverse-map the given fvPatchField onto this fvPatchField
|
||||
template<class Type>
|
||||
void mixedFixedValueSlipFvPatchField<Type>::rmap
|
||||
void Foam::mixedFixedValueSlipFvPatchField<Type>::rmap
|
||||
(
|
||||
const fvPatchField<Type>& ptf,
|
||||
const labelList& addr
|
||||
@ -125,16 +119,16 @@ void mixedFixedValueSlipFvPatchField<Type>::rmap
|
||||
transformFvPatchField<Type>::rmap(ptf, addr);
|
||||
|
||||
const mixedFixedValueSlipFvPatchField<Type>& dmptf =
|
||||
refCast<const mixedFixedValueSlipFvPatchField<Type> >(ptf);
|
||||
refCast<const mixedFixedValueSlipFvPatchField<Type>>(ptf);
|
||||
|
||||
refValue_.rmap(dmptf.refValue_, addr);
|
||||
valueFraction_.rmap(dmptf.valueFraction_, addr);
|
||||
}
|
||||
|
||||
|
||||
// Return gradient at boundary
|
||||
template<class Type>
|
||||
tmp<Field<Type> > mixedFixedValueSlipFvPatchField<Type>::snGrad() const
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::mixedFixedValueSlipFvPatchField<Type>::snGrad() const
|
||||
{
|
||||
tmp<vectorField> nHat = this->patch().nf();
|
||||
Field<Type> pif(this->patchInternalField());
|
||||
@ -147,9 +141,11 @@ tmp<Field<Type> > mixedFixedValueSlipFvPatchField<Type>::snGrad() const
|
||||
}
|
||||
|
||||
|
||||
// Evaluate the field on the patch
|
||||
template<class Type>
|
||||
void mixedFixedValueSlipFvPatchField<Type>::evaluate(const Pstream::commsTypes)
|
||||
void Foam::mixedFixedValueSlipFvPatchField<Type>::evaluate
|
||||
(
|
||||
const Pstream::commsTypes
|
||||
)
|
||||
{
|
||||
if (!this->updated())
|
||||
{
|
||||
@ -170,10 +166,9 @@ void mixedFixedValueSlipFvPatchField<Type>::evaluate(const Pstream::commsTypes)
|
||||
}
|
||||
|
||||
|
||||
// Return defining fields
|
||||
template<class Type>
|
||||
tmp<Field<Type> >
|
||||
mixedFixedValueSlipFvPatchField<Type>::snGradTransformDiag() const
|
||||
Foam::tmp<Foam::Field<Type>>
|
||||
Foam::mixedFixedValueSlipFvPatchField<Type>::snGradTransformDiag() const
|
||||
{
|
||||
vectorField nHat(this->patch().nf());
|
||||
vectorField diag(nHat.size());
|
||||
@ -189,9 +184,8 @@ mixedFixedValueSlipFvPatchField<Type>::snGradTransformDiag() const
|
||||
}
|
||||
|
||||
|
||||
// Write
|
||||
template<class Type>
|
||||
void mixedFixedValueSlipFvPatchField<Type>::write(Ostream& os) const
|
||||
void Foam::mixedFixedValueSlipFvPatchField<Type>::write(Ostream& os) const
|
||||
{
|
||||
transformFvPatchField<Type>::write(os);
|
||||
refValue_.writeEntry("refValue", os);
|
||||
@ -199,8 +193,4 @@ void mixedFixedValueSlipFvPatchField<Type>::write(Ostream& os) const
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -101,9 +101,9 @@ public:
|
||||
);
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual tmp<fvPatchField<Type> > clone() const
|
||||
virtual tmp<fvPatchField<Type>> clone() const
|
||||
{
|
||||
return tmp<fvPatchField<Type> >
|
||||
return tmp<fvPatchField<Type>>
|
||||
(
|
||||
new mixedFixedValueSlipFvPatchField<Type>(*this)
|
||||
);
|
||||
@ -117,12 +117,12 @@ public:
|
||||
);
|
||||
|
||||
//- Construct and return a clone setting internal field reference
|
||||
virtual tmp<fvPatchField<Type> > clone
|
||||
virtual tmp<fvPatchField<Type>> clone
|
||||
(
|
||||
const DimensionedField<Type, volMesh>& iF
|
||||
) const
|
||||
{
|
||||
return tmp<fvPatchField<Type> >
|
||||
return tmp<fvPatchField<Type>>
|
||||
(
|
||||
new mixedFixedValueSlipFvPatchField<Type>(*this, iF)
|
||||
);
|
||||
@ -130,6 +130,15 @@ public:
|
||||
|
||||
// Member functions
|
||||
|
||||
// Access
|
||||
|
||||
//- Return false: this patch field is not altered by assignment
|
||||
virtual bool assignable() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Mapping functions
|
||||
|
||||
//- Map (and resize as needed) from self given a mapping object
|
||||
@ -170,7 +179,7 @@ public:
|
||||
// Evaluation functions
|
||||
|
||||
//- Return gradient at boundary
|
||||
virtual tmp<Field<Type> > snGrad() const;
|
||||
virtual tmp<Field<Type>> snGrad() const;
|
||||
|
||||
//- Evaluate the patch field
|
||||
virtual void evaluate
|
||||
@ -179,7 +188,7 @@ public:
|
||||
);
|
||||
|
||||
//- Return face-gradient transform diagonal
|
||||
virtual tmp<Field<Type> > snGradTransformDiag() const;
|
||||
virtual tmp<Field<Type>> snGradTransformDiag() const;
|
||||
|
||||
|
||||
//- Write
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -33,7 +33,7 @@ Description
|
||||
This boundary condition provides a fixed density inlet condition for
|
||||
compressible solvers, where the density of calculated using:
|
||||
|
||||
\f{
|
||||
\f[
|
||||
\rho = \psi p
|
||||
\f]
|
||||
|
||||
|
||||
@ -95,7 +95,7 @@ surfaceScalarField neg
|
||||
dimensionedScalar("neg", dimless, -1.0)
|
||||
);
|
||||
|
||||
surfaceScalarField phi("phi", mesh.Sf() & fvc::interpolate(rhoU));
|
||||
surfaceScalarField phi("phi", fvc::flux(rhoU));
|
||||
|
||||
Info<< "Creating turbulence model\n" << endl;
|
||||
autoPtr<compressible::turbulenceModel> turbulence
|
||||
|
||||
@ -3,14 +3,14 @@ namespace Foam
|
||||
|
||||
//- Interpolate field vf according to direction dir
|
||||
template<class Type>
|
||||
tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > interpolate
|
||||
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>> interpolate
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vf,
|
||||
const surfaceScalarField& dir,
|
||||
const word& reconFieldName = word::null
|
||||
)
|
||||
{
|
||||
tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > tsf
|
||||
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>> tsf
|
||||
(
|
||||
fvc::interpolate
|
||||
(
|
||||
@ -22,7 +22,7 @@ tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > interpolate
|
||||
)
|
||||
);
|
||||
|
||||
GeometricField<Type, fvsPatchField, surfaceMesh>& sf = tsf();
|
||||
GeometricField<Type, fvsPatchField, surfaceMesh>& sf = tsf.ref();
|
||||
|
||||
sf.rename(vf.name() + '_' + dir.name());
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -37,7 +37,6 @@ Description
|
||||
#include "dynamicFvMesh.H"
|
||||
#include "psiThermo.H"
|
||||
#include "turbulentFluidThermoModel.H"
|
||||
#include "zeroGradientFvPatchFields.H"
|
||||
#include "fixedRhoFvPatchScalarField.H"
|
||||
#include "directionInterpolate.H"
|
||||
#include "motionSolver.H"
|
||||
@ -212,7 +211,7 @@ int main(int argc, char *argv[])
|
||||
"sigmaDotU",
|
||||
(
|
||||
fvc::interpolate(muEff)*mesh.magSf()*fvc::snGrad(U)
|
||||
+ (mesh.Sf() & fvc::interpolate(tauMC))
|
||||
+ fvc::dotInterpolate(mesh.Sf(), tauMC)
|
||||
)
|
||||
& (a_pos*U_pos + a_neg*U_neg)
|
||||
);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -36,7 +36,6 @@ Description
|
||||
#include "fvCFD.H"
|
||||
#include "psiThermo.H"
|
||||
#include "turbulentFluidThermoModel.H"
|
||||
#include "zeroGradientFvPatchFields.H"
|
||||
#include "fixedRhoFvPatchScalarField.H"
|
||||
#include "directionInterpolate.H"
|
||||
#include "localEulerDdtScheme.H"
|
||||
@ -205,9 +204,9 @@ int main(int argc, char *argv[])
|
||||
"sigmaDotU",
|
||||
(
|
||||
fvc::interpolate(muEff)*mesh.magSf()*fvc::snGrad(U)
|
||||
+ (mesh.Sf() & fvc::interpolate(tauMC))
|
||||
+ fvc::dotInterpolate(mesh.Sf(), tauMC)
|
||||
)
|
||||
& (a_pos*U_pos + a_neg*U_neg)
|
||||
& (a_pos*U_pos + a_neg*U_neg)
|
||||
);
|
||||
|
||||
solve
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
volScalarField& rDeltaT = trDeltaT();
|
||||
volScalarField& rDeltaT = trDeltaT.ref();
|
||||
|
||||
scalar rDeltaTSmoothingCoeff
|
||||
(
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
MRF.correctBoundaryVelocity(U);
|
||||
|
||||
tmp<fvVectorMatrix> UEqn
|
||||
tmp<fvVectorMatrix> tUEqn
|
||||
(
|
||||
fvm::ddt(rho, U) + fvm::div(phi, U)
|
||||
+ MRF.DDt(rho, U)
|
||||
@ -10,14 +10,15 @@ tmp<fvVectorMatrix> UEqn
|
||||
==
|
||||
fvOptions(rho, U)
|
||||
);
|
||||
fvVectorMatrix& UEqn = tUEqn.ref();
|
||||
|
||||
UEqn().relax();
|
||||
UEqn.relax();
|
||||
|
||||
fvOptions.constrain(UEqn());
|
||||
fvOptions.constrain(UEqn);
|
||||
|
||||
if (pimple.momentumPredictor())
|
||||
{
|
||||
solve(UEqn() == -fvc::grad(p));
|
||||
solve(UEqn == -fvc::grad(p));
|
||||
|
||||
fvOptions.correct(U);
|
||||
K = 0.5*magSqr(U);
|
||||
|
||||
@ -3,15 +3,13 @@ rho = max(rho, rhoMin);
|
||||
rho = min(rho, rhoMax);
|
||||
rho.relax();
|
||||
|
||||
volScalarField rAU(1.0/UEqn().A());
|
||||
volScalarField rAU(1.0/UEqn.A());
|
||||
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||
|
||||
volVectorField HbyA("HbyA", U);
|
||||
HbyA = rAU*UEqn().H();
|
||||
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
|
||||
|
||||
if (pimple.nCorrPISO() <= 1)
|
||||
{
|
||||
UEqn.clear();
|
||||
tUEqn.clear();
|
||||
}
|
||||
|
||||
if (pimple.transonic())
|
||||
@ -21,7 +19,7 @@ if (pimple.transonic())
|
||||
"phid",
|
||||
fvc::interpolate(psi)
|
||||
*(
|
||||
(fvc::interpolate(HbyA) & mesh.Sf())
|
||||
fvc::flux(HbyA)
|
||||
+ rhorAUf*fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho)
|
||||
)
|
||||
);
|
||||
@ -53,13 +51,16 @@ else
|
||||
(
|
||||
"phiHbyA",
|
||||
(
|
||||
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
||||
fvc::flux(rho*HbyA)
|
||||
+ rhorAUf*fvc::ddtCorr(rho, U, phi)
|
||||
)
|
||||
);
|
||||
|
||||
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
|
||||
|
||||
// Update the pressure BCs to ensure flux consistency
|
||||
constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF);
|
||||
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
|
||||
@ -3,14 +3,13 @@ rho = max(rho, rhoMin);
|
||||
rho = min(rho, rhoMax);
|
||||
rho.relax();
|
||||
|
||||
volScalarField rAU(1.0/UEqn().A());
|
||||
volScalarField rAtU(1.0/(1.0/rAU - UEqn().H1()));
|
||||
volVectorField HbyA("HbyA", U);
|
||||
HbyA = rAU*UEqn().H();
|
||||
volScalarField rAU(1.0/UEqn.A());
|
||||
volScalarField rAtU(1.0/(1.0/rAU - UEqn.H1()));
|
||||
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
|
||||
|
||||
if (pimple.nCorrPISO() <= 1)
|
||||
{
|
||||
UEqn.clear();
|
||||
tUEqn.clear();
|
||||
}
|
||||
|
||||
if (pimple.transonic())
|
||||
@ -20,7 +19,7 @@ if (pimple.transonic())
|
||||
"phid",
|
||||
fvc::interpolate(psi)
|
||||
*(
|
||||
(fvc::interpolate(HbyA) & mesh.Sf())
|
||||
fvc::flux(HbyA)
|
||||
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(rho, U, phi)
|
||||
/fvc::interpolate(rho)
|
||||
)
|
||||
@ -64,7 +63,7 @@ else
|
||||
(
|
||||
"phiHbyA",
|
||||
(
|
||||
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
||||
fvc::flux(rho*HbyA)
|
||||
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(rho, U, phi)
|
||||
)
|
||||
);
|
||||
@ -76,6 +75,9 @@ else
|
||||
|
||||
volScalarField rhorAtU("rhorAtU", rho*rAtU);
|
||||
|
||||
// Update the pressure BCs to ensure flux consistency
|
||||
constrainPressure(p, rho, U, phiHbyA, rhorAtU, MRF);
|
||||
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
|
||||
@ -3,15 +3,13 @@ rho = max(rho, rhoMin);
|
||||
rho = min(rho, rhoMax);
|
||||
rho.relax();
|
||||
|
||||
volScalarField rAU(1.0/UEqn().A());
|
||||
volScalarField rAU(1.0/UEqn.A());
|
||||
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||
|
||||
volVectorField HbyA("HbyA", U);
|
||||
HbyA = rAU*UEqn().H();
|
||||
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
|
||||
|
||||
if (pimple.nCorrPISO() <= 1)
|
||||
{
|
||||
UEqn.clear();
|
||||
tUEqn.clear();
|
||||
}
|
||||
|
||||
if (pimple.transonic())
|
||||
@ -21,7 +19,7 @@ if (pimple.transonic())
|
||||
"phid",
|
||||
fvc::interpolate(psi)
|
||||
*(
|
||||
(fvc::interpolate(HbyA) & mesh.Sf())
|
||||
fvc::flux(HbyA)
|
||||
+ rhorAUf*fvc::ddtCorr(rho, U, rhoUf)/fvc::interpolate(rho)
|
||||
)
|
||||
);
|
||||
@ -53,13 +51,16 @@ else
|
||||
surfaceScalarField phiHbyA
|
||||
(
|
||||
"phiHbyA",
|
||||
(fvc::interpolate(rho*HbyA) & mesh.Sf())
|
||||
fvc::flux(rho*HbyA)
|
||||
+ rhorAUf*fvc::ddtCorr(rho, U, rhoUf)
|
||||
);
|
||||
|
||||
fvc::makeRelative(phiHbyA, rho, U);
|
||||
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
|
||||
|
||||
// Update the pressure BCs to ensure flux consistency
|
||||
constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF);
|
||||
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
// Pressure corrector
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
volScalarField& rDeltaT = trDeltaT();
|
||||
volScalarField& rDeltaT = trDeltaT.ref();
|
||||
|
||||
const dictionary& pimpleDict = pimple.dict();
|
||||
|
||||
@ -38,7 +38,7 @@
|
||||
surfaceScalarField phid
|
||||
(
|
||||
"phid",
|
||||
fvc::interpolate(psi)*(fvc::interpolate(U) & mesh.Sf())
|
||||
fvc::interpolate(psi)*fvc::flux(U)
|
||||
);
|
||||
|
||||
rDeltaT.dimensionedInternalField() = max
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
MRF.correctBoundaryVelocity(U);
|
||||
|
||||
tmp<fvVectorMatrix> UEqn
|
||||
tmp<fvVectorMatrix> tUEqn
|
||||
(
|
||||
fvm::div(phi, U)
|
||||
+ MRF.DDt(rho, U)
|
||||
@ -10,11 +10,12 @@
|
||||
==
|
||||
fvOptions(rho, U)
|
||||
);
|
||||
fvVectorMatrix& UEqn = tUEqn.ref();
|
||||
|
||||
UEqn().relax();
|
||||
UEqn.relax();
|
||||
|
||||
fvOptions.constrain(UEqn());
|
||||
fvOptions.constrain(UEqn);
|
||||
|
||||
solve(UEqn() == -fvc::grad(p));
|
||||
solve(UEqn == -fvc::grad(p));
|
||||
|
||||
fvOptions.correct(U);
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
{
|
||||
volScalarField rAU(1.0/UEqn().A());
|
||||
volVectorField HbyA("HbyA", U);
|
||||
HbyA = rAU*UEqn().H();
|
||||
|
||||
UEqn.clear();
|
||||
volScalarField rAU(1.0/UEqn.A());
|
||||
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
|
||||
tUEqn.clear();
|
||||
|
||||
bool closedVolume = false;
|
||||
|
||||
@ -13,7 +12,7 @@
|
||||
(
|
||||
"phid",
|
||||
fvc::interpolate(psi)
|
||||
*(fvc::interpolate(HbyA) & mesh.Sf())
|
||||
*fvc::flux(HbyA)
|
||||
);
|
||||
|
||||
MRF.makeRelative(fvc::interpolate(psi), phid);
|
||||
@ -23,7 +22,7 @@
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
fvm::div(phid, p)
|
||||
- fvm::laplacian(rho*rAU, p)
|
||||
- fvm::laplacian(rhorAUf, p)
|
||||
==
|
||||
fvOptions(psi, p, rho.name())
|
||||
);
|
||||
@ -43,22 +42,20 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
surfaceScalarField phiHbyA
|
||||
(
|
||||
"phiHbyA",
|
||||
fvc::interpolate(rho*HbyA) & mesh.Sf()
|
||||
);
|
||||
|
||||
surfaceScalarField phiHbyA("phiHbyA", fvc::flux(rho*HbyA));
|
||||
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
|
||||
|
||||
closedVolume = adjustPhi(phiHbyA, U, p);
|
||||
|
||||
// Update the pressure BCs to ensure flux consistency
|
||||
constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF);
|
||||
|
||||
while (simple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
fvc::div(phiHbyA)
|
||||
- fvm::laplacian(rho*rAU, p)
|
||||
- fvm::laplacian(rhorAUf, p)
|
||||
==
|
||||
fvOptions(psi, p, rho.name())
|
||||
);
|
||||
|
||||
@ -1,10 +1,7 @@
|
||||
volScalarField rAU(1.0/UEqn().A());
|
||||
volScalarField rAtU(1.0/(1.0/rAU - UEqn().H1()));
|
||||
|
||||
volVectorField HbyA("HbyA", U);
|
||||
HbyA = rAU*UEqn().H();
|
||||
|
||||
UEqn.clear();
|
||||
volScalarField rAU(1.0/UEqn.A());
|
||||
volScalarField rAtU(1.0/(1.0/rAU - UEqn.H1()));
|
||||
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
|
||||
tUEqn.clear();
|
||||
|
||||
bool closedVolume = false;
|
||||
|
||||
@ -14,7 +11,7 @@ if (simple.transonic())
|
||||
(
|
||||
"phid",
|
||||
fvc::interpolate(psi)
|
||||
*(fvc::interpolate(HbyA) & mesh.Sf())
|
||||
*fvc::flux(HbyA)
|
||||
);
|
||||
|
||||
MRF.makeRelative(fvc::interpolate(psi), phid);
|
||||
@ -55,12 +52,7 @@ if (simple.transonic())
|
||||
}
|
||||
else
|
||||
{
|
||||
surfaceScalarField phiHbyA
|
||||
(
|
||||
"phiHbyA",
|
||||
fvc::interpolate(rho*HbyA) & mesh.Sf()
|
||||
);
|
||||
|
||||
surfaceScalarField phiHbyA("phiHbyA", fvc::flux(rho*HbyA));
|
||||
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
|
||||
|
||||
closedVolume = adjustPhi(phiHbyA, U, p);
|
||||
@ -70,6 +62,9 @@ else
|
||||
|
||||
volScalarField rhorAtU("rhorAtU", rho*rAtU);
|
||||
|
||||
// Update the pressure BCs to ensure flux consistency
|
||||
constrainPressure(p, rho, U, phiHbyA, rhorAtU, MRF);
|
||||
|
||||
while (simple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
MRF.correctBoundaryVelocity(U);
|
||||
|
||||
tmp<fvVectorMatrix> UEqn
|
||||
tmp<fvVectorMatrix> tUEqn
|
||||
(
|
||||
fvm::div(phi, U)
|
||||
+ MRF.DDt(rho, U)
|
||||
@ -10,8 +10,9 @@
|
||||
==
|
||||
fvOptions(rho, U)
|
||||
);
|
||||
fvVectorMatrix& UEqn = tUEqn.ref();
|
||||
|
||||
UEqn().relax();
|
||||
UEqn.relax();
|
||||
|
||||
// Include the porous media resistance and solve the momentum equation
|
||||
// either implicit in the tensorial resistance or transport using by
|
||||
@ -22,18 +23,18 @@
|
||||
|
||||
if (pressureImplicitPorosity)
|
||||
{
|
||||
tmp<volTensorField> tTU = tensor(I)*UEqn().A();
|
||||
pZones.addResistance(UEqn(), tTU());
|
||||
tmp<volTensorField> tTU = tensor(I)*UEqn.A();
|
||||
pZones.addResistance(UEqn, tTU.ref());
|
||||
trTU = inv(tTU());
|
||||
trTU().rename("rAU");
|
||||
trTU.ref().rename("rAU");
|
||||
|
||||
fvOptions.constrain(UEqn());
|
||||
fvOptions.constrain(UEqn);
|
||||
|
||||
volVectorField gradp(fvc::grad(p));
|
||||
|
||||
for (int UCorr=0; UCorr<nUCorr; UCorr++)
|
||||
{
|
||||
U = trTU() & (UEqn().H() - gradp);
|
||||
U = trTU() & (UEqn.H() - gradp);
|
||||
}
|
||||
U.correctBoundaryConditions();
|
||||
|
||||
@ -41,14 +42,14 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
pZones.addResistance(UEqn());
|
||||
pZones.addResistance(UEqn);
|
||||
|
||||
fvOptions.constrain(UEqn());
|
||||
fvOptions.constrain(UEqn);
|
||||
|
||||
solve(UEqn() == -fvc::grad(p));
|
||||
solve(UEqn == -fvc::grad(p));
|
||||
|
||||
fvOptions.correct(U);
|
||||
|
||||
trAU = 1.0/UEqn().A();
|
||||
trAU().rename("rAU");
|
||||
trAU = 1.0/UEqn.A();
|
||||
trAU.ref().rename("rAU");
|
||||
}
|
||||
|
||||
@ -68,9 +68,9 @@ dimensionedScalar rhoMin
|
||||
);
|
||||
|
||||
Info<< "Creating turbulence model\n" << endl;
|
||||
autoPtr<compressible::RASModel> turbulence
|
||||
autoPtr<compressible::turbulenceModel> turbulence
|
||||
(
|
||||
compressible::New<compressible::RASModel>
|
||||
compressible::turbulenceModel::New
|
||||
(
|
||||
rho,
|
||||
U,
|
||||
|
||||
@ -1,27 +1,22 @@
|
||||
{
|
||||
const volScalarField& psi = thermo.psi();
|
||||
|
||||
volVectorField HbyA("HbyA", U);
|
||||
|
||||
tmp<volVectorField> tHbyA;
|
||||
if (pressureImplicitPorosity)
|
||||
{
|
||||
HbyA = trTU() & UEqn().H();
|
||||
tHbyA = constrainHbyA(trTU()&UEqn.H(), U, p);
|
||||
}
|
||||
else
|
||||
{
|
||||
HbyA = trAU()*UEqn().H();
|
||||
tHbyA = constrainHbyA(trAU()*UEqn.H(), U, p);
|
||||
}
|
||||
volVectorField& HbyA = tHbyA.ref();
|
||||
|
||||
UEqn.clear();
|
||||
tUEqn.clear();
|
||||
|
||||
bool closedVolume = false;
|
||||
|
||||
surfaceScalarField phiHbyA
|
||||
(
|
||||
"phiHbyA",
|
||||
fvc::interpolate(rho*HbyA) & mesh.Sf()
|
||||
);
|
||||
|
||||
surfaceScalarField phiHbyA("phiHbyA", fvc::flux(rho*HbyA));
|
||||
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
|
||||
|
||||
closedVolume = adjustPhi(phiHbyA, U, p);
|
||||
@ -51,13 +46,15 @@
|
||||
);
|
||||
}
|
||||
|
||||
tpEqn().setReference(pRefCell, pRefValue);
|
||||
fvScalarMatrix& pEqn = tpEqn.ref();
|
||||
|
||||
tpEqn().solve();
|
||||
pEqn.setReference(pRefCell, pRefValue);
|
||||
|
||||
pEqn.solve();
|
||||
|
||||
if (simple.finalNonOrthogonalIter())
|
||||
{
|
||||
phi = phiHbyA - tpEqn().flux();
|
||||
phi = phiHbyA - pEqn.flux();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,16 +2,13 @@ rho = thermo.rho();
|
||||
|
||||
volScalarField rAU(1.0/UEqn.A());
|
||||
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||
|
||||
volVectorField HbyA("HbyA", U);
|
||||
HbyA = rAU*UEqn.H();
|
||||
|
||||
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
|
||||
surfaceScalarField phid
|
||||
(
|
||||
"phid",
|
||||
fvc::interpolate(psi)
|
||||
*(
|
||||
(mesh.Sf() & fvc::interpolate(HbyA))
|
||||
fvc::flux(HbyA)
|
||||
+ rhorAUf*fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho)
|
||||
)
|
||||
);
|
||||
|
||||
@ -2,16 +2,13 @@ rho = thermo.rho();
|
||||
|
||||
volScalarField rAU(1.0/UEqn.A());
|
||||
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||
|
||||
volVectorField HbyA("HbyA", U);
|
||||
HbyA = rAU*UEqn.H();
|
||||
|
||||
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
|
||||
surfaceScalarField phid
|
||||
(
|
||||
"phid",
|
||||
fvc::interpolate(psi)
|
||||
*(
|
||||
(mesh.Sf() & fvc::interpolate(HbyA))
|
||||
fvc::flux(HbyA)
|
||||
+ rhorAUf*fvc::ddtCorr(rho, U, rhoUf)/fvc::interpolate(rho)
|
||||
)
|
||||
);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -92,7 +92,7 @@ int main(int argc, char *argv[])
|
||||
"phid",
|
||||
psi
|
||||
*(
|
||||
(fvc::interpolate(U) & mesh.Sf())
|
||||
fvc::flux(U)
|
||||
+ rhorAUf*fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho)
|
||||
)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user