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

This commit is contained in:
mattijs
2013-01-22 09:50:35 +00:00
128 changed files with 5548 additions and 2165 deletions

View File

@ -185,12 +185,10 @@ void Foam::smoluchowskiJumpTFvPatchScalarField::updateCoeffs()
dimensionedScalar Pr
(
dimensionedScalar::lookupOrDefault
(
"Pr",
thermophysicalProperties,
1.0
)
"Pr",
dimless,
thermophysicalProperties.subDict("mixture").subDict("transport")
.lookup("Pr")
);
Field<scalar> C2

View File

@ -1,23 +0,0 @@
Info<< "Reading thermophysicalProperties\n" << endl;
// Pr defined as a separate constant to enable calculation of k, currently
// inaccessible through thermo
IOdictionary thermophysicalProperties
(
IOobject
(
"thermophysicalProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
)
);
dimensionedScalar Pr
(
"Pr",
dimless,
thermophysicalProperties.subDict("mixture").subDict("transport")
.lookup("Pr")
);

View File

@ -46,7 +46,6 @@ int main(int argc, char *argv[])
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
#include "readThermophysicalProperties.H"
#include "readTimeControls.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -236,13 +235,10 @@ int main(int argc, char *argv[])
if (!inviscid)
{
volScalarField k("k", thermo.Cp()*muEff/Pr);
solve
(
fvm::ddt(rho, e) - fvc::ddt(rho, e)
- fvm::laplacian(turbulence->alphaEff(), e)
+ fvc::laplacian(turbulence->alpha(), e)
- fvc::laplacian(k, T)
);
thermo.correct();
rhoE = rho*(e + 0.5*magSqr(U));

View File

@ -45,7 +45,6 @@ int main(int argc, char *argv[])
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
#include "readThermophysicalProperties.H"
#include "readTimeControls.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -7,7 +7,7 @@ volScalarField rAU(1.0/UEqn().A());
volScalarField rAtU(1.0/(1.0/rAU - UEqn().H1()));
volVectorField HbyA("HbyA", U);
HbyA = rAU*(UEqn() == fvOptions(rho, U))().H();
HbyA = rAU*UEqn().H();
if (pimple.nCorrPIMPLE() <= 1)
{

View File

@ -4,12 +4,12 @@
(
fvm::div(phi, U)
+ turbulence->divDevRhoReff(U)
==
fvOptions(rho, U)
);
UEqn().relax();
mrfZones.addCoriolis(rho, UEqn());
// Include the porous media resistance and solve the momentum equation
// either implicit in the tensorial resistance or transport using by
// including the spherical part of the resistance in the momentum diagonal
@ -30,7 +30,7 @@
for (int UCorr=0; UCorr<nUCorr; UCorr++)
{
U = trTU() & ((UEqn() == fvOptions(rho, U))().H() - gradp);
U = trTU() & (UEqn().H() - gradp);
}
U.correctBoundaryConditions();
@ -42,7 +42,7 @@
fvOptions.constrain(UEqn());
solve(UEqn() == -fvc::grad(p) + fvOptions(rho, U));
solve(UEqn() == -fvc::grad(p));
fvOptions.correct(U);

View File

@ -1,6 +1,3 @@
IOMRFZoneList mrfZones(mesh);
mrfZones.correctBoundaryVelocity(U);
IOporosityModelList pZones(mesh);
Switch pressureImplicitPorosity(false);

View File

@ -10,11 +10,11 @@
if (pressureImplicitPorosity)
{
HbyA = trTU() & (UEqn() == fvOptions(rho, U))().H();
HbyA = trTU() & UEqn().H();
}
else
{
HbyA = trAU()*(UEqn() == fvOptions(rho, U))().H();
HbyA = trAU()*UEqn().H();
}
UEqn.clear();
@ -27,7 +27,7 @@
fvc::interpolate(rho*HbyA) & mesh.Sf()
);
mrfZones.relativeFlux(fvc::interpolate(rho), phiHbyA);
fvOptions.relativeFlux(fvc::interpolate(rho), phiHbyA);
closedVolume = adjustPhi(phiHbyA, U, p);

View File

@ -27,14 +27,13 @@ Application
Description
Steady-state solver for turbulent flow of compressible fluids with
RANS turbulence modelling, implicit or explicit porosity treatment
and MRF for HVAC and similar applications.
and run-time selectable finite volume sources.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "rhoThermo.H"
#include "RASModel.H"
#include "IOMRFZoneList.H"
#include "fvIOoptionList.H"
#include "IOporosityModelList.H"
#include "simpleControl.H"

View File

@ -7,7 +7,7 @@ volScalarField rAU(1.0/UEqn().A());
volScalarField rAtU(1.0/(1.0/rAU - UEqn().H1()));
volVectorField HbyA("HbyA", U);
HbyA = rAU*(UEqn() == fvOptions(rho, U))().H();
HbyA = rAU*UEqn().H();
UEqn.clear();

View File

@ -5,12 +5,14 @@
+ fvm::div(phi, Urel)
+ turbulence->divDevReff(Urel)
+ SRF->Su()
==
fvOptions(Urel)
);
UrelEqn().relax();
fvOptions.constrain(UrelEqn());
solve(UrelEqn() == -fvc::grad(p) + fvOptions(Urel));
solve(UrelEqn() == -fvc::grad(p));
fvOptions.correct(Urel);

View File

@ -1,6 +1,6 @@
volScalarField rAUrel(1.0/UrelEqn().A());
volVectorField HbyA("HbyA", Urel);
HbyA = rAUrel*(UrelEqn() == fvOptions(Urel))().H();
HbyA = rAUrel*UrelEqn().H();
if (pimple.nCorrPISO() <= 1)
{

View File

@ -5,6 +5,8 @@ tmp<fvVectorMatrix> UEqn
fvm::ddt(U)
+ fvm::div(phi, U)
+ turbulence->divDevReff(U)
==
fvOptions(U)
);
UEqn().relax();

View File

@ -1,5 +1,5 @@
volVectorField HbyA("HbyA", U);
HbyA = rAU*(UEqn() == fvOptions(U))().H();
HbyA = rAU*UEqn().H();
if (pimple.nCorrPISO() <= 1)
{

View File

@ -3,6 +3,8 @@ tmp<fvVectorMatrix> UEqn
fvm::ddt(U)
+ fvm::div(phi, U)
+ turbulence->divDevReff(U)
==
fvOptions(U)
);
@ -12,7 +14,7 @@ fvOptions.constrain(UEqn());
if (pimple.momentumPredictor())
{
solve(UEqn() == -fvc::grad(p_gh) + fvOptions(U));
solve(UEqn() == -fvc::grad(p_gh));
fvOptions.correct(U);
}

View File

@ -2,7 +2,7 @@ volScalarField rAU(1.0/UEqn().A());
surfaceScalarField rAUf("Dp", fvc::interpolate(rAU));
volVectorField HbyA("HbyA", U);
HbyA = rAU*(UEqn() == fvOptions(U))().H();
HbyA = rAU*UEqn().H();
if (pimple.nCorrPISO() <= 1)
{
@ -18,6 +18,7 @@ surfaceScalarField phiHbyA
adjustPhi(phiHbyA, U, p_gh);
fvOptions.relativeFlux(phiHbyA);
// Non-orthogonal pressure corrector loop
while (pimple.correctNonOrthogonal())

View File

@ -36,7 +36,6 @@ Description
#include "basicReactingMultiphaseCloud.H"
#include "rhoCombustionModel.H"
#include "radiationModel.H"
#include "IOporosityModelList.H"
#include "fvIOoptionList.H"
#include "SLGThermo.H"
#include "pimpleControl.H"

View File

@ -14,14 +14,22 @@
volScalarField& he1 = thermo1.he();
volScalarField& he2 = thermo2.he();
volScalarField Cpv1(thermo1.Cpv());
volScalarField Cpv2(thermo2.Cpv());
fvScalarMatrix he1Eqn
(
fvm::ddt(alpha1, he1)
+ fvm::div(alphaPhi1, he1)
// Compressibity correction
- fvm::Sp(fvc::ddt(alpha1) + fvc::div(alphaPhi1), he1)
- fvm::laplacian(k1, he1)
==
heatTransferCoeff*(thermo1.he(p, thermo2.T())/thermo1.Cp())/rho1
- fvm::Sp(heatTransferCoeff/thermo1.Cp()/rho1, he1)
heatTransferCoeff*(thermo2.T() - thermo1.T())/rho1
+ heatTransferCoeff*he1/Cpv1/rho1
- fvm::Sp(heatTransferCoeff/Cpv1/rho1, he1)
+ alpha1*(dpdt/rho1 - (fvc::ddt(K1) + fvc::div(phi1, K1)))
);
@ -29,10 +37,15 @@
(
fvm::ddt(alpha2, he2)
+ fvm::div(alphaPhi2, he2)
// Compressibity correction
- fvm::Sp(fvc::ddt(alpha2) + fvc::div(alphaPhi2), he2)
- fvm::laplacian(k2, he2)
==
heatTransferCoeff*(thermo2.he(p, thermo1.T())/thermo2.Cp())/rho2
- fvm::Sp(heatTransferCoeff/thermo2.Cp()/rho2, he2)
heatTransferCoeff*(thermo1.T() - thermo2.T())/rho2
+ heatTransferCoeff*he2/Cpv2/rho2
- fvm::Sp(heatTransferCoeff/Cpv2/rho2, he2)
+ alpha2*(dpdt/rho2 - (fvc::ddt(K2) + fvc::div(phi2, K2)))
);

View File

@ -31,6 +31,9 @@ fvVectorMatrix U2Eqn(U2, U2.dimensions()*dimVol/dimTime);
fvm::ddt(alpha1, U1)
+ fvm::div(alphaPhi1, U1)
// Compressibity correction
- fvm::Sp(fvc::ddt(alpha1) + fvc::div(alphaPhi1), U1)
+ Cvm*rho2*alpha1*alpha2/rho1*
(
fvm::ddt(U1)
@ -61,6 +64,9 @@ fvVectorMatrix U2Eqn(U2, U2.dimensions()*dimVol/dimTime);
fvm::ddt(alpha2, U2)
+ fvm::div(alphaPhi2, U2)
// Compressibity correction
- fvm::Sp(fvc::ddt(alpha2) + fvc::div(alphaPhi2), U2)
+ Cvm*rho2*alpha1*alpha2/rho2*
(
fvm::ddt(U2)

View File

@ -2,8 +2,8 @@ surfaceScalarField alphaPhi1("alphaPhi" + phase1Name, phi1);
surfaceScalarField alphaPhi2("alphaPhi" + phase2Name, phi2);
{
word alphaScheme("div(phi,alpha)");
word alpharScheme("div(phir,alpha)");
word alphaScheme("div(phi," + alpha1.name() + ')');
word alpharScheme("div(phir," + alpha1.name() + ')');
surfaceScalarField phic("phic", phi);
surfaceScalarField phir("phir", phi1 - phi2);

View File

@ -16,6 +16,10 @@ if (turbulence)
(
fvm::ddt(alpha2, epsilon)
+ fvm::div(alphaPhi2, epsilon)
// Compressibity correction
- fvm::Sp(fvc::ddt(alpha2) + fvc::div(alphaPhi2), epsilon)
- fvm::laplacian
(
alpha1Eps*nuEff2, epsilon,
@ -41,6 +45,10 @@ if (turbulence)
(
fvm::ddt(alpha2, k)
+ fvm::div(alphaPhi2, k)
// Compressibity correction
- fvm::Sp(fvc::ddt(alpha2) + fvc::div(alphaPhi2), k)
- fvm::laplacian
(
alpha1k*nuEff2, k,

View File

@ -1,4 +1,4 @@
EXE_INC = \
EXE_INC = -g \
-IphaseModel/lnInclude \
-ImultiphaseSystem/lnInclude \
-ImultiphaseFixedFluxPressure \

View File

@ -32,9 +32,10 @@ forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter)
"div(Rc)"
)
==
- fvm::Sp(fluid.dragCoeff(phase, dragCoeffs())/phase.rho(), U)
//- fvm::Sp(fluid.dragCoeff(phase, dragCoeffs())/phase.rho(), U)
//- (alpha*phase.rho())*fluid.lift(phase)
+ (alpha/phase.rho())*fluid.Svm(phase)
//+
(alpha/phase.rho())*fluid.Svm(phase)
- fvm::Sp
(
slamDampCoeff
@ -53,7 +54,7 @@ forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter)
alpha*(1 + (1/phase.rho())*fluid.Cvm(phase)),
UEqns[phasei]
);
UEqns[phasei].relax();
//UEqns[phasei].relax();
phasei++;
}

View File

@ -67,8 +67,29 @@
const volScalarField& alpha = phase;
alphafs.set(phasei, fvc::interpolate(alpha).ptr());
rAUs.set(phasei, (1.0/UEqns[phasei].A()).ptr());
rAlphaAUfs.set(phasei, fvc::interpolate(alpha*rAUs[phasei]).ptr());
volScalarField dragCoeffi
(
IOobject
(
"dragCoeffi",
runTime.timeName(),
mesh
),
fluid.dragCoeff(phase, dragCoeffs())/phase.rho(),
zeroGradientFvPatchScalarField::typeName
);
dragCoeffi.correctBoundaryConditions();
rAUs.set(phasei, (1.0/(UEqns[phasei].A() + dragCoeffi)).ptr());
rAlphaAUfs.set
(
phasei,
(
alphafs[phasei]
/fvc::interpolate(UEqns[phasei].A() + dragCoeffi)
).ptr()
);
HbyAs[phasei] = rAUs[phasei]*UEqns[phasei].H();
@ -115,10 +136,9 @@
}
phiHbyAs[phasei] +=
fvc::interpolate
(
(1.0/phase.rho())*rAUs[phasei]*(*dcIter())
)*phase2Ptr->phi();
fvc::interpolate((*dcIter())/phase.rho())
/fvc::interpolate(UEqns[phasei].A() + dragCoeffi)
*phase2Ptr->phi();
HbyAs[phasei] +=
(1.0/phase.rho())*rAUs[phasei]*(*dcIter())
@ -240,7 +260,7 @@
+ rAlphaAUfs[phasei]*mSfGradp/phase.rho()
);
// phase.U() = fvc::reconstruct(phase.phi());
//phase.U() = fvc::reconstruct(phase.phi());
phase.U().correctBoundaryConditions();
U += alpha*phase.U();

View File

@ -14,6 +14,11 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// If on, after collapsing check the quality of the mesh. If bad faces are
// generated then redo the collapsing with stricter filtering.
controlMeshQuality on;
collapseEdgesCoeffs
{
// Edges shorter than this absolute value will be merged
@ -22,21 +27,13 @@ collapseEdgesCoeffs
// The maximum angle between two edges that share a point attached to
// no other edges
maximumMergeAngle 30;
// The amount that minimumEdgeLength will be reduced by for each
// edge if that edge's collapse generates a poor quality face
reductionFactor 0.5;
}
collapseFacesCoeffs
{
// The initial face length factor
initialFaceLengthFactor 0.5;
// The amount that initialFaceLengthFactor will be reduced by for each
// face if its collapse generates a poor quality face
reductionFactor $initialFaceLengthFactor;
initialFaceLengthFactor 0.5;
// If the face can't be collapsed to an edge, and it has a span less than
// the target face length multiplied by this coefficient, collapse it
@ -63,12 +60,20 @@ collapseFacesCoeffs
}
meshQualityCoeffs
controlMeshQualityCoeffs
{
// Name of the dictionary that has the mesh quality coefficients used
// by motionSmoother::checkMesh
#include "meshQualityDict";
// The amount that minimumEdgeLength will be reduced by for each
// edge if that edge's collapse generates a poor quality face
edgeReductionFactor 0.5;
// The amount that initialFaceLengthFactor will be reduced by for each
// face if its collapse generates a poor quality face
faceReductionFactor $initialFaceLengthFactor;
// Maximum number of smoothing iterations for the reductionFactors
maximumSmoothingIterations 2;

View File

@ -2,24 +2,16 @@
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: http://www.openfoam.org |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "";
local "";
class dictionary;
object meshQualityDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- Maximum non-orthogonality allowed. Set to 180 to disable.