Commit 542301e6 authored by andy's avatar andy
Browse files

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

parents 972ae916 8a991fea
......@@ -58,6 +58,9 @@ int main(int argc, char *argv[])
#include "CourantNo.H"
#include "setInitialDeltaT.H"
surfaceScalarField phiAbs("phiAbs", phi);
fvc::makeAbsolute(phiAbs, U);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
......@@ -67,9 +70,6 @@ int main(int argc, char *argv[])
#include "alphaCourantNo.H"
#include "CourantNo.H"
// Make the fluxes absolute
fvc::makeAbsolute(phi, U);
#include "setDeltaT.H"
runTime++;
......@@ -78,8 +78,18 @@ int main(int argc, char *argv[])
scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();
// Do any mesh changes
mesh.update();
{
// Calculate the relative velocity used to map the relative flux phi
volVectorField Urel("Urel", U);
if (mesh.moving())
{
Urel -= fvc::reconstruct(fvc::meshPhi(U));
}
// Do any mesh changes
mesh.update();
}
if (mesh.changing())
{
......@@ -96,9 +106,6 @@ int main(int argc, char *argv[])
#include "correctPhi.H"
}
// Make the fluxes relative to the mesh motion
fvc::makeRelative(phi, U);
if (mesh.changing() && checkMeshCourantNo)
{
#include "meshCourantNo.H"
......
......@@ -3,16 +3,19 @@
surfaceScalarField rAUf(fvc::interpolate(rAU));
U = rAU*UEqn.H();
surfaceScalarField phiU("phiU", (fvc::interpolate(U) & mesh.Sf()));
phiAbs =
(fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, rho, U, phiAbs);
if (p_rgh.needReference())
{
fvc::makeRelative(phiU, U);
adjustPhi(phiU, U, p_rgh);
fvc::makeAbsolute(phiU, U);
fvc::makeRelative(phiAbs, U);
adjustPhi(phiAbs, U, p_rgh);
fvc::makeAbsolute(phiAbs, U);
}
phi = phiU +
phi = phiAbs +
(
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
- ghf*fvc::snGrad(rho)
......@@ -38,11 +41,13 @@
}
}
U += rAU*fvc::reconstruct((phi - phiU)/rAUf);
U += rAU*fvc::reconstruct((phi - phiAbs)/rAUf);
U.correctBoundaryConditions();
#include "continuityErrs.H"
phiAbs = phi;
// Make the fluxes relative to the mesh motion
fvc::makeRelative(phi, U);
......
......@@ -40,7 +40,7 @@ Foam::Field<Type> Foam::interpolateSplineXY
forAll(xNew, i)
{
yNew[i] = interpolateSmoothXY(xNew[i], xOld, yOld);
yNew[i] = interpolateSplineXY(xNew[i], xOld, yOld);
}
return yNew;
......
......@@ -107,7 +107,7 @@ bool Foam::adjustPhi
{
massCorr = (massIn - fixedMassOut)/adjustableMassOut;
}
else if (mag(fixedMassOut - massIn)/totalFlux > 1e-10)
else if (mag(fixedMassOut - massIn)/totalFlux > 1e-8)
{
FatalErrorIn
(
......
......@@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "nuSgsUSpaldingWallFunctionFvPatchScalarField.H"
#include "LESModel.H"
#include "fvPatchFieldMapper.H"
#include "volFields.H"
#include "addToRunTimeSelectionTable.H"
......@@ -47,8 +48,6 @@ nuSgsUSpaldingWallFunctionFvPatchScalarField
)
:
fixedValueFvPatchScalarField(p, iF),
UName_("U"),
nuName_("nu"),
kappa_(0.41),
E_(9.8)
{}
......@@ -64,8 +63,6 @@ nuSgsUSpaldingWallFunctionFvPatchScalarField
)
:
fixedValueFvPatchScalarField(ptf, p, iF, mapper),
UName_(ptf.UName_),
nuName_(ptf.nuName_),
kappa_(ptf.kappa_),
E_(ptf.E_)
{}
......@@ -80,8 +77,6 @@ nuSgsUSpaldingWallFunctionFvPatchScalarField
)
:
fixedValueFvPatchScalarField(p, iF, dict),
UName_(dict.lookupOrDefault<word>("U", "U")),
nuName_(dict.lookupOrDefault<word>("nu", "nu")),
kappa_(dict.lookupOrDefault<scalar>("kappa", 0.41)),
E_(dict.lookupOrDefault<scalar>("E", 9.8))
{}
......@@ -94,8 +89,6 @@ nuSgsUSpaldingWallFunctionFvPatchScalarField
)
:
fixedValueFvPatchScalarField(nwfpsf),
UName_(nwfpsf.UName_),
nuName_(nwfpsf.nuName_),
kappa_(nwfpsf.kappa_),
E_(nwfpsf.E_)
{}
......@@ -109,8 +102,6 @@ nuSgsUSpaldingWallFunctionFvPatchScalarField
)
:
fixedValueFvPatchScalarField(nwfpsf, iF),
UName_(nwfpsf.UName_),
nuName_(nwfpsf.nuName_),
kappa_(nwfpsf.kappa_),
E_(nwfpsf.E_)
{}
......@@ -123,16 +114,15 @@ void nuSgsUSpaldingWallFunctionFvPatchScalarField::evaluate
const Pstream::commsTypes
)
{
const scalarField& ry = patch().deltaCoeffs();
const LESModel& lesModel = db().lookupObject<LESModel>("LESProperties");
const label patchi = patch().index();
const fvPatchVectorField& U = lesModel.U().boundaryField()[patchi];
const scalarField nuw = lesModel.nu()().boundaryField()[patchi];
const fvPatchVectorField& U =
patch().lookupPatchField<volVectorField, vector>(UName_);
const scalarField& ry = patch().deltaCoeffs();
const scalarField magUp(mag(U.patchInternalField() - U));
const scalarField& nuw =
patch().lookupPatchField<volScalarField, scalar>(nuName_);
scalarField& nuSgsw = *this;
const scalarField magFaceGradU(mag(U.snGrad()));
......@@ -185,8 +175,6 @@ void nuSgsUSpaldingWallFunctionFvPatchScalarField::evaluate
void nuSgsUSpaldingWallFunctionFvPatchScalarField::write(Ostream& os) const
{
fvPatchField<scalar>::write(os);
writeEntryIfDifferent<word>(os, "U", "U", UName_);
writeEntryIfDifferent<word>(os, "nu", "nu", nuName_);
os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl;
os.writeKeyword("E") << E_ << token::END_STATEMENT << nl;
writeEntry("value", os);
......@@ -201,6 +189,7 @@ makePatchTypeField
nuSgsUSpaldingWallFunctionFvPatchScalarField
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace LESModels
......
......@@ -58,12 +58,6 @@ class nuSgsUSpaldingWallFunctionFvPatchScalarField
{
// Private data
//- Name of velocity field
word UName_;
//- Name of laminar viscosity field
word nuName_;
//- Von Karman constant
scalar kappa_;
......
......@@ -39,7 +39,9 @@ dynamicRefineFvMeshCoeffs
// on surfaceScalarFields that do not need to be reinterpolated.
correctFluxes
(
(phi U)
(phi Urel)
(phiAbs U)
(phiAbs_0 U_0)
(nHatf none)
(rho*phi none)
(ghf none)
......
Supports Markdown
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