New Courant number now implemented in most solvers

CHT solvers still to do
This commit is contained in:
Henry
2010-10-13 13:09:24 +01:00
parent f7d0cc587a
commit 5dc9b66ba3
14 changed files with 64 additions and 73 deletions

View File

@ -39,15 +39,14 @@ scalar meanAlphaCoNum = 0.0;
if (mesh.nInternalFaces())
{
surfaceScalarField SfUfbyDelta =
mixture.nearInterface()
*mesh.surfaceInterpolation::deltaCoeffs()*mag(phi);
scalarField sumPhi =
mixture.nearInterface()().internalField()
*fvc::surfaceSum(mag(phi))().internalField();
alphaCoNum = max(SfUfbyDelta/mesh.magSf())
.value()*runTime.deltaT().value();
alphaCoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
meanAlphaCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
.value()*runTime.deltaT().value();
meanAlphaCoNum =
0.5*(gSum(sumPhi)/gSum(mesh.V().field()))*runTime.deltaTValue();
}
Info<< "Interface Courant Number mean: " << meanAlphaCoNum

View File

@ -457,12 +457,12 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseMixture::K
}
Foam::tmp<Foam::surfaceScalarField>
Foam::tmp<Foam::volScalarField>
Foam::multiphaseMixture::nearInterface() const
{
tmp<surfaceScalarField> tnearInt
tmp<volScalarField> tnearInt
(
new surfaceScalarField
new volScalarField
(
IOobject
(
@ -477,8 +477,7 @@ Foam::multiphaseMixture::nearInterface() const
forAllConstIter(PtrDictionary<phase>, phases_, iter)
{
surfaceScalarField alphaf = fvc::interpolate(iter());
tnearInt() = max(tnearInt(), pos(alphaf - 0.01)*pos(0.99 - alphaf));
tnearInt() = max(tnearInt(), pos(iter() - 0.01)*pos(0.99 - iter()));
}
return tnearInt;

View File

@ -258,7 +258,7 @@ public:
//- Indicator of the proximity of the interface
// Field values are 1 near and 0 away for the interface.
tmp<surfaceScalarField> nearInterface() const;
tmp<volScalarField> nearInterface() const;
//- Solve for the mixture phase-fractions
void solve();