multiphaseEulerFoam: Completed support for surface tension

This commit is contained in:
Henry
2012-06-22 11:55:10 +01:00
parent 35d545d08f
commit 93355167ec
3 changed files with 39 additions and 60 deletions

View File

@ -58,8 +58,6 @@ void Foam::multiphaseSystem::calcAlphas()
void Foam::multiphaseSystem::solveAlphas()
{
surfaceScalarField phic(mag(phi_/mesh_.magSf()));
PtrList<surfaceScalarField> phiAlphaCorrs(phases_.size());
int phasei = 0;
@ -94,6 +92,11 @@ void Foam::multiphaseSystem::solveAlphas()
if (&phase2 == &phase1) continue;
surfaceScalarField phic
(
(mag(phi_) + mag(phase1.phi() - phase2.phi()))/mesh_.magSf()
);
surfaceScalarField phir
(
(phase1.phi() - phase2.phi())
@ -186,32 +189,6 @@ void Foam::multiphaseSystem::solveAlphas()
}
Foam::dimensionedScalar Foam::multiphaseSystem::sigma
(
const phaseModel& phase1,
const phaseModel& phase2
) const
{
scalarCoeffTable::const_iterator sigma
(
sigmas_.find(interfacePair(phase1, phase2))
);
if (sigma == sigmas_.end())
{
FatalErrorIn
(
"multiphaseSystem::sigma(const phaseModel& phase1,"
"const phaseModel& phase2) const"
) << "Cannot find interface " << interfacePair(phase1, phase2)
<< " in list of sigma values"
<< exit(FatalError);
}
return dimensionedScalar("sigma", dimSigma_, sigma());
}
Foam::scalar Foam::multiphaseSystem::cAlpha
(
const phaseModel& phase1,
@ -263,10 +240,10 @@ Foam::dimensionedScalar Foam::multiphaseSystem::Cvm
FatalErrorIn
(
"multiphaseSystem::sigma"
"multiphaseSystem::Cvm"
"(const phaseModel& phase1, const phaseModel& phase2) const"
) << "Cannot find interface " << interfacePair(phase1, phase2)
<< " in list of sigma values"
<< " in list of Cvm values"
<< exit(FatalError);
return Cvm()*phase2.rho();
@ -729,52 +706,56 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseSystem::dragCoeff
}
Foam::tmp<Foam::surfaceScalarField>
Foam::multiphaseSystem::surfaceTensionForce() const
Foam::tmp<Foam::surfaceScalarField> Foam::multiphaseSystem::surfaceTension
(
const phaseModel& phase1
) const
{
tmp<surfaceScalarField> tstf
tmp<surfaceScalarField> tSurfaceTension
(
new surfaceScalarField
(
IOobject
(
"surfaceTensionForce",
"surfaceTension",
mesh_.time().timeName(),
mesh_
),
mesh_,
dimensionedScalar
(
"surfaceTensionForce",
"surfaceTension",
dimensionSet(1, -2, -2, 0, 0),
0.0
0
)
)
);
surfaceScalarField& stf = tstf();
forAllConstIter(PtrDictionary<phaseModel>, phases_, iter1)
forAllConstIter(PtrDictionary<phaseModel>, phases_, iter)
{
const phaseModel& phase1 = iter1();
const phaseModel& phase2 = iter();
PtrDictionary<phaseModel>::const_iterator iter2 = iter1;
++iter2;
for (; iter2 != phases_.end(); ++iter2)
if (&phase2 != &phase1)
{
const phaseModel& phase2 = iter2();
scalarCoeffTable::const_iterator sigma
(
sigmas_.find(interfacePair(phase1, phase2))
);
stf += sigma(phase1, phase2)
*fvc::interpolate(K(phase1, phase2))*
(
fvc::interpolate(phase2)*fvc::snGrad(phase1)
- fvc::interpolate(phase1)*fvc::snGrad(phase2)
);
if (sigma != sigmas_.end())
{
tSurfaceTension() +=
dimensionedScalar("sigma", dimSigma_, sigma())
*fvc::interpolate(K(phase1, phase2))*
(
fvc::interpolate(phase2)*fvc::snGrad(phase1)
- fvc::interpolate(phase1)*fvc::snGrad(phase2)
);
}
}
}
return tstf;
return tSurfaceTension;
}