interFoam: Added isotropic compression option

This commit is contained in:
Henry
2013-11-29 16:55:18 +00:00
parent bb49d35619
commit 63da8af946
12 changed files with 76 additions and 39 deletions

View File

@ -2,14 +2,15 @@
word alphaScheme("div(phi,alpha)");
word alpharScheme("div(phirb,alpha)");
//surfaceScalarField phic(mag(phi/mesh.magSf()));
//phic = min(interface.cAlpha()*phic, max(phic));
surfaceScalarField phic
(
(0.5*interface.cAlpha())
*fvc::interpolate(volScalarField("tauc", fvc::surfaceSum(mag(phi))))
/mesh.magSf()
);
// Standard face-flux compression coefficient
surfaceScalarField phic(interface.cAlpha()*mag(phi/mesh.magSf()));
// Add the optional isotropic compression contribution
if (icAlpha > 0)
{
phic *= (1.0 - icAlpha);
phic += (interface.cAlpha()*icAlpha)*fvc::interpolate(mag(U));
}
// Do not compress interface at non-coupled boundary faces
// (inlets, outlets etc.)

View File

@ -71,6 +71,7 @@
(
geometricOneField(),
alpha1,
tphiAlpha(),
tphiAlphaCorr(),
vDotvmcAlphal,
(

View File

@ -18,3 +18,9 @@ bool alphaApplyPrevCorr
(
alphaControls.lookupOrDefault<Switch>("alphaApplyPrevCorr", false)
);
// Isotropic compression coefficient
scalar icAlpha
(
alphaControls.lookupOrDefault<scalar>("icAlpha", 0)
);

View File

@ -15,21 +15,26 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Umean 1;
dimensions [0 1 -1 0 0 0 0];
internalField uniform (1 0 0);
internalField uniform ($Umean 0 0);
boundaryField
{
inlet
{
type fixedValue;
value uniform (1 0 0);
value $internalField;
}
outlet
{
type zeroGradient;
type outletPhaseMeanVelocity;
alpha alpha.water;
Umean $Umean;
value $internalField;
}
sides
@ -40,6 +45,7 @@ boundaryField
atmosphere
{
type pressureInletOutletVelocity;
tangentialVelocity $internalField;
value uniform (0 0 0);
}

View File

@ -23,8 +23,8 @@ boundaryField
{
inlet
{
type calculated;
value uniform 0;
type fixedValue;
value $internalField;
}
outlet
@ -41,7 +41,7 @@ boundaryField
{
type inletOutlet;
inletValue uniform 0;
value uniform 0;
value $internalField;
}
hull_wall

View File

@ -24,7 +24,7 @@ boundaryField
inlet
{
type fixedValue;
value uniform 0.00015;
value $internalField;
}
outlet
@ -40,14 +40,14 @@ boundaryField
atmosphere
{
type inletOutlet;
inletValue uniform 0.00015;
value uniform 0.00015;
inletValue $internalField;
value $internalField;
}
hull_wall
{
type kqRWallFunction;
value uniform 0.00015;
value $internalField;
}
}

View File

@ -24,7 +24,7 @@ boundaryField
inlet
{
type fixedValue;
value uniform 5e-07;
value $internalField;
}
outlet
@ -45,7 +45,7 @@ boundaryField
hull_wall
{
type nutkWallFunction;
value uniform 0;
value $internalField;
}
}

View File

@ -23,14 +23,14 @@ boundaryField
inlet
{
type fixedValue;
value uniform 2;
value $internalField;
}
outlet
{
type inletOutlet;
inletValue uniform 2;
value uniform 2;
inletValue $internalField;
value $internalField;
}
outlet
@ -46,14 +46,14 @@ boundaryField
atmosphere
{
type inletOutlet;
inletValue uniform 2;
value uniform 2;
inletValue $internalField;
value $internalField;
}
hull_wall
{
type omegaWallFunction;
value uniform 2;
value $internalField;
}
}

View File

@ -23,7 +23,7 @@ boundaryField
inlet
{
type fixedFluxPressure;
value uniform 0;
value $internalField;
}
outlet
@ -45,13 +45,13 @@ boundaryField
rho rho;
psi none;
gamma 1;
value uniform 0;
value $internalField;
}
hull_wall
{
type fixedFluxPressure;
value uniform 0;
value $internalField;
}
}

View File

@ -23,7 +23,7 @@ startTime 0;
stopAt endTime;
endTime 2000;
endTime 1000;
deltaT 1;

View File

@ -17,11 +17,21 @@ FoamFile
solvers
{
alpha.water
"alpha.water.*"
{
nAlphaCorr 1;
nAlphaSubCycles 1;
cAlpha 1;
icAlpha 0.25;
MULESCorr yes;
nLimiterIter 8;
alphaApplyPrevCorr true;
solver smoothSolver;
smoother symGaussSeidel;
tolerance 1e-8;
relTol 0;
}
pcorr
@ -56,14 +66,14 @@ solvers
nCellsInCoarsestLevel 10;
cacheAgglomeration true;
tolerance 1e-6;
tolerance 1e-7;
relTol 0.01;
};
p_rghFinal
{
$p_rgh;
tolerance 1e-6;
tolerance 1e-7;
relTol 0;
}
@ -81,17 +91,18 @@ solvers
PIMPLE
{
momentumPredictor yes;
momentumPredictor no;
nCorrectors 1;
nNonOrthogonalCorrectors 0;
maxCo 0.9;
maxAlphaCo 0.2;
nAlphaSweepIter 1;
maxCo 5;
maxAlphaCo 5;
rDeltaTSmoothingCoeff 0.1;
rDeltaTDampingCoeff 1;
rDeltaTSmoothingCoeff 0.05;
rDeltaTDampingCoeff 0.5;
nAlphaSweepIter 0;
nAlphaSpreadIter 0;
maxDeltaT 1;
}
@ -102,6 +113,7 @@ relaxationFactors
}
equations
{
".*" 1;
}
}

View File

@ -30,6 +30,17 @@ regions
volScalarFieldValue alpha.water 1
);
}
// Set patch values (using ==)
boxToFace
{
box (-100 -100 -100) (100 100 0);
fieldValues
(
volScalarFieldValue alpha.water 1
);
}
);