mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
interFoam: Added isotropic compression option
This commit is contained in:
@ -2,14 +2,15 @@
|
|||||||
word alphaScheme("div(phi,alpha)");
|
word alphaScheme("div(phi,alpha)");
|
||||||
word alpharScheme("div(phirb,alpha)");
|
word alpharScheme("div(phirb,alpha)");
|
||||||
|
|
||||||
//surfaceScalarField phic(mag(phi/mesh.magSf()));
|
// Standard face-flux compression coefficient
|
||||||
//phic = min(interface.cAlpha()*phic, max(phic));
|
surfaceScalarField phic(interface.cAlpha()*mag(phi/mesh.magSf()));
|
||||||
surfaceScalarField phic
|
|
||||||
(
|
// Add the optional isotropic compression contribution
|
||||||
(0.5*interface.cAlpha())
|
if (icAlpha > 0)
|
||||||
*fvc::interpolate(volScalarField("tauc", fvc::surfaceSum(mag(phi))))
|
{
|
||||||
/mesh.magSf()
|
phic *= (1.0 - icAlpha);
|
||||||
);
|
phic += (interface.cAlpha()*icAlpha)*fvc::interpolate(mag(U));
|
||||||
|
}
|
||||||
|
|
||||||
// Do not compress interface at non-coupled boundary faces
|
// Do not compress interface at non-coupled boundary faces
|
||||||
// (inlets, outlets etc.)
|
// (inlets, outlets etc.)
|
||||||
|
|||||||
@ -71,6 +71,7 @@
|
|||||||
(
|
(
|
||||||
geometricOneField(),
|
geometricOneField(),
|
||||||
alpha1,
|
alpha1,
|
||||||
|
tphiAlpha(),
|
||||||
tphiAlphaCorr(),
|
tphiAlphaCorr(),
|
||||||
vDotvmcAlphal,
|
vDotvmcAlphal,
|
||||||
(
|
(
|
||||||
|
|||||||
@ -18,3 +18,9 @@ bool alphaApplyPrevCorr
|
|||||||
(
|
(
|
||||||
alphaControls.lookupOrDefault<Switch>("alphaApplyPrevCorr", false)
|
alphaControls.lookupOrDefault<Switch>("alphaApplyPrevCorr", false)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Isotropic compression coefficient
|
||||||
|
scalar icAlpha
|
||||||
|
(
|
||||||
|
alphaControls.lookupOrDefault<scalar>("icAlpha", 0)
|
||||||
|
);
|
||||||
|
|||||||
@ -15,21 +15,26 @@ FoamFile
|
|||||||
}
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Umean 1;
|
||||||
|
|
||||||
dimensions [0 1 -1 0 0 0 0];
|
dimensions [0 1 -1 0 0 0 0];
|
||||||
|
|
||||||
internalField uniform (1 0 0);
|
internalField uniform ($Umean 0 0);
|
||||||
|
|
||||||
boundaryField
|
boundaryField
|
||||||
{
|
{
|
||||||
inlet
|
inlet
|
||||||
{
|
{
|
||||||
type fixedValue;
|
type fixedValue;
|
||||||
value uniform (1 0 0);
|
value $internalField;
|
||||||
}
|
}
|
||||||
|
|
||||||
outlet
|
outlet
|
||||||
{
|
{
|
||||||
type zeroGradient;
|
type outletPhaseMeanVelocity;
|
||||||
|
alpha alpha.water;
|
||||||
|
Umean $Umean;
|
||||||
|
value $internalField;
|
||||||
}
|
}
|
||||||
|
|
||||||
sides
|
sides
|
||||||
@ -40,6 +45,7 @@ boundaryField
|
|||||||
atmosphere
|
atmosphere
|
||||||
{
|
{
|
||||||
type pressureInletOutletVelocity;
|
type pressureInletOutletVelocity;
|
||||||
|
tangentialVelocity $internalField;
|
||||||
value uniform (0 0 0);
|
value uniform (0 0 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -23,8 +23,8 @@ boundaryField
|
|||||||
{
|
{
|
||||||
inlet
|
inlet
|
||||||
{
|
{
|
||||||
type calculated;
|
type fixedValue;
|
||||||
value uniform 0;
|
value $internalField;
|
||||||
}
|
}
|
||||||
|
|
||||||
outlet
|
outlet
|
||||||
@ -41,7 +41,7 @@ boundaryField
|
|||||||
{
|
{
|
||||||
type inletOutlet;
|
type inletOutlet;
|
||||||
inletValue uniform 0;
|
inletValue uniform 0;
|
||||||
value uniform 0;
|
value $internalField;
|
||||||
}
|
}
|
||||||
|
|
||||||
hull_wall
|
hull_wall
|
||||||
|
|||||||
@ -24,7 +24,7 @@ boundaryField
|
|||||||
inlet
|
inlet
|
||||||
{
|
{
|
||||||
type fixedValue;
|
type fixedValue;
|
||||||
value uniform 0.00015;
|
value $internalField;
|
||||||
}
|
}
|
||||||
|
|
||||||
outlet
|
outlet
|
||||||
@ -40,14 +40,14 @@ boundaryField
|
|||||||
atmosphere
|
atmosphere
|
||||||
{
|
{
|
||||||
type inletOutlet;
|
type inletOutlet;
|
||||||
inletValue uniform 0.00015;
|
inletValue $internalField;
|
||||||
value uniform 0.00015;
|
value $internalField;
|
||||||
}
|
}
|
||||||
|
|
||||||
hull_wall
|
hull_wall
|
||||||
{
|
{
|
||||||
type kqRWallFunction;
|
type kqRWallFunction;
|
||||||
value uniform 0.00015;
|
value $internalField;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -24,7 +24,7 @@ boundaryField
|
|||||||
inlet
|
inlet
|
||||||
{
|
{
|
||||||
type fixedValue;
|
type fixedValue;
|
||||||
value uniform 5e-07;
|
value $internalField;
|
||||||
}
|
}
|
||||||
|
|
||||||
outlet
|
outlet
|
||||||
@ -45,7 +45,7 @@ boundaryField
|
|||||||
hull_wall
|
hull_wall
|
||||||
{
|
{
|
||||||
type nutkWallFunction;
|
type nutkWallFunction;
|
||||||
value uniform 0;
|
value $internalField;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -23,14 +23,14 @@ boundaryField
|
|||||||
inlet
|
inlet
|
||||||
{
|
{
|
||||||
type fixedValue;
|
type fixedValue;
|
||||||
value uniform 2;
|
value $internalField;
|
||||||
}
|
}
|
||||||
|
|
||||||
outlet
|
outlet
|
||||||
{
|
{
|
||||||
type inletOutlet;
|
type inletOutlet;
|
||||||
inletValue uniform 2;
|
inletValue $internalField;
|
||||||
value uniform 2;
|
value $internalField;
|
||||||
}
|
}
|
||||||
|
|
||||||
outlet
|
outlet
|
||||||
@ -46,14 +46,14 @@ boundaryField
|
|||||||
atmosphere
|
atmosphere
|
||||||
{
|
{
|
||||||
type inletOutlet;
|
type inletOutlet;
|
||||||
inletValue uniform 2;
|
inletValue $internalField;
|
||||||
value uniform 2;
|
value $internalField;
|
||||||
}
|
}
|
||||||
|
|
||||||
hull_wall
|
hull_wall
|
||||||
{
|
{
|
||||||
type omegaWallFunction;
|
type omegaWallFunction;
|
||||||
value uniform 2;
|
value $internalField;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -23,7 +23,7 @@ boundaryField
|
|||||||
inlet
|
inlet
|
||||||
{
|
{
|
||||||
type fixedFluxPressure;
|
type fixedFluxPressure;
|
||||||
value uniform 0;
|
value $internalField;
|
||||||
}
|
}
|
||||||
|
|
||||||
outlet
|
outlet
|
||||||
@ -45,13 +45,13 @@ boundaryField
|
|||||||
rho rho;
|
rho rho;
|
||||||
psi none;
|
psi none;
|
||||||
gamma 1;
|
gamma 1;
|
||||||
value uniform 0;
|
value $internalField;
|
||||||
}
|
}
|
||||||
|
|
||||||
hull_wall
|
hull_wall
|
||||||
{
|
{
|
||||||
type fixedFluxPressure;
|
type fixedFluxPressure;
|
||||||
value uniform 0;
|
value $internalField;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -23,7 +23,7 @@ startTime 0;
|
|||||||
|
|
||||||
stopAt endTime;
|
stopAt endTime;
|
||||||
|
|
||||||
endTime 2000;
|
endTime 1000;
|
||||||
|
|
||||||
deltaT 1;
|
deltaT 1;
|
||||||
|
|
||||||
|
|||||||
@ -17,11 +17,21 @@ FoamFile
|
|||||||
|
|
||||||
solvers
|
solvers
|
||||||
{
|
{
|
||||||
alpha.water
|
"alpha.water.*"
|
||||||
{
|
{
|
||||||
nAlphaCorr 1;
|
nAlphaCorr 1;
|
||||||
nAlphaSubCycles 1;
|
nAlphaSubCycles 1;
|
||||||
cAlpha 1;
|
cAlpha 1;
|
||||||
|
icAlpha 0.25;
|
||||||
|
|
||||||
|
MULESCorr yes;
|
||||||
|
nLimiterIter 8;
|
||||||
|
alphaApplyPrevCorr true;
|
||||||
|
|
||||||
|
solver smoothSolver;
|
||||||
|
smoother symGaussSeidel;
|
||||||
|
tolerance 1e-8;
|
||||||
|
relTol 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
pcorr
|
pcorr
|
||||||
@ -56,14 +66,14 @@ solvers
|
|||||||
nCellsInCoarsestLevel 10;
|
nCellsInCoarsestLevel 10;
|
||||||
cacheAgglomeration true;
|
cacheAgglomeration true;
|
||||||
|
|
||||||
tolerance 1e-6;
|
tolerance 1e-7;
|
||||||
relTol 0.01;
|
relTol 0.01;
|
||||||
};
|
};
|
||||||
|
|
||||||
p_rghFinal
|
p_rghFinal
|
||||||
{
|
{
|
||||||
$p_rgh;
|
$p_rgh;
|
||||||
tolerance 1e-6;
|
tolerance 1e-7;
|
||||||
relTol 0;
|
relTol 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,17 +91,18 @@ solvers
|
|||||||
|
|
||||||
PIMPLE
|
PIMPLE
|
||||||
{
|
{
|
||||||
momentumPredictor yes;
|
momentumPredictor no;
|
||||||
|
|
||||||
nCorrectors 1;
|
nCorrectors 1;
|
||||||
nNonOrthogonalCorrectors 0;
|
nNonOrthogonalCorrectors 0;
|
||||||
|
|
||||||
maxCo 0.9;
|
maxCo 5;
|
||||||
maxAlphaCo 0.2;
|
maxAlphaCo 5;
|
||||||
nAlphaSweepIter 1;
|
|
||||||
|
|
||||||
rDeltaTSmoothingCoeff 0.1;
|
rDeltaTSmoothingCoeff 0.05;
|
||||||
rDeltaTDampingCoeff 1;
|
rDeltaTDampingCoeff 0.5;
|
||||||
|
nAlphaSweepIter 0;
|
||||||
|
nAlphaSpreadIter 0;
|
||||||
maxDeltaT 1;
|
maxDeltaT 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,6 +113,7 @@ relaxationFactors
|
|||||||
}
|
}
|
||||||
equations
|
equations
|
||||||
{
|
{
|
||||||
|
".*" 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -30,6 +30,17 @@ regions
|
|||||||
volScalarFieldValue alpha.water 1
|
volScalarFieldValue alpha.water 1
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set patch values (using ==)
|
||||||
|
boxToFace
|
||||||
|
{
|
||||||
|
box (-100 -100 -100) (100 100 0);
|
||||||
|
|
||||||
|
fieldValues
|
||||||
|
(
|
||||||
|
volScalarFieldValue alpha.water 1
|
||||||
|
);
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user