Skip to content
Snippets Groups Projects
Commit 1dee446a authored by mattijs's avatar mattijs
Browse files

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

parents 4faf9f4d fc6049ab
Branches
Tags
No related merge requests found
Showing
with 64 additions and 51 deletions
......@@ -14,4 +14,5 @@ volScalarField rAU(1.0/UEqn().A());
if (pimple.momentumPredictor())
{
solve(UEqn() == -fvc::grad(p));
K = 0.5*magSqr(U);
}
......@@ -54,8 +54,8 @@
)
);
Info<< "Creating field DpDt\n" << endl;
volScalarField DpDt
(
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p)
);
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt("dpdt", fvc::ddt(p));
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));
......@@ -5,7 +5,8 @@
+ fvm::div(phi, h)
- fvm::laplacian(turbulence->alphaEff(), h)
==
DpDt
dpdt
- (fvc::ddt(rho, K) + fvc::div(phi, K))
);
hEqn.relax();
......
......@@ -83,5 +83,6 @@ Info<< "rho max/min : " << max(rho).value()
U -= rAU*fvc::grad(p);
U.correctBoundaryConditions();
K = 0.5*magSqr(U);
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
dpdt = fvc::ddt(p);
......@@ -85,5 +85,6 @@ Info<< "rho max/min : " << max(rho).value()
U -= rAU*fvc::grad(p);
U.correctBoundaryConditions();
K = 0.5*magSqr(U);
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
dpdt = fvc::ddt(p);
......@@ -5,8 +5,7 @@
- fvm::Sp(fvc::div(phi), h)
- fvm::laplacian(turbulence->alphaEff(), h)
==
fvc::div(phi/fvc::interpolate(rho), rho/psi, "div(U,p)")
- (rho/psi)*fvc::div(phi/fvc::interpolate(rho))
- fvc::div(phi, 0.5*magSqr(U), "div(phi,K)")
);
pZones.addEnthalpySource(thermo, rho, hEqn);
......
......@@ -4,7 +4,7 @@
fvm::ddt(rho, e)
+ fvm::div(phi, e)
- fvm::laplacian(turbulence->alphaEff(), e)
==
==
- p*fvc::div(phi/fvc::interpolate(rho))
);
......
......@@ -23,4 +23,5 @@
)*mesh.magSf()
)
);
K = 0.5*magSqr(U);
}
......@@ -74,9 +74,8 @@
// Force p_rgh to be consistent with p
p_rgh = p - rho*gh;
Info<< "Creating field DpDt\n" << endl;
volScalarField DpDt
(
"DpDt",
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p)
);
Info<< "Creating field dpdt\n" << endl;
volScalarField dpdt("dpdt", fvc::ddt(p));
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));
......@@ -5,7 +5,8 @@
+ fvm::div(phi, h)
- fvm::laplacian(turbulence->alphaEff(), h)
==
DpDt
dpdt
- (fvc::ddt(rho, K) + fvc::div(phi, K))
);
hEqn.relax();
......
......@@ -47,6 +47,7 @@
// calculated from the relaxed pressure
U += rAU*fvc::reconstruct((buoyancyPhi + p_rghEqn.flux())/rhorAUf);
U.correctBoundaryConditions();
K = 0.5*magSqr(U);
}
}
......@@ -55,7 +56,7 @@
// Second part of thermodynamic density update
thermo.rho() += psi*p_rgh;
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
dpdt = fvc::ddt(p);
#include "rhoEqn.H"
#include "compressibleContinuityErrs.H"
......
// Initialise fluid field pointer lists
PtrList<basicRhoThermo> thermoFluid(fluidRegions.size());
PtrList<volScalarField> rhoFluid(fluidRegions.size());
PtrList<volScalarField> KFluid(fluidRegions.size());
PtrList<volScalarField> kappaFluid(fluidRegions.size());
PtrList<volVectorField> UFluid(fluidRegions.size());
PtrList<surfaceScalarField> phiFluid(fluidRegions.size());
PtrList<uniformDimensionedVectorField> gFluid(fluidRegions.size());
......@@ -50,15 +50,15 @@
)
);
Info<< " Adding to KFluid\n" << endl;
KFluid.set
Info<< " Adding to kappaFluid\n" << endl;
kappaFluid.set
(
i,
new volScalarField
(
IOobject
(
"K",
"kappa",
runTime.timeName(),
fluidRegions[i],
IOobject::NO_READ,
......
......@@ -71,5 +71,5 @@
<< max(rho).value() << endl;
// Update thermal conductivity
K = thermo.Cp()*turb.alphaEff();
kappa = thermo.Cp()*turb.alphaEff();
}
......@@ -2,7 +2,7 @@
basicRhoThermo& thermo = thermoFluid[i];
volScalarField& rho = rhoFluid[i];
volScalarField& K = KFluid[i];
volScalarField& kappa = kappaFluid[i];
volVectorField& U = UFluid[i];
surfaceScalarField& phi = phiFluid[i];
......
......@@ -7,8 +7,8 @@
tmp<volScalarField> tcp = thermo.Cp();
const volScalarField& cp = tcp();
tmp<volScalarField> tK = thermo.K();
//tmp<volSymmTensorField> tK = thermo.directionalK();
const volScalarField& K = tK();
tmp<volScalarField> tkappa = thermo.K();
//tmp<volSymmTensorField> tkappa = thermo.directionalkappa();
const volScalarField& kappa = tkappa();
volScalarField& T = thermo.T();
......@@ -3,7 +3,7 @@
{
fvScalarMatrix tEqn
(
-fvm::laplacian(K, T)
-fvm::laplacian(kappa, T)
);
tEqn.relax();
tEqn.solve();
......
......@@ -22,5 +22,6 @@
)*mesh.magSf()
),
mesh.solver(U.select(finalIter))
);
);
K = 0.5*magSqr(U);
}
// Initialise fluid field pointer lists
PtrList<basicRhoThermo> thermoFluid(fluidRegions.size());
PtrList<volScalarField> rhoFluid(fluidRegions.size());
PtrList<volScalarField> KFluid(fluidRegions.size());
PtrList<volScalarField> kappaFluid(fluidRegions.size());
PtrList<volVectorField> UFluid(fluidRegions.size());
PtrList<surfaceScalarField> phiFluid(fluidRegions.size());
PtrList<uniformDimensionedVectorField> gFluid(fluidRegions.size());
......@@ -10,7 +10,8 @@
PtrList<volScalarField> ghFluid(fluidRegions.size());
PtrList<surfaceScalarField> ghfFluid(fluidRegions.size());
PtrList<radiation::radiationModel> radiation(fluidRegions.size());
PtrList<volScalarField> DpDtFluid(fluidRegions.size());
PtrList<volScalarField> KFluid(fluidRegions.size());
PtrList<volScalarField> dpdtFluid(fluidRegions.size());
List<scalar> initialMassFluid(fluidRegions.size());
......@@ -45,15 +46,15 @@
)
);
Info<< " Adding to KFluid\n" << endl;
KFluid.set
Info<< " Adding to kappaFluid\n" << endl;
kappaFluid.set
(
i,
new volScalarField
(
IOobject
(
"K",
"kappa",
runTime.timeName(),
fluidRegions[i],
IOobject::NO_READ,
......@@ -175,22 +176,25 @@
initialMassFluid[i] = fvc::domainIntegrate(rhoFluid[i]).value();
Info<< " Adding to DpDtFluid\n" << endl;
DpDtFluid.set
Info<< " Adding to KFluid\n" << endl;
KFluid.set
(
i,
new volScalarField
(
"DpDt",
fvc::DDt
(
surfaceScalarField
(
"phiU",
phiFluid[i]/fvc::interpolate(rhoFluid[i])
),
thermoFluid[i].p()
)
"K",
0.5*magSqr(UFluid[i])
)
);
Info<< " Adding to dpdtFluid\n" << endl;
dpdtFluid.set
(
i,
new volScalarField
(
"dpdt",
fvc::ddt(thermoFluid[i].p())
)
);
}
......@@ -5,7 +5,8 @@
+ fvm::div(phi, h)
- fvm::laplacian(turb.alphaEff(), h)
==
DpDt
dpdt
- (fvc::ddt(rho, K) + fvc::div(phi, K))
+ rad.Sh(thermo)
);
......
......@@ -68,11 +68,13 @@
// Correct velocity field
U += rAU*fvc::reconstruct((phi - phiU)/rhorAUf);
U.correctBoundaryConditions();
K = 0.5*magSqr(U);
p = p_rgh + rho*gh;
// Update pressure substantive derivative
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
// Update pressure time derivative
dpdt = fvc::ddt(p);
// Solve continuity
#include "rhoEqn.H"
......@@ -91,5 +93,5 @@
}
// Update thermal conductivity
K = thermoFluid[i].Cp()*turb.alphaEff();
kappa = thermoFluid[i].Cp()*turb.alphaEff();
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment