Merging surface tracking, 3. Zeljko Tukovic
This commit is contained in:
parent
e72fff64a7
commit
814982fb2b
95 changed files with 2893 additions and 2648 deletions
|
@ -1,20 +1,15 @@
|
|||
EXE_INC = \
|
||||
-I./include \
|
||||
-I../freeSurface \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/finiteArea/lnInclude \
|
||||
-I../include \
|
||||
-I../freeSurface/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/dynamicFvMesh/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/tetDecompositionFiniteElement/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/meshMotion/tetDecompositionMotionSolver/lnInclude \
|
||||
$(WM_DECOMP_INC)
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/finiteArea/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfreeSurface \
|
||||
-lfiniteVolume \
|
||||
-lfiniteArea \
|
||||
-lmeshTools \
|
||||
-ldynamicFvMesh \
|
||||
-ldynamicMesh \
|
||||
-lmeshTools \
|
||||
$(WM_DECOMP_LIBS) \
|
||||
-llduSolvers
|
||||
-lfiniteVolume \
|
||||
-lfiniteArea
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2004-2007 Z. Tukovic and H. Jasak
|
||||
\\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
@ -32,37 +32,25 @@ Description
|
|||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "Ostream.H"
|
||||
#include "OFstream.H"
|
||||
|
||||
#include "fvCFD.H"
|
||||
|
||||
#include "inletOutletFvPatchFields.H"
|
||||
#include "zeroGradientFvPatchFields.H"
|
||||
#include "fixedGradientFvPatchFields.H"
|
||||
|
||||
#include "motionSolver.H"
|
||||
#include "dynamicFvMesh.H"
|
||||
#include "freeSurface.H"
|
||||
#include "inletOutletFvPatchFields.H"
|
||||
#include "fixedGradientFvPatchFields.H"
|
||||
#include "boundBox.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
# include "setRootCase.H"
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
# include "createMeshNoClear.H"
|
||||
|
||||
# include "createDynamicFvMesh.H"
|
||||
# include "createFields.H"
|
||||
|
||||
# include "initContinuityErrs.H"
|
||||
|
||||
# include "createBubble.H"
|
||||
|
||||
# include "createPath.H"
|
||||
|
||||
# include "createForces.H"
|
||||
# include "createSurfactantConcentrationField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
@ -70,98 +58,100 @@ int main(int argc, char *argv[])
|
|||
|
||||
for (runTime++; !runTime.end(); runTime++)
|
||||
{
|
||||
Info << "Time = " << runTime.value() << endl;
|
||||
Info << "Time = " << runTime.value() << endl << endl;
|
||||
|
||||
# include "readBubbleSIMPLEControls.H"
|
||||
# include "CourantNo.H"
|
||||
|
||||
interface.updateDisplacementDirections();
|
||||
# include "readPISOControls.H"
|
||||
|
||||
interface.moveMeshPointsForOldFreeSurfDisplacement();
|
||||
|
||||
interface.smooth();
|
||||
interface.updateDisplacementDirections();
|
||||
|
||||
# include "updateMovingReferenceFrame.H"
|
||||
interface.predictPoints();
|
||||
|
||||
// --- SIMPLE loop
|
||||
for (label timeCorr=0; timeCorr<=nTimeCorr; timeCorr++)
|
||||
Info<< "\nMax surface Courant Number = "
|
||||
<< interface.maxCourantNumber() << endl << endl;
|
||||
|
||||
for (int corr=0; corr<nOuterCorr; corr++)
|
||||
{
|
||||
Info << endl;
|
||||
// Update interface bc
|
||||
interface.updateBoundaryConditions();
|
||||
|
||||
p.storePrevIter();
|
||||
// Make the fluxes relative
|
||||
phi -= fvc::meshPhi(rho, U);
|
||||
|
||||
interface.correctBoundaryConditions();
|
||||
# include "CourantNo.H"
|
||||
|
||||
tmp<fvVectorMatrix> UEqn
|
||||
fvVectorMatrix UEqn
|
||||
(
|
||||
fvm::ddt(rho, U)
|
||||
+ rho*aF
|
||||
+ fvm::div(phiNet, U)
|
||||
+ fvm::div(fvc::interpolate(rho)*phi, U, "div(phi,U)")
|
||||
- fvm::laplacian(mu, U)
|
||||
);
|
||||
|
||||
UEqn().relax();
|
||||
solve(UEqn == -fvc::grad(p));
|
||||
|
||||
solve(UEqn() == -fvc::grad(p));
|
||||
|
||||
volScalarField AU = UEqn().A();
|
||||
|
||||
U = UEqn().H()/AU;
|
||||
U.correctBoundaryConditions();
|
||||
|
||||
UEqn.clear();
|
||||
|
||||
phi = (fvc::interpolate(U) & mesh.Sf());
|
||||
|
||||
# include "spacePatchFlowRateScaling.H"
|
||||
|
||||
# include "freeSurfacePatchFlowRateScaling.H"
|
||||
|
||||
// Non-orthogonal pressure corrector loop
|
||||
for (label nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
// --- PISO loop
|
||||
for (int i=0; i<nCorr; i++)
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
fvm::laplacian(1.0/AU, p) == fvc::div(phi)
|
||||
);
|
||||
volScalarField AU = UEqn.A();
|
||||
|
||||
pEqn.setReference(0, 0.0);
|
||||
pEqn.solve();
|
||||
U = UEqn.H()/AU;
|
||||
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
phi = (fvc::interpolate(U) & mesh.Sf());
|
||||
|
||||
# include "scalePhi.H"
|
||||
|
||||
# include "scaleSpacePhi.H"
|
||||
|
||||
// Non-orthogonal pressure corrector loop
|
||||
for (label nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
{
|
||||
phi -= pEqn.flux();
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
fvm::laplacian(1.0/AU, p)
|
||||
== fvc::div(phi)
|
||||
);
|
||||
|
||||
# include "setReference.H"
|
||||
|
||||
pEqn.solve();
|
||||
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
{
|
||||
phi -= pEqn.flux();
|
||||
}
|
||||
}
|
||||
|
||||
# include "continuityErrs.H"
|
||||
|
||||
// Momentum corrector
|
||||
U -= fvc::grad(p)/AU;
|
||||
U.correctBoundaryConditions();
|
||||
}
|
||||
|
||||
# include "continuityErrs.H"
|
||||
# include "solveBulkSurfactant.H"
|
||||
|
||||
// Explicitly relax pressure
|
||||
p.relax();
|
||||
|
||||
// Momentum corrector
|
||||
U -= fvc::grad(p)/AU;
|
||||
U.correctBoundaryConditions();
|
||||
|
||||
// Move mesh
|
||||
interface.movePoints();
|
||||
|
||||
// Update motion fluxes
|
||||
phiNet = fvc::interpolate(rho)*(phi - fvc::meshPhi(rho, U));
|
||||
interface.correctPoints();
|
||||
|
||||
# include "freeSurfaceContinuityErrs.H"
|
||||
}
|
||||
|
||||
# include "bubbleVolumeReduction.H"
|
||||
# include "updateMovingReferenceFrame.H"
|
||||
|
||||
# include "volContinuity.H"
|
||||
|
||||
Info << "Total surface tension force: "
|
||||
<< interface.totalSurfaceTensionForce() << endl;
|
||||
|
||||
vector totalForce =
|
||||
interface.totalViscousForce()
|
||||
+ interface.totalPressureForce();
|
||||
|
||||
Info << "Total force: " << totalForce << endl;
|
||||
|
||||
runTime.write();
|
||||
|
||||
# include "writeData.H"
|
||||
|
||||
# include "writePath.H"
|
||||
|
||||
# include "writeForces.H"
|
||||
|
||||
Info << "ExecutionTime = "
|
||||
<< scalar(runTime.elapsedCpuTime())
|
||||
<< " s\n" << endl << endl;
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
|
||||
bubbleProperties.remove("Vb");
|
||||
Vb = gSum((1.0 - interface.fluidIndicator().internalField())*mesh.V());
|
||||
bubbleProperties.add("Vb", Vb);
|
||||
|
||||
if(Pstream::master())
|
||||
{
|
||||
Info << "Bubble volume reduction: " << Vb/Vbf << endl;
|
||||
}
|
|
@ -1,171 +0,0 @@
|
|||
// Detect the space patch
|
||||
label spacePatchID = -1;
|
||||
|
||||
forAll (mesh.boundary(), patchI)
|
||||
{
|
||||
if (mesh.boundary()[patchI].name() == "space")
|
||||
{
|
||||
spacePatchID = patchI;
|
||||
|
||||
Info<< "Found space patch. ID: "
|
||||
<< spacePatchID << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// if (spacePatchID < 0)
|
||||
// {
|
||||
// FatalErrorIn(args.executable())
|
||||
// << "Space patch not defined. Please make sure that "
|
||||
// << "the space patch is named as space."
|
||||
// << abort(FatalError);
|
||||
// }
|
||||
|
||||
|
||||
IOdictionary mrfProperties
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"mrfProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
scalar lambdaFf
|
||||
(
|
||||
readScalar(mrfProperties.lookup("lambdaFf"))
|
||||
);
|
||||
|
||||
scalar lambdaF0
|
||||
(
|
||||
readScalar(mrfProperties.lookup("lambdaF0"))
|
||||
);
|
||||
|
||||
|
||||
// Parameters of moving reference frame
|
||||
IOdictionary movingReferenceFrame
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"movingReferenceFrame",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
// - Bubble center
|
||||
vector Cb;
|
||||
if (movingReferenceFrame.found("Cb"))
|
||||
{
|
||||
Cb = vector
|
||||
(
|
||||
movingReferenceFrame.lookup("Cb")
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
Cb = gSum((1.0 - interface.fluidIndicator().internalField())*
|
||||
mesh.C().internalField()*mesh.V())/
|
||||
gSum((1.0 - interface.fluidIndicator().internalField())*mesh.V());
|
||||
}
|
||||
|
||||
// - Bubble centre on the start of calculation
|
||||
vector Cbf;
|
||||
if (movingReferenceFrame.found("Cbf"))
|
||||
{
|
||||
Cbf = vector
|
||||
(
|
||||
movingReferenceFrame.lookup("Cbf")
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
Cbf = Cb;
|
||||
}
|
||||
|
||||
// - Bubble position vector
|
||||
dimensionedVector XF ("XF", dimLength, vector::zero);
|
||||
if (movingReferenceFrame.found("XF"))
|
||||
{
|
||||
XF = dimensionedVector
|
||||
(
|
||||
movingReferenceFrame.lookup("XF")
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
XF = dimensionedVector
|
||||
(
|
||||
"XF",
|
||||
dimLength,
|
||||
Cbf
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// - Bubble velocity
|
||||
dimensionedVector UF ("UF", dimVelocity, vector::zero);
|
||||
if (movingReferenceFrame.found("UF"))
|
||||
{
|
||||
UF = dimensionedVector
|
||||
(
|
||||
movingReferenceFrame.lookup("UF")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// - Bubble acceleration
|
||||
dimensionedVector aF ("aF", dimensionSet(0,1,-2,0,0,0,0), vector::zero);
|
||||
if (movingReferenceFrame.found("aF"))
|
||||
{
|
||||
aF = dimensionedVector
|
||||
(
|
||||
movingReferenceFrame.lookup("aF")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
IOdictionary bubbleProperties
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"bubbleProperties",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
scalar Vb;
|
||||
if (bubbleProperties.found("Vb"))
|
||||
{
|
||||
Vb = readScalar
|
||||
(
|
||||
bubbleProperties.lookup("Vb")
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
Vb = gSum((1.0 - interface.fluidIndicator().internalField())*mesh.V());
|
||||
bubbleProperties.add("Vb", Vb);
|
||||
}
|
||||
|
||||
scalar Vbf;
|
||||
if (bubbleProperties.found("Vbf"))
|
||||
{
|
||||
Vbf = readScalar
|
||||
(
|
||||
bubbleProperties.lookup("Vbf")
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
Vbf = Vb;
|
||||
bubbleProperties.add("Vbf", Vbf);
|
||||
}
|
|
@ -1,82 +0,0 @@
|
|||
Info<< "\nReading field p\n" << endl << flush;
|
||||
volScalarField p
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"p",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
|
||||
Info<< "Reading field U\n" << endl << flush;
|
||||
volVectorField U
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
|
||||
# include "createPhi.H"
|
||||
|
||||
|
||||
volScalarField rho
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rho",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("0", dimMass/dimVolume, 0)
|
||||
);
|
||||
|
||||
|
||||
freeSurface interface(mesh, rho, U, p, phi);
|
||||
|
||||
|
||||
rho = interface.fluidIndicator()*
|
||||
(
|
||||
interface.rhoFluidA()
|
||||
- interface.rhoFluidB()
|
||||
)
|
||||
+ interface.rhoFluidB();
|
||||
|
||||
|
||||
volScalarField mu
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"mu",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
interface.fluidIndicator()*
|
||||
(
|
||||
interface.muFluidA()
|
||||
- interface.muFluidB()
|
||||
)
|
||||
+ interface.muFluidB()
|
||||
);
|
||||
|
||||
|
||||
surfaceScalarField phiNet = fvc::interpolate(rho)*(phi - fvc::meshPhi(rho,U));
|
||||
phiNet.rename("phiNet");
|
||||
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
OFstream* forcesFilePtr = NULL;
|
||||
|
||||
if(Pstream::master())
|
||||
{
|
||||
mkDir
|
||||
(
|
||||
args.rootPath()
|
||||
/args.globalCaseName()
|
||||
/"forces"
|
||||
/runTime.timeName()
|
||||
);
|
||||
|
||||
forcesFilePtr =
|
||||
new OFstream
|
||||
(
|
||||
args.rootPath()
|
||||
/args.globalCaseName()
|
||||
/"forces"
|
||||
/runTime.timeName()
|
||||
/"dragAndLift"
|
||||
);
|
||||
|
||||
*forcesFilePtr << "Time" << tab << "drag" << tab << "lift" << endl;
|
||||
}
|
||||
|
||||
OFstream& forcesFile = *forcesFilePtr;
|
|
@ -1,29 +0,0 @@
|
|||
OFstream* pathFilePtr = NULL;
|
||||
|
||||
if(Pstream::master())
|
||||
{
|
||||
mkDir
|
||||
(
|
||||
args.rootPath()
|
||||
/args.globalCaseName()
|
||||
/"path"
|
||||
/runTime.timeName()
|
||||
);
|
||||
|
||||
pathFilePtr =
|
||||
new OFstream
|
||||
(
|
||||
args.rootPath()
|
||||
/args.globalCaseName()
|
||||
/"path"
|
||||
/runTime.timeName()
|
||||
/"path"
|
||||
);
|
||||
|
||||
*pathFilePtr << "Time" << tab;
|
||||
|
||||
*pathFilePtr << "Xb" << tab << "Yb" << tab << "Zb" << tab
|
||||
<< "Ub" << tab << "ab" << endl;
|
||||
}
|
||||
|
||||
OFstream& pathFile = *pathFilePtr;
|
|
@ -1,24 +0,0 @@
|
|||
if(Pstream::master())
|
||||
{
|
||||
Info<< "Free surface flux: sum local = "
|
||||
<< sum(mag(phi.boundaryField()[interface.aPatchID()]))
|
||||
<< ", global = "
|
||||
<< sum(phi.boundaryField()[interface.aPatchID()]) << endl;
|
||||
|
||||
Info<< "Free surface continuity error : sum local = " <<
|
||||
sum
|
||||
(
|
||||
mag
|
||||
(
|
||||
phiNet.boundaryField()[interface.aPatchID()]/
|
||||
interface.rhoFluidA().value()
|
||||
)
|
||||
)
|
||||
<< ", global = " <<
|
||||
sum
|
||||
(
|
||||
phiNet.boundaryField()[interface.aPatchID()]/
|
||||
interface.rhoFluidA().value()
|
||||
)
|
||||
<< endl;
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
if(Pstream::master())
|
||||
{
|
||||
scalarField weights =
|
||||
mag(phi.boundaryField()[interface.bPatchID()]);
|
||||
|
||||
if(mag(sum(weights)) > SMALL)
|
||||
{
|
||||
weights /= sum(weights);
|
||||
}
|
||||
|
||||
phi.boundaryField()[interface.bPatchID()] -=
|
||||
weights*sum(phi.boundaryField()[interface.bPatchID()]);
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
const dictionary& simple = mesh.solutionDict().subDict("SIMPLE");
|
||||
|
||||
int nTimeCorr = 0;
|
||||
|
||||
if (simple.found("nTimeCorrectors"))
|
||||
{
|
||||
nTimeCorr = readInt(simple.lookup("nTimeCorrectors"));
|
||||
}
|
||||
|
||||
int nNonOrthCorr = 0;
|
||||
|
||||
if (simple.found("nNonOrthogonalCorrectors"))
|
||||
{
|
||||
nNonOrthCorr = readInt(simple.lookup("nNonOrthogonalCorrectors"));
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
if(spacePatchID != -1)
|
||||
{
|
||||
fvsPatchScalarField& spacePhi = phi.boundaryField()[spacePatchID];
|
||||
|
||||
scalar outflowScaling =
|
||||
(
|
||||
- sum(neg(spacePhi)*spacePhi) + SMALL
|
||||
)/
|
||||
(
|
||||
sum(pos(spacePhi)*spacePhi) + SMALL
|
||||
);
|
||||
|
||||
spacePhi += pos(spacePhi)*spacePhi*(outflowScaling - 1.0);
|
||||
|
||||
U.boundaryField()[spacePatchID] +=
|
||||
pos(spacePhi)*U.boundaryField()[spacePatchID]*(outflowScaling - 1.0);
|
||||
}
|
|
@ -1,77 +0,0 @@
|
|||
vector Cb0 = Cb;
|
||||
|
||||
Cb = gSum((1.0 - interface.fluidIndicator().internalField())*
|
||||
mesh.C().internalField()*mesh.V())/
|
||||
gSum((1.0 - interface.fluidIndicator().internalField())*mesh.V());
|
||||
|
||||
Info << "Current bubble centre: " << Cb << endl;
|
||||
|
||||
dimensionedVector dUF
|
||||
(
|
||||
"dUF",
|
||||
dimVelocity,
|
||||
lambdaFf*(Cb-Cbf)/runTime.deltaT0().value()
|
||||
+ lambdaF0*(Cb-Cb0)/runTime.deltaT0().value()
|
||||
);
|
||||
|
||||
XF += (UF + 0.5*dUF)*runTime.deltaT0();
|
||||
Info << "Current bubble position: " << XF << endl;
|
||||
|
||||
|
||||
// dimensionedVector UF00 ("UF00", dimVelocity, UF0.value());
|
||||
// UF0 = UF;
|
||||
UF += dUF;
|
||||
Info << "Current bubble velocity: " << UF << endl;
|
||||
|
||||
aF = dUF/runTime.deltaT0();
|
||||
// aF = (3.0*UF - 4.0*UF0 + UF00)/(2.0*runTime.deltaT0());
|
||||
Info << "Current bubble acceleration: " << aF << endl;
|
||||
|
||||
if(spacePatchID != -1)
|
||||
{
|
||||
if
|
||||
(
|
||||
U.boundaryField()[spacePatchID].type()
|
||||
== inletOutletFvPatchVectorField::typeName
|
||||
)
|
||||
{
|
||||
inletOutletFvPatchVectorField& spaceU =
|
||||
refCast<inletOutletFvPatchVectorField>
|
||||
(
|
||||
U.boundaryField()[spacePatchID]
|
||||
);
|
||||
|
||||
spaceU.refValue() = -UF.value();
|
||||
}
|
||||
}
|
||||
|
||||
// Update movingReferenceFrame dictionary
|
||||
if (movingReferenceFrame.found("Cb"))
|
||||
{
|
||||
movingReferenceFrame.remove("Cb");
|
||||
}
|
||||
movingReferenceFrame.add("Cb", Cb);
|
||||
|
||||
if (movingReferenceFrame.found("Cbf"))
|
||||
{
|
||||
movingReferenceFrame.remove("Cbf");
|
||||
}
|
||||
movingReferenceFrame.add("Cbf", Cbf);
|
||||
|
||||
if (movingReferenceFrame.found("XF"))
|
||||
{
|
||||
movingReferenceFrame.remove("XF");
|
||||
}
|
||||
movingReferenceFrame.add("XF", XF);
|
||||
|
||||
if (movingReferenceFrame.found("UF"))
|
||||
{
|
||||
movingReferenceFrame.remove("UF");
|
||||
}
|
||||
movingReferenceFrame.add("UF", UF);
|
||||
|
||||
if (movingReferenceFrame.found("aF"))
|
||||
{
|
||||
movingReferenceFrame.remove("aF");
|
||||
}
|
||||
movingReferenceFrame.add("aF", aF);
|
|
@ -1,62 +0,0 @@
|
|||
if (runTime.outputTime())
|
||||
{
|
||||
// Local free surface curvature and flux
|
||||
if(Pstream::master())
|
||||
{
|
||||
OFstream file
|
||||
(
|
||||
runTime.timePath()/"fsData.dat"
|
||||
);
|
||||
|
||||
file.precision(12);
|
||||
|
||||
scalarField flowRate =
|
||||
phi.boundaryField()[interface.aPatchID()]
|
||||
+ fvc::meshPhi(rho,U)().boundaryField()[interface.aPatchID()];
|
||||
|
||||
const vectorField& C =
|
||||
mesh.Cf().boundaryField()[interface.aPatchID()];
|
||||
|
||||
const scalarField& K =
|
||||
interface.aMesh().faceCurvatures().internalField();
|
||||
|
||||
file<< "X" << tab
|
||||
<< "Y" << tab
|
||||
<< "Z" << tab
|
||||
<< "K" << tab
|
||||
<< "flux";
|
||||
|
||||
if(!interface.cleanInterface())
|
||||
{
|
||||
file<< tab << "Cs" << tab
|
||||
<< "surfTension" << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
file << endl;
|
||||
}
|
||||
|
||||
|
||||
forAll(flowRate, faceI)
|
||||
{
|
||||
file<< C[faceI].x() << tab
|
||||
<< C[faceI].y() << tab
|
||||
<< C[faceI].z() << tab
|
||||
<< K[faceI] << tab
|
||||
<< flowRate[faceI];
|
||||
|
||||
if(!interface.cleanInterface())
|
||||
{
|
||||
file<< tab <<
|
||||
interface.surfactantConcentration().internalField()[faceI]
|
||||
<< tab
|
||||
<< interface.surfaceTension().internalField()[faceI]
|
||||
<< endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
file << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,68 +0,0 @@
|
|||
if(Pstream::master())
|
||||
{
|
||||
// const scalarField& magSf =
|
||||
// mesh.magSf().boundaryField()[interface.aPatchID()];
|
||||
|
||||
// vectorField n =
|
||||
// mesh.Sf().boundaryField()[interface.aPatchID()]/magSf;
|
||||
|
||||
// const scalarField& P = p.boundaryField()[interface.aPatchID()];
|
||||
|
||||
// vectorField pressureForces = magSf*P*n;
|
||||
|
||||
// vectorField snGradU =
|
||||
// U.boundaryField()[interface.aPatchID()].snGrad();
|
||||
|
||||
// vectorField viscousForces =
|
||||
// - interface.muFluidA().value()*magSf*
|
||||
// (
|
||||
// snGradU
|
||||
// + ((n*n)&snGradU)
|
||||
// + (fac::grad(interface.Us())&interface.aMesh().faceAreaNormals())
|
||||
// ().internalField()
|
||||
// );
|
||||
|
||||
vector totalPressureForce = -interface.totalPressureForce();
|
||||
|
||||
vector totalViscousForce = -interface.totalViscousForce();
|
||||
|
||||
vector totalForce = totalPressureForce + totalViscousForce;
|
||||
|
||||
|
||||
vector dragDir;
|
||||
scalar Uref;
|
||||
|
||||
if(mag(UF.value()) > SMALL)
|
||||
{
|
||||
dragDir = - UF.value()/mag(UF.value());
|
||||
Uref = mag(UF.value());
|
||||
}
|
||||
else
|
||||
{
|
||||
dragDir = interface.g().value()/mag(interface.g().value());
|
||||
Uref = SMALL;
|
||||
}
|
||||
|
||||
|
||||
scalar Aref =
|
||||
sum
|
||||
(
|
||||
(dragDir&mesh.Sf().boundaryField()[interface.aPatchID()])*
|
||||
pos(dragDir&mesh.Sf().boundaryField()[interface.aPatchID()])
|
||||
);
|
||||
|
||||
|
||||
scalar drag =
|
||||
(dragDir&totalForce)/
|
||||
(0.5*interface.rhoFluidA().value()*sqr(Uref)*Aref);
|
||||
|
||||
|
||||
scalar lift =
|
||||
mag((I - dragDir*dragDir)&totalForce)/
|
||||
(0.5*interface.rhoFluidA().value()*sqr(Uref)*Aref);
|
||||
|
||||
|
||||
forcesFile << runTime.value() << tab;
|
||||
|
||||
forcesFile << drag << tab << lift << endl;
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
if(Pstream::master())
|
||||
{
|
||||
pathFile << runTime.value() << tab;
|
||||
|
||||
pathFile << XF.value().x() << tab
|
||||
<< XF.value().y() << tab
|
||||
<< XF.value().z() << tab
|
||||
<< mag(UF.value()) << tab
|
||||
<< mag(aF.value()) << endl;
|
||||
}
|
|
@ -1,79 +0,0 @@
|
|||
// The FOAM Project // File: updateCoupledInterfaces.C
|
||||
/*
|
||||
-------------------------------------------------------------------------------
|
||||
========= | Class Implementation
|
||||
\\ / |
|
||||
\\ / | Name: updateCoupledInterfaces
|
||||
\\ / | Family: matrix
|
||||
\\/ |
|
||||
F ield | FOAM version: 2.2
|
||||
O peration |
|
||||
A and | Copyright (C) 1991-2003 Nabla Ltd.
|
||||
M anipulation | All Rights Reserved.
|
||||
-------------------------------------------------------------------------------
|
||||
DESCRIPTION
|
||||
|
||||
AUTHOR
|
||||
Hrvoje Jasak and Henry G. Weller.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "lduMatrix.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
void lduMatrix::updateMatrixInterfaces
|
||||
(
|
||||
const FieldField<Field, scalar>& coupleCoeffs,
|
||||
const lduCoupledInterfacePtrsList& interfaces,
|
||||
const scalarField& psiif,
|
||||
scalarField& result,
|
||||
const direction cmpt
|
||||
) const
|
||||
{
|
||||
// Initialise coupling
|
||||
forAll (interfaces, interfaceI)
|
||||
{
|
||||
if (interfaces[interfaceI]->coupled())
|
||||
{
|
||||
interfaces[interfaceI]->initInterfaceMatrixUpdate
|
||||
(
|
||||
psiif,
|
||||
result,
|
||||
*this,
|
||||
coupleCoeffs[interfaceI],
|
||||
cmpt,
|
||||
false
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Update coupled interface
|
||||
forAll (interfaces, interfaceI)
|
||||
{
|
||||
if (interfaces[interfaceI]->coupled())
|
||||
{
|
||||
interfaces[interfaceI]->updateInterfaceMatrix
|
||||
(
|
||||
psiif,
|
||||
result,
|
||||
*this,
|
||||
coupleCoeffs[interfaceI],
|
||||
cmpt
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
|
@ -2,4 +2,18 @@ freeSurface.C
|
|||
makeFreeSurfaceData.C
|
||||
freeSurfacePointDisplacement.C
|
||||
|
||||
correctedFvPatchFields/correctedFvPatchField/correctedFvPatchFields.C
|
||||
|
||||
basicCorrectedFvPatchFields = correctedFvPatchFields/basicCorrectedFvPatchFields
|
||||
$(basicCorrectedFvPatchFields)/fixedGradient/fixedGradientCorrectedFvPatchFields.C
|
||||
$(basicCorrectedFvPatchFields)/fixedValue/fixedValueCorrectedFvPatchFields.C
|
||||
$(basicCorrectedFvPatchFields)/zeroGradient/zeroGradientCorrectedFvPatchFields.C
|
||||
|
||||
|
||||
|
||||
patchCorrectedSnGrad/patchCorrectedSnGrads.C
|
||||
|
||||
functionObjects/bubbleHistory/bubbleHistory.C
|
||||
functionObjects/sloshingHistory/sloshingHistory.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libfreeSurface
|
||||
|
|
|
@ -3,6 +3,7 @@ EXE_INC = \
|
|||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/dynamicFvMesh/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/meshMotion/tetDecompositionMotionSolver/lnInclude \
|
||||
-I$(LIB_SRC)/tetDecompositionFiniteElement/lnInclude \
|
||||
$(WM_DECOMP_INC)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright held by original author
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright held by original author
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright held by original author
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright held by original author
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright held by original author
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright held by original author
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright held by original author
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright held by original author
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright held by original author
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright held by original author
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright held by original author
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright held by original author
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright held by original author
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright held by original author
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright held by original author
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright held by original author
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright held by original author
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright held by original author
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright held by original author
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright held by original author
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -45,9 +45,8 @@ SourceFiles
|
|||
#include "volFieldsFwd.H"
|
||||
#include "surfaceFieldsFwd.H"
|
||||
#include "faCFD.H"
|
||||
#include "patchToPatchInterpolation.H"
|
||||
#include "tetDecompositionMotionSolver.H"
|
||||
#include "tetPolyPatchInterpolation.H"
|
||||
#include "IOpatchToPatchInterpolation.H"
|
||||
#include "dynamicFvMesh.H"
|
||||
|
||||
#include "surfactantProperties.H"
|
||||
|
||||
|
@ -67,7 +66,7 @@ class freeSurface
|
|||
// Private data
|
||||
|
||||
//- Reference to fvMesh
|
||||
fvMesh& mesh_;
|
||||
dynamicFvMesh& mesh_;
|
||||
|
||||
//- Reference to density field
|
||||
const volScalarField& rho_;
|
||||
|
@ -91,10 +90,11 @@ class freeSurface
|
|||
// parallel with free-surface point normals
|
||||
Switch normalMotionDir_;
|
||||
|
||||
//- Is it necessary to smoot the free surface
|
||||
Switch freeSurfaceSmoothing_;
|
||||
//- Free-surface points displacement direction
|
||||
// if not normal motion direction
|
||||
vector motionDir_;
|
||||
|
||||
//- Is it free-surface clean of surfactants
|
||||
//- Is it free-surface clean of surfactant
|
||||
Switch cleanInterface_;
|
||||
|
||||
//- ID of the fvMesh patch which represents
|
||||
|
@ -126,23 +126,27 @@ class freeSurface
|
|||
//- Free surface patches which do not move
|
||||
wordList fixedFreeSurfacePatches_;
|
||||
|
||||
//- Free surface patches for witch point normals
|
||||
// must be corrected
|
||||
wordList pointNormalsCorrectionPatches_;
|
||||
|
||||
//- Number of free-surface correctors
|
||||
label nFreeSurfCorr_;
|
||||
|
||||
//- Interface smoothing at the begining of time step
|
||||
Switch smoothing_;
|
||||
|
||||
// Demand-driven data
|
||||
|
||||
//- Patch A motion interpolation
|
||||
mutable tetPolyPatchInterpolation* interpolatorAPtr_;
|
||||
|
||||
//- Patch B motion interpolation
|
||||
mutable tetPolyPatchInterpolation* interpolatorBPtr_;
|
||||
//- Patch to patch interpolation object which deals with
|
||||
// interpolation of flow variables between two free-surface
|
||||
// (interface) patches
|
||||
mutable IOpatchToPatchInterpolation* interpolatorABPtr_;
|
||||
|
||||
//- Patch to patch interpolation object which deals with
|
||||
// interpolation of flow variables between two free-surface
|
||||
// (interface) patches
|
||||
mutable patchToPatchInterpolation* interpolatorABPtr_;
|
||||
|
||||
//- Patch to patch interpolation object which deals with
|
||||
// interpolation of flow variables between two free-surface
|
||||
// (interface) patches
|
||||
mutable patchToPatchInterpolation* interpolatorBAPtr_;
|
||||
mutable IOpatchToPatchInterpolation* interpolatorBAPtr_;
|
||||
|
||||
//- Points which are attached to the free-surface A side faces
|
||||
// and which defines the free-surface shape
|
||||
|
@ -150,7 +154,7 @@ class freeSurface
|
|||
|
||||
//- Field which additionally determines
|
||||
// the motion of free-surface points
|
||||
mutable scalarField* motionPointsMaskPtr_;
|
||||
mutable labelList* motionPointsMaskPtr_;
|
||||
|
||||
//- Displacement direction of free-surface points
|
||||
mutable vectorField* pointsDisplacementDirPtr_;
|
||||
|
@ -166,9 +170,6 @@ class freeSurface
|
|||
// free-surface side A faces
|
||||
mutable faMesh* aMeshPtr_;
|
||||
|
||||
//- Reference to mesh motion solver
|
||||
mutable tetDecompositionMotionSolver* mSolverPtr_;
|
||||
|
||||
//- Free-surface velocity field
|
||||
mutable areaVectorField* UsPtr_;
|
||||
|
||||
|
@ -197,16 +198,15 @@ class freeSurface
|
|||
void makeDirections();
|
||||
void makeTotalDisplacement();
|
||||
void readTotalDisplacement();
|
||||
void makeFaMesh();
|
||||
void makeMeshMotionSolver();
|
||||
void makeUs();
|
||||
void makeFaMesh() const;
|
||||
void makeUs() const;
|
||||
void makePhis();
|
||||
void makeSurfactConc();
|
||||
void makeSurfaceTension();
|
||||
void makeSurfactant();
|
||||
void makePhi();
|
||||
void makeDdtPhi();
|
||||
void makeSurfactConc() const;
|
||||
void makeSurfaceTension() const;
|
||||
void makeSurfactant() const;
|
||||
void makeFluidIndicator();
|
||||
void makePatchPointInterpolators();
|
||||
|
||||
|
||||
//- Clear all demand-driven data
|
||||
void clearOut();
|
||||
|
@ -222,6 +222,14 @@ class freeSurface
|
|||
// for given new control points position
|
||||
tmp<vectorField> pointDisplacement(const scalarField& deltaH);
|
||||
|
||||
// Calc least sqare plane point and normal
|
||||
tmp<vectorField> lsPlanePointAndNormal
|
||||
(
|
||||
const vectorField& points,
|
||||
const vector& origin,
|
||||
const vector& axis
|
||||
) const;
|
||||
|
||||
public:
|
||||
|
||||
// Declare name of the class and it's debug switch
|
||||
|
@ -232,7 +240,7 @@ public:
|
|||
|
||||
freeSurface
|
||||
(
|
||||
fvMesh& m,
|
||||
dynamicFvMesh& m,
|
||||
const volScalarField& rho,
|
||||
volVectorField& Ub,
|
||||
volScalarField& Pb,
|
||||
|
@ -249,19 +257,19 @@ public:
|
|||
|
||||
|
||||
//- Return reference to fvMesh
|
||||
const fvMesh& mesh() const
|
||||
dynamicFvMesh& mesh()
|
||||
{
|
||||
return mesh_;
|
||||
}
|
||||
|
||||
//- Return reference to fvMesh
|
||||
fvMesh& mesh()
|
||||
const dynamicFvMesh& mesh() const
|
||||
{
|
||||
return mesh_;
|
||||
}
|
||||
|
||||
//- Return reference to time
|
||||
const Time& time() const
|
||||
//- Return reference to DB
|
||||
const Time& DB() const
|
||||
{
|
||||
return U_.mesh().time();
|
||||
}
|
||||
|
@ -278,16 +286,22 @@ public:
|
|||
return U_;
|
||||
}
|
||||
|
||||
//- Return reference to velocity field
|
||||
const volVectorField& U() const
|
||||
{
|
||||
return U_;
|
||||
}
|
||||
|
||||
//- Return reference to pressure field
|
||||
volScalarField& p()
|
||||
{
|
||||
return p_;
|
||||
}
|
||||
|
||||
//- Return reference to flux field
|
||||
const surfaceScalarField& phi() const
|
||||
//- Return reference to pressure field
|
||||
const volScalarField& p() const
|
||||
{
|
||||
return phi_;
|
||||
return p_;
|
||||
}
|
||||
|
||||
//- Are there exist two fluid
|
||||
|
@ -303,13 +317,6 @@ public:
|
|||
return normalMotionDir_;
|
||||
}
|
||||
|
||||
//- Is it necessary to consider the normal shear stress
|
||||
// at the free-surface
|
||||
bool freeSurfaceSmoothing() const
|
||||
{
|
||||
return freeSurfaceSmoothing_;
|
||||
}
|
||||
|
||||
//- Is it interface clean
|
||||
bool cleanInterface() const
|
||||
{
|
||||
|
@ -366,25 +373,19 @@ public:
|
|||
return cleanInterfaceSurfTension_;
|
||||
}
|
||||
|
||||
//- Return reference to interpolator for point motion, side A
|
||||
const tetPolyPatchInterpolation& interpolatorA();
|
||||
|
||||
//- Return reference to interpolator for point motion, side B
|
||||
const tetPolyPatchInterpolation& interpolatorB();
|
||||
|
||||
//- Return reference to interpolator from free surface side A to
|
||||
// free surface side B
|
||||
const patchToPatchInterpolation& interpolatorAB();
|
||||
const IOpatchToPatchInterpolation& interpolatorAB();
|
||||
|
||||
//- Return reference to interpolator from free surface side B to
|
||||
// free surface side A
|
||||
const patchToPatchInterpolation& interpolatorBA();
|
||||
const IOpatchToPatchInterpolation& interpolatorBA();
|
||||
|
||||
//- Return control points
|
||||
vectorField& controlPoints();
|
||||
|
||||
//- Return reference to motion points mask field
|
||||
scalarField& motionPointsMask();
|
||||
labelList& motionPointsMask();
|
||||
|
||||
//- Return reference to point displacement direction field
|
||||
vectorField& pointsDisplacementDir();
|
||||
|
@ -398,23 +399,35 @@ public:
|
|||
//- Return reference to finite area mesh
|
||||
faMesh& aMesh();
|
||||
|
||||
//- Return reference to motion solver
|
||||
tetDecompositionMotionSolver& meshMotionSolver();
|
||||
//- Return reference to finite area mesh
|
||||
const faMesh& aMesh() const;
|
||||
|
||||
//- Return free-surface velocity field
|
||||
areaVectorField& Us();
|
||||
|
||||
//- Return free-surface velocity field
|
||||
const areaVectorField& Us() const;
|
||||
|
||||
//- Return free-surface fluid flux field
|
||||
edgeScalarField& Phis();
|
||||
|
||||
//- Return free-surface surfactant concentration field
|
||||
areaScalarField& surfactantConcentration();
|
||||
|
||||
//- Return free-surface surfactant concentration field
|
||||
const areaScalarField& surfactantConcentration() const;
|
||||
|
||||
//- Return surface tension field
|
||||
areaScalarField& surfaceTension();
|
||||
|
||||
//- Return surface tension field
|
||||
const areaScalarField& surfaceTension() const;
|
||||
|
||||
//- Return surface tension gradient
|
||||
tmp<areaVectorField> surfaceTensionGrad();
|
||||
|
||||
//- Return surfactant properties
|
||||
const surfactantProperties& surfactant();
|
||||
const surfactantProperties& surfactant() const;
|
||||
|
||||
//- Return referenct to fluid indicator
|
||||
const volScalarField& fluidIndicator();
|
||||
|
@ -422,11 +435,14 @@ public:
|
|||
//- Update control points end displacement directions
|
||||
void updateDisplacementDirections();
|
||||
|
||||
//- Move only free-surface points
|
||||
bool movePoints();
|
||||
//- Predict interface points position
|
||||
bool predictPoints();
|
||||
|
||||
//- Move only free-surface points for uniform displacement
|
||||
bool movePoints(scalar displ);
|
||||
//- Correct interface points position
|
||||
bool correctPoints();
|
||||
|
||||
//- Move only free-surface points
|
||||
bool movePoints(const scalarField& interfacePHi);
|
||||
|
||||
//- Move mesh points for old time free-surface points displacement
|
||||
bool moveMeshPointsForOldFreeSurfDisplacement();
|
||||
|
@ -434,38 +450,56 @@ public:
|
|||
//- Move mesh points
|
||||
bool moveMeshPoints();
|
||||
|
||||
//- Move mesh points for given displacement filed
|
||||
bool moveMeshPoints(const scalarField& delta);
|
||||
|
||||
//- Correct free-surface boundary conditions
|
||||
void correctBoundaryConditions();
|
||||
//- Update free-surface boundary conditions
|
||||
void updateBoundaryConditions();
|
||||
|
||||
//- Correct free-surface pressure
|
||||
void correctPressure();
|
||||
void updatePressure();
|
||||
|
||||
//- Correct free-surface velocity
|
||||
void correctVelocity();
|
||||
void updateVelocity();
|
||||
|
||||
//- Correct free-surface velocity gradient
|
||||
void correctVelocityGradient();
|
||||
//- Update free-surface flux
|
||||
void updateSurfaceFlux();
|
||||
|
||||
//- Correct free-surface velocity
|
||||
void correctSurfaceFlux();
|
||||
//- Update free-surface surfactant concentration
|
||||
void updateSurfactantConcentration();
|
||||
|
||||
//- Correct free-surface surfactant concentration
|
||||
void correctSurfactantConcentration();
|
||||
//- Correct surface velocity boundary conditions
|
||||
void correctUsBoundaryConditions();
|
||||
|
||||
//- Calculate total pressure force
|
||||
vector totalPressureForce();
|
||||
vector totalPressureForce() const;
|
||||
|
||||
//- Calculate total viscous force
|
||||
vector totalViscousForce();
|
||||
vector totalViscousForce() const;
|
||||
|
||||
//- Calculate total surface tension force
|
||||
vector totalSurfaceTensionForce() const;
|
||||
|
||||
//- Calculate free-surface undulation indicator
|
||||
tmp<scalarField> undulationIndicator();
|
||||
|
||||
//- Smooth free-surface
|
||||
void smooth();
|
||||
|
||||
//- Chech free-surface faces flatness
|
||||
tmp<scalarField> checkFaceFlatness();
|
||||
|
||||
//- Initialize control points position
|
||||
void initializeControlPointsPosition();
|
||||
|
||||
//- Maximal surface tension based Courant number
|
||||
scalar maxCourantNumber();
|
||||
|
||||
//- Update properties
|
||||
void updateProperties();
|
||||
|
||||
//- Write VTK freeSurface mesh
|
||||
void writeVTK() const;
|
||||
|
||||
//- Write VTK freeSurface control points
|
||||
void writeVTKControlPoints();
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -26,7 +26,10 @@ License
|
|||
|
||||
#include "freeSurface.H"
|
||||
#include "primitivePatchInterpolation.H"
|
||||
#include "faceTetPolyPatch.H"
|
||||
#include "wedgeFaPatch.H"
|
||||
#include "wallFvPatch.H"
|
||||
#include "wedgeFaPatchFields.H"
|
||||
#include "slipFaPatchFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
@ -39,8 +42,8 @@ void freeSurface::makeInterpolators()
|
|||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "freeSurface::makeInterpolators(): "
|
||||
<< "making patch to patch interpolator"
|
||||
Info<< "freeSurface::makeInterpolators() : "
|
||||
<< "making pathc to patch interpolator"
|
||||
<< endl;
|
||||
}
|
||||
|
||||
|
@ -49,13 +52,13 @@ void freeSurface::makeInterpolators()
|
|||
// if the pointer is already set
|
||||
if
|
||||
(
|
||||
interpolatorABPtr_ ||
|
||||
interpolatorBAPtr_
|
||||
interpolatorBAPtr_ ||
|
||||
interpolatorABPtr_
|
||||
)
|
||||
{
|
||||
FatalErrorIn("freeSurface::makeInterpolators()")
|
||||
<< "patch to patch interpolators already exists"
|
||||
<< abort(FatalError);
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
|
||||
|
@ -74,8 +77,18 @@ void freeSurface::makeInterpolators()
|
|||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
interpolatorBAPtr_ = new patchToPatchInterpolation
|
||||
// patchToPatchInterpolation::setDirectHitTol(1e-2);
|
||||
|
||||
interpolatorBAPtr_ = new IOpatchToPatchInterpolation
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"baInterpolator",
|
||||
DB().timeName(),
|
||||
mesh(),
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh().boundaryMesh()[bPatchID()],
|
||||
mesh().boundaryMesh()[aPatchID()],
|
||||
intersection::VISIBLE
|
||||
|
@ -83,13 +96,141 @@ void freeSurface::makeInterpolators()
|
|||
);
|
||||
|
||||
|
||||
interpolatorABPtr_ = new patchToPatchInterpolation
|
||||
const scalarField& faceDistBA =
|
||||
interpolatorBAPtr_->faceDistanceToIntersection();
|
||||
|
||||
forAll(faceDistBA, faceI)
|
||||
{
|
||||
if(mag(faceDistBA[faceI] - GREAT) < SMALL)
|
||||
{
|
||||
FatalErrorIn("freeSurface::makeInterpolators()")
|
||||
<< "Error in B-to-A face patchToPatchInterpolation."
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
const scalarField& pointDistBA =
|
||||
interpolatorBAPtr_->pointDistanceToIntersection();
|
||||
|
||||
forAll(pointDistBA, pointI)
|
||||
{
|
||||
if(mag(pointDistBA[pointI] - GREAT) < SMALL)
|
||||
{
|
||||
FatalErrorIn("freeSurface::makeInterpolators()")
|
||||
<< "Error in B-to-A point patchToPatchInterpolation."
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
interpolatorABPtr_ = new IOpatchToPatchInterpolation
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"abInterpolator",
|
||||
DB().timeName(),
|
||||
mesh(),
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh().boundaryMesh()[aPatchID()],
|
||||
mesh().boundaryMesh()[bPatchID()],
|
||||
intersection::VISIBLE
|
||||
// intersection::HALF_RAY
|
||||
);
|
||||
|
||||
|
||||
const scalarField& faceDistAB =
|
||||
interpolatorABPtr_->faceDistanceToIntersection();
|
||||
|
||||
forAll(faceDistAB, faceI)
|
||||
{
|
||||
if(mag(faceDistAB[faceI] - GREAT) < SMALL)
|
||||
{
|
||||
FatalErrorIn("freeSurface::makeInterpolators()")
|
||||
<< "Error in A-to-B face patchToPatchInterpolation."
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
const scalarField& pointDistAB =
|
||||
interpolatorABPtr_->pointDistanceToIntersection();
|
||||
|
||||
forAll(pointDistAB, pointI)
|
||||
{
|
||||
if(mag(pointDistAB[pointI] - GREAT)<SMALL)
|
||||
{
|
||||
FatalErrorIn("freeSurface::makeInterpolators()")
|
||||
<< "Error in A-to-B point patchToPatchInterpolation."
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Info << "\nCheck A-to-B and B-to-A interpolators" << endl;
|
||||
|
||||
scalar maxDist = max
|
||||
(
|
||||
mag
|
||||
(
|
||||
interpolatorABPtr_->faceInterpolate
|
||||
(
|
||||
vectorField(mesh().boundaryMesh()[aPatchID()]
|
||||
.faceCentres())
|
||||
)
|
||||
- mesh().boundaryMesh()[bPatchID()].faceCentres()
|
||||
)
|
||||
);
|
||||
|
||||
scalar maxDistPt = max
|
||||
(
|
||||
mag
|
||||
(
|
||||
interpolatorABPtr_->pointInterpolate
|
||||
(
|
||||
vectorField(mesh().boundaryMesh()[aPatchID()]
|
||||
.localPoints())
|
||||
)
|
||||
- mesh().boundaryMesh()[bPatchID()].localPoints()
|
||||
)
|
||||
);
|
||||
|
||||
Info << "A-to-B interpolation error, face: " << maxDist
|
||||
<< ", point: " << maxDistPt << endl;
|
||||
|
||||
|
||||
maxDist = max
|
||||
(
|
||||
mag
|
||||
(
|
||||
interpolatorBAPtr_->faceInterpolate
|
||||
(
|
||||
vectorField
|
||||
(
|
||||
mesh().boundaryMesh()[bPatchID()].faceCentres()
|
||||
)
|
||||
)
|
||||
- mesh().boundaryMesh()[aPatchID()].faceCentres()
|
||||
)
|
||||
);
|
||||
|
||||
maxDistPt = max
|
||||
(
|
||||
mag
|
||||
(
|
||||
interpolatorBAPtr_->pointInterpolate
|
||||
(
|
||||
vectorField
|
||||
(
|
||||
mesh().boundaryMesh()[bPatchID()].localPoints()
|
||||
)
|
||||
)
|
||||
- mesh().boundaryMesh()[aPatchID()].localPoints()
|
||||
)
|
||||
);
|
||||
|
||||
Info << "B-to-A interpolation error, face: " << maxDist
|
||||
<< ", point: " << maxDistPt << endl;
|
||||
}
|
||||
|
||||
|
||||
|
@ -97,7 +238,7 @@ void freeSurface::makeControlPoints()
|
|||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "freeSurface::makeControlPoints(): "
|
||||
Info<< "freeSurface::makeControlPoints() : "
|
||||
<< "making control points"
|
||||
<< endl;
|
||||
}
|
||||
|
@ -107,16 +248,15 @@ void freeSurface::makeControlPoints()
|
|||
// if the pointer is already set
|
||||
if (controlPointsPtr_)
|
||||
{
|
||||
FatalErrorIn("freeSurface::makeControlPoints()")
|
||||
FatalErrorIn("freeSurface::makeInterpolators()")
|
||||
<< "patch to patch interpolators already exists"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
|
||||
IOobject controlPointsHeader
|
||||
(
|
||||
"controlPoints",
|
||||
time().timeName(),
|
||||
DB().timeName(),
|
||||
mesh(),
|
||||
IOobject::MUST_READ
|
||||
);
|
||||
|
@ -129,7 +269,7 @@ void freeSurface::makeControlPoints()
|
|||
IOobject
|
||||
(
|
||||
"controlPoints",
|
||||
time().timeName(),
|
||||
DB().timeName(),
|
||||
mesh(),
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
|
@ -144,13 +284,15 @@ void freeSurface::makeControlPoints()
|
|||
IOobject
|
||||
(
|
||||
"controlPoints",
|
||||
time().timeName(),
|
||||
DB().timeName(),
|
||||
mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
aMesh().areaCentres().internalField()
|
||||
);
|
||||
|
||||
initializeControlPointsPosition();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -183,10 +325,10 @@ void freeSurface::makeMotionPointsMask()
|
|||
}
|
||||
|
||||
|
||||
motionPointsMaskPtr_ = new scalarField
|
||||
motionPointsMaskPtr_ = new labelList
|
||||
(
|
||||
mesh().boundaryMesh()[aPatchID()].nPoints(),
|
||||
1.0
|
||||
1
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -219,7 +361,7 @@ void freeSurface::makeDirections()
|
|||
|
||||
if(aPatchID() == -1)
|
||||
{
|
||||
FatalErrorIn("freeSurface::makeMotionPointsMask()")
|
||||
FatalErrorIn("freeSurface::makeDirections()")
|
||||
<< "Free surface patch A not defined."
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
@ -229,17 +371,28 @@ void freeSurface::makeDirections()
|
|||
new vectorField
|
||||
(
|
||||
mesh().boundaryMesh()[aPatchID()].nPoints(),
|
||||
-(g_/mag(g_)).value()
|
||||
vector::zero
|
||||
);
|
||||
|
||||
|
||||
facesDisplacementDirPtr_ =
|
||||
new vectorField
|
||||
(
|
||||
mesh().boundaryMesh()[aPatchID()].size(),
|
||||
-(g_/mag(g_)).value()
|
||||
vector::zero
|
||||
);
|
||||
|
||||
if(!normalMotionDir())
|
||||
{
|
||||
if(mag(motionDir_) < SMALL)
|
||||
{
|
||||
FatalErrorIn("freeSurface::makeDirections()")
|
||||
<< "Zero motion direction"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
facesDisplacementDir() = motionDir_;
|
||||
pointsDisplacementDir() = motionDir_;
|
||||
}
|
||||
|
||||
updateDisplacementDirections();
|
||||
}
|
||||
|
@ -264,14 +417,13 @@ void freeSurface::makeTotalDisplacement()
|
|||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
|
||||
totalDisplacementPtr_ =
|
||||
new vectorIOField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"totalDisplacement",
|
||||
time().timeName(),
|
||||
DB().timeName(),
|
||||
mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
|
@ -304,13 +456,12 @@ void freeSurface::readTotalDisplacement()
|
|||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
|
||||
if
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"totalDisplacement",
|
||||
time().timeName(),
|
||||
DB().timeName(),
|
||||
mesh(),
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
|
@ -323,7 +474,7 @@ void freeSurface::readTotalDisplacement()
|
|||
IOobject
|
||||
(
|
||||
"totalDisplacement",
|
||||
time().timeName(),
|
||||
DB().timeName(),
|
||||
mesh(),
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
|
@ -333,7 +484,7 @@ void freeSurface::readTotalDisplacement()
|
|||
}
|
||||
|
||||
|
||||
void freeSurface::makeFaMesh()
|
||||
void freeSurface::makeFaMesh() const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
|
@ -342,7 +493,6 @@ void freeSurface::makeFaMesh()
|
|||
<< endl;
|
||||
}
|
||||
|
||||
|
||||
// It is an error to attempt to recalculate
|
||||
// if the pointer is already set
|
||||
if (aMeshPtr_)
|
||||
|
@ -352,76 +502,10 @@ void freeSurface::makeFaMesh()
|
|||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
|
||||
aMeshPtr_ = new faMesh(mesh());
|
||||
}
|
||||
|
||||
|
||||
void freeSurface::makeMeshMotionSolver()
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "freeSurface::makeMeshMotionSolver() : "
|
||||
<< "making mesh motion solver"
|
||||
<< endl;
|
||||
}
|
||||
|
||||
|
||||
// It is an error to attempt to recalculate
|
||||
// if the pointer is already set
|
||||
if (mSolverPtr_)
|
||||
{
|
||||
FatalErrorIn("freeSurface::makeMeshMotionSolver()")
|
||||
<< "mesh motion solver already exists"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
mSolverPtr_ = dynamic_cast<tetDecompositionMotionSolver*>
|
||||
(
|
||||
motionSolver::New(mesh()).ptr()
|
||||
);
|
||||
}
|
||||
|
||||
void freeSurface::makePatchPointInterpolators()
|
||||
{
|
||||
if (interpolatorAPtr_ || interpolatorBPtr_)
|
||||
{
|
||||
FatalErrorIn("freeSurface::makePatchPointInterpolators()")
|
||||
<< "mesh motion solver already exists"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
// Make interpolators
|
||||
if(aPatchID() != -1)
|
||||
{
|
||||
interpolatorAPtr_ =
|
||||
new tetPolyPatchInterpolation
|
||||
(
|
||||
refCast<const faceTetPolyPatch>
|
||||
(
|
||||
meshMotionSolver().motionU().boundaryField()
|
||||
[aPatchID()].patch()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if(bPatchID() != -1)
|
||||
{
|
||||
interpolatorBPtr_ =
|
||||
new tetPolyPatchInterpolation
|
||||
(
|
||||
refCast<const faceTetPolyPatch>
|
||||
(
|
||||
meshMotionSolver().motionU().boundaryField()
|
||||
[bPatchID()].patch()
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void freeSurface::makeUs()
|
||||
void freeSurface::makeUs() const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
|
@ -441,19 +525,57 @@ void freeSurface::makeUs()
|
|||
}
|
||||
|
||||
|
||||
wordList patchFieldTypes
|
||||
(
|
||||
aMesh().boundary().size(),
|
||||
zeroGradientFaPatchVectorField::typeName
|
||||
);
|
||||
|
||||
forAll(aMesh().boundary(), patchI)
|
||||
{
|
||||
if
|
||||
(
|
||||
aMesh().boundary()[patchI].type()
|
||||
== wedgeFaPatch::typeName
|
||||
)
|
||||
{
|
||||
patchFieldTypes[patchI] =
|
||||
wedgeFaPatchVectorField::typeName;
|
||||
}
|
||||
else
|
||||
{
|
||||
label ngbPolyPatchID =
|
||||
aMesh().boundary()[patchI].ngbPolyPatchIndex();
|
||||
|
||||
if (ngbPolyPatchID != -1)
|
||||
{
|
||||
if
|
||||
(
|
||||
mesh().boundary()[ngbPolyPatchID].type()
|
||||
== wallFvPatch::typeName
|
||||
)
|
||||
{
|
||||
patchFieldTypes[patchI] =
|
||||
slipFaPatchVectorField::typeName;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
UsPtr_ = new areaVectorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Us",
|
||||
time().timeName(),
|
||||
DB().timeName(),
|
||||
mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
aMesh(),
|
||||
dimensioned<vector>("Us", dimVelocity, vector::zero),
|
||||
zeroGradientFaPatchVectorField::typeName
|
||||
patchFieldTypes
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -483,7 +605,7 @@ void freeSurface::makePhis()
|
|||
IOobject
|
||||
(
|
||||
"phis",
|
||||
time().timeName(),
|
||||
DB().timeName(),
|
||||
mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
|
@ -493,7 +615,7 @@ void freeSurface::makePhis()
|
|||
}
|
||||
|
||||
|
||||
void freeSurface::makeSurfactConc()
|
||||
void freeSurface::makeSurfactConc() const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
|
@ -507,18 +629,17 @@ void freeSurface::makeSurfactConc()
|
|||
// if the pointer is already set
|
||||
if (surfactConcPtr_)
|
||||
{
|
||||
FatalErrorIn("freeSurface::makeUs()")
|
||||
FatalErrorIn("freeSurface::makeSurfaceConc()")
|
||||
<< "free-surface surfactant concentratio field already exists"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
|
||||
surfactConcPtr_ = new areaScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Cs",
|
||||
time().timeName(),
|
||||
DB().timeName(),
|
||||
mesh(),
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
|
@ -528,7 +649,7 @@ void freeSurface::makeSurfactConc()
|
|||
}
|
||||
|
||||
|
||||
void freeSurface::makeSurfaceTension()
|
||||
void freeSurface::makeSurfaceTension() const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
|
@ -553,7 +674,7 @@ void freeSurface::makeSurfaceTension()
|
|||
IOobject
|
||||
(
|
||||
"surfaceTension",
|
||||
time().timeName(),
|
||||
DB().timeName(),
|
||||
mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
|
@ -568,7 +689,7 @@ void freeSurface::makeSurfaceTension()
|
|||
}
|
||||
|
||||
|
||||
void freeSurface::makeSurfactant()
|
||||
void freeSurface::makeSurfactant() const
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
|
@ -594,6 +715,7 @@ void freeSurface::makeSurfactant()
|
|||
surfactantPtr_ = new surfactantProperties(surfactProp);
|
||||
}
|
||||
|
||||
|
||||
void freeSurface::makeFluidIndicator()
|
||||
{
|
||||
if (debug)
|
||||
|
@ -618,7 +740,7 @@ void freeSurface::makeFluidIndicator()
|
|||
IOobject
|
||||
(
|
||||
"fluidIndicator",
|
||||
time().timeName(),
|
||||
DB().timeName(),
|
||||
mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
|
@ -652,7 +774,7 @@ void freeSurface::makeFluidIndicator()
|
|||
{
|
||||
fluidIndicator[curCell] = 0.0;
|
||||
|
||||
for (int i = 0;i < cellCells[curCell].size();i++)
|
||||
for (int i = 0; i < cellCells[curCell].size(); i++)
|
||||
{
|
||||
slList.append(cellCells[curCell][i]);
|
||||
}
|
||||
|
@ -666,29 +788,7 @@ void freeSurface::makeFluidIndicator()
|
|||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
const tetPolyPatchInterpolation& freeSurface::interpolatorA()
|
||||
{
|
||||
if (!interpolatorAPtr_)
|
||||
{
|
||||
makePatchPointInterpolators();
|
||||
}
|
||||
|
||||
return *interpolatorAPtr_;
|
||||
}
|
||||
|
||||
|
||||
const tetPolyPatchInterpolation& freeSurface::interpolatorB()
|
||||
{
|
||||
if (!interpolatorBPtr_)
|
||||
{
|
||||
makePatchPointInterpolators();
|
||||
}
|
||||
|
||||
return *interpolatorBPtr_;
|
||||
}
|
||||
|
||||
|
||||
const patchToPatchInterpolation& freeSurface::interpolatorAB()
|
||||
const IOpatchToPatchInterpolation& freeSurface::interpolatorAB()
|
||||
{
|
||||
if (!interpolatorABPtr_)
|
||||
{
|
||||
|
@ -699,7 +799,7 @@ const patchToPatchInterpolation& freeSurface::interpolatorAB()
|
|||
}
|
||||
|
||||
|
||||
const patchToPatchInterpolation& freeSurface::interpolatorBA()
|
||||
const IOpatchToPatchInterpolation& freeSurface::interpolatorBA()
|
||||
{
|
||||
if (!interpolatorBAPtr_)
|
||||
{
|
||||
|
@ -721,7 +821,7 @@ vectorField& freeSurface::controlPoints()
|
|||
}
|
||||
|
||||
|
||||
scalarField& freeSurface::motionPointsMask()
|
||||
labelList& freeSurface::motionPointsMask()
|
||||
{
|
||||
if (!motionPointsMaskPtr_)
|
||||
{
|
||||
|
@ -775,18 +875,16 @@ faMesh& freeSurface::aMesh()
|
|||
return *aMeshPtr_;
|
||||
}
|
||||
|
||||
|
||||
tetDecompositionMotionSolver& freeSurface::meshMotionSolver()
|
||||
const faMesh& freeSurface::aMesh() const
|
||||
{
|
||||
if (!mSolverPtr_)
|
||||
if (!aMeshPtr_)
|
||||
{
|
||||
makeMeshMotionSolver();
|
||||
makeFaMesh();
|
||||
}
|
||||
|
||||
return *mSolverPtr_;
|
||||
return *aMeshPtr_;
|
||||
}
|
||||
|
||||
|
||||
areaVectorField& freeSurface::Us()
|
||||
{
|
||||
if (!UsPtr_)
|
||||
|
@ -797,6 +895,15 @@ areaVectorField& freeSurface::Us()
|
|||
return *UsPtr_;
|
||||
}
|
||||
|
||||
const areaVectorField& freeSurface::Us() const
|
||||
{
|
||||
if (!UsPtr_)
|
||||
{
|
||||
makeUs();
|
||||
}
|
||||
|
||||
return *UsPtr_;
|
||||
}
|
||||
|
||||
edgeScalarField& freeSurface::Phis()
|
||||
{
|
||||
|
@ -808,7 +915,6 @@ edgeScalarField& freeSurface::Phis()
|
|||
return *phisPtr_;
|
||||
}
|
||||
|
||||
|
||||
areaScalarField& freeSurface::surfactantConcentration()
|
||||
{
|
||||
if (!surfactConcPtr_)
|
||||
|
@ -819,6 +925,15 @@ areaScalarField& freeSurface::surfactantConcentration()
|
|||
return *surfactConcPtr_;
|
||||
}
|
||||
|
||||
const areaScalarField& freeSurface::surfactantConcentration() const
|
||||
{
|
||||
if (!surfactConcPtr_)
|
||||
{
|
||||
makeSurfactConc();
|
||||
}
|
||||
|
||||
return *surfactConcPtr_;
|
||||
}
|
||||
|
||||
areaScalarField& freeSurface::surfaceTension()
|
||||
{
|
||||
|
@ -830,8 +945,17 @@ areaScalarField& freeSurface::surfaceTension()
|
|||
return *surfaceTensionPtr_;
|
||||
}
|
||||
|
||||
const areaScalarField& freeSurface::surfaceTension() const
|
||||
{
|
||||
if (!surfaceTensionPtr_)
|
||||
{
|
||||
makeSurfaceTension();
|
||||
}
|
||||
|
||||
const surfactantProperties& freeSurface::surfactant()
|
||||
return *surfaceTensionPtr_;
|
||||
}
|
||||
|
||||
const surfactantProperties& freeSurface::surfactant() const
|
||||
{
|
||||
if (!surfactantPtr_)
|
||||
{
|
||||
|
@ -853,6 +977,31 @@ const volScalarField& freeSurface::fluidIndicator()
|
|||
}
|
||||
|
||||
|
||||
tmp<areaVectorField> freeSurface::surfaceTensionGrad()
|
||||
{
|
||||
tmp<areaVectorField> tgrad
|
||||
(
|
||||
new areaVectorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"surfaceTensionGrad",
|
||||
DB().timeName(),
|
||||
mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
(-fac::grad(surfactantConcentration())*
|
||||
surfactant().surfactR()*surfactant().surfactT()/
|
||||
(1.0 - surfactantConcentration()/
|
||||
surfactant().surfactSaturatedConc()))()
|
||||
)
|
||||
);
|
||||
|
||||
return tgrad;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright held by original author
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright held by original author
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright held by original author
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2004-2007 Z. Tukovic and H. Jasak
|
||||
\\ / A nd | Copyright held by original author
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
@ -79,6 +79,9 @@ class surfactantProperties
|
|||
//- Equilibrium surfactant concentration at the free-surface
|
||||
dimensionedScalar surfactEquilibriumConc_;
|
||||
|
||||
//- Is the surfactant soluble
|
||||
Switch soluble_;
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
|
@ -94,9 +97,14 @@ public:
|
|||
surfactR_("R", dimGasConstant*dimMass/dimMoles, 8.3144),
|
||||
surfactEquilibriumConc_
|
||||
(
|
||||
surfactSaturatedConc_/
|
||||
(1.0 + surfactDesorptionCoeff_/surfactBulkConc_)
|
||||
)
|
||||
surfactSaturatedConc_
|
||||
/(
|
||||
1.0
|
||||
+ surfactDesorptionCoeff_
|
||||
/surfactBulkConc_
|
||||
)
|
||||
),
|
||||
soluble_(dict.lookup("soluble"))
|
||||
{}
|
||||
|
||||
|
||||
|
@ -155,6 +163,12 @@ public:
|
|||
{
|
||||
return surfactEquilibriumConc_;
|
||||
}
|
||||
|
||||
//- Is the surfactant soluble
|
||||
Switch soluble() const
|
||||
{
|
||||
return soluble_;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -1,19 +1,15 @@
|
|||
EXE_INC = \
|
||||
-I../freeSurface \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/finiteArea/lnInclude \
|
||||
-I../include \
|
||||
-I../freeSurface/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/dynamicFvMesh/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/tetDecompositionFiniteElement/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/meshMotion/tetDecompositionMotionSolver/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/dynamicMesh/lnInclude \
|
||||
$(WM_DECOMP_INC)
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/finiteArea/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfreeSurface \
|
||||
-lfiniteVolume \
|
||||
-lfiniteArea \
|
||||
-lmeshTools \
|
||||
-ldynamicFvMesh \
|
||||
-ldynamicMesh \
|
||||
-lmeshTools \
|
||||
$(WM_DECOMP_LIBS) \
|
||||
-llduSolvers
|
||||
-lfiniteVolume \
|
||||
-lfiniteArea
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
Info<< "Reading field p\n" << endl;
|
||||
|
||||
Info<< "\nReading field p\n" << endl << flush;
|
||||
volScalarField p
|
||||
(
|
||||
IOobject
|
||||
|
@ -14,8 +14,7 @@ volScalarField p
|
|||
);
|
||||
|
||||
|
||||
Info<< "Reading field U\n" << endl;
|
||||
|
||||
Info<< "Reading field U\n" << endl << flush;
|
||||
volVectorField U
|
||||
(
|
||||
IOobject
|
||||
|
@ -30,7 +29,7 @@ volVectorField U
|
|||
);
|
||||
|
||||
|
||||
#include "createPhi.H"
|
||||
# include "createPhi.H"
|
||||
|
||||
|
||||
volScalarField rho
|
||||
|
@ -51,15 +50,49 @@ volScalarField rho
|
|||
freeSurface interface(mesh, rho, U, p, phi);
|
||||
|
||||
|
||||
rho = interface.fluidIndicator()*
|
||||
volScalarField* fluidIndicatorPtr = NULL;
|
||||
|
||||
if(Pstream::parRun())
|
||||
{
|
||||
fluidIndicatorPtr = new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"fluidIndicator",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
fluidIndicatorPtr = new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"fluidIndicator",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
interface.fluidIndicator()
|
||||
);
|
||||
}
|
||||
|
||||
volScalarField& fluidIndicator = *fluidIndicatorPtr;
|
||||
|
||||
|
||||
rho = fluidIndicator
|
||||
*(
|
||||
interface.rhoFluidA()
|
||||
- interface.rhoFluidB()
|
||||
)
|
||||
+ interface.rhoFluidB();
|
||||
|
||||
rho.correctBoundaryConditions();
|
||||
|
||||
|
||||
volScalarField mu
|
||||
(
|
||||
|
@ -69,14 +102,22 @@ volScalarField mu
|
|||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
interface.fluidIndicator()*(interface.muFluidA() - interface.muFluidB())
|
||||
fluidIndicator
|
||||
*(
|
||||
interface.muFluidA()
|
||||
- interface.muFluidB()
|
||||
)
|
||||
+ interface.muFluidB()
|
||||
);
|
||||
|
||||
// Read interpolators if present
|
||||
if (interface.twoFluids())
|
||||
{
|
||||
interface.interpolatorAB();
|
||||
}
|
||||
|
||||
surfaceScalarField phiNet =
|
||||
fvc::interpolate(rho)*(phi - fvc::meshPhi(rho, U));
|
||||
phiNet.rename("phiNet");
|
||||
|
||||
# include "setRefCell.H"
|
||||
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
if(Pstream::master())
|
||||
{
|
||||
Info<< "Free surface flux: sum local = "
|
||||
<< sum(mag(phi.boundaryField()[interface.aPatchID()]))
|
||||
<< ", global = "
|
||||
<< sum(phi.boundaryField()[interface.aPatchID()]) << endl;
|
||||
|
||||
Info<< "Free surface continuity error : sum local = " <<
|
||||
sum
|
||||
(
|
||||
mag
|
||||
(
|
||||
phiNet.boundaryField()[interface.aPatchID()]/
|
||||
interface.rhoFluidA().value()
|
||||
)
|
||||
)
|
||||
<< ", global = " <<
|
||||
sum
|
||||
(
|
||||
phiNet.boundaryField()[interface.aPatchID()]/
|
||||
interface.rhoFluidA().value()
|
||||
)
|
||||
<< endl << endl;
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2004-2007 Z. Tukovic and H. Jasak
|
||||
\\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
@ -23,29 +23,33 @@ License
|
|||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Application
|
||||
interTrackFoam
|
||||
interfaceTrackinFoam
|
||||
|
||||
Description
|
||||
Solver for 1 or 2 incompressible fluids, which tracks the interface
|
||||
using moving mesh
|
||||
Incompressible laminar CFD code for simulation of a single bubble rising
|
||||
in a stil liquid. Interface between fluid phases is tracked using moving
|
||||
mesh.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "motionSolver.H"
|
||||
#include "dynamicFvMesh.H"
|
||||
#include "freeSurface.H"
|
||||
#include "OFstream.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
# include "createMeshNoClear.H"
|
||||
# include "createFields.H"
|
||||
# include "initContinuityErrs.H"
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
# include "createDynamicFvMesh.H"
|
||||
|
||||
# include "createFields.H"
|
||||
|
||||
# include "initContinuityErrs.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
@ -53,79 +57,91 @@ int main(int argc, char *argv[])
|
|||
|
||||
for (runTime++; !runTime.end(); runTime++)
|
||||
{
|
||||
Info << "Time = " << runTime.value() << endl;
|
||||
Info << "Time = " << runTime.value() << endl << endl;
|
||||
|
||||
# include "readInterfaceSIMPLEControls.H"
|
||||
# include "CourantNo.H"
|
||||
|
||||
interface.updateDisplacementDirections();
|
||||
# include "readPISOControls.H"
|
||||
|
||||
interface.moveMeshPointsForOldFreeSurfDisplacement();
|
||||
|
||||
interface.smooth();
|
||||
interface.updateDisplacementDirections();
|
||||
|
||||
// --- SIMPLE loop
|
||||
for (label timeCorr=0; timeCorr<=nTimeCorr; timeCorr++)
|
||||
interface.predictPoints();
|
||||
|
||||
Pout<< "\nMax surface Courant Number = "
|
||||
<< interface.maxCourantNumber() << endl << endl;
|
||||
|
||||
for (int corr=0; corr<nOuterCorr; corr++)
|
||||
{
|
||||
p.storePrevIter();
|
||||
// Update interface bc
|
||||
interface.updateBoundaryConditions();
|
||||
|
||||
interface.correctBoundaryConditions();
|
||||
// Make the fluxes relative
|
||||
phi -= fvc::meshPhi(rho, U);
|
||||
|
||||
tmp<fvVectorMatrix> UEqn
|
||||
# include "CourantNo.H"
|
||||
|
||||
fvVectorMatrix UEqn
|
||||
(
|
||||
fvm::ddt(rho, U)
|
||||
+ fvm::div(phiNet, U)
|
||||
+ fvm::div(fvc::interpolate(rho)*phi, U, "div(phi,U)")
|
||||
- fvm::laplacian(mu, U)
|
||||
);
|
||||
|
||||
UEqn().relax();
|
||||
solve(UEqn == -fvc::grad(p));
|
||||
|
||||
solve(UEqn() == - fvc::grad(p));
|
||||
|
||||
volScalarField AU = UEqn().A();
|
||||
|
||||
U = UEqn().H()/AU;
|
||||
U.correctBoundaryConditions();
|
||||
|
||||
UEqn.clear();
|
||||
|
||||
phi = (fvc::interpolate(U) & mesh.Sf());
|
||||
|
||||
// Non-orthogonal pressure corrector loop
|
||||
for (label nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
// --- PISO loop
|
||||
for (int i=0; i<nCorr; i++)
|
||||
{
|
||||
tmp<fvScalarMatrix> pEqn
|
||||
(
|
||||
fvm::laplacian(1.0/AU, p) == fvc::div(phi)
|
||||
);
|
||||
volScalarField AU = UEqn.A();
|
||||
|
||||
pEqn().setReference(0, 0.0);
|
||||
pEqn().solve();
|
||||
U = UEqn.H()/AU;
|
||||
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
phi = (fvc::interpolate(U) & mesh.Sf());
|
||||
|
||||
# include "scalePhi.H"
|
||||
|
||||
// Non-orthogonal pressure corrector loop
|
||||
for (label nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
{
|
||||
phi -= pEqn().flux();
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
fvm::laplacian(1.0/AU, p)
|
||||
== fvc::div(phi)
|
||||
);
|
||||
|
||||
# include "setReference.H"
|
||||
|
||||
pEqn.solve();
|
||||
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
{
|
||||
phi -= pEqn.flux();
|
||||
}
|
||||
}
|
||||
|
||||
# include "continuityErrs.H"
|
||||
|
||||
// Momentum corrector
|
||||
U -= fvc::grad(p)/AU;
|
||||
U.correctBoundaryConditions();
|
||||
}
|
||||
|
||||
# include "continuityErrs.H"
|
||||
|
||||
// Explicitly relax pressure for momentum corrector
|
||||
p.relax();
|
||||
|
||||
// Momentum corrector
|
||||
U -= fvc::grad(p)/AU;
|
||||
U.correctBoundaryConditions();
|
||||
|
||||
// Move mesh
|
||||
interface.movePoints();
|
||||
|
||||
// Update motion fluxes
|
||||
phiNet = fvc::interpolate(rho)*(phi - fvc::meshPhi(rho, U));
|
||||
interface.correctPoints();
|
||||
|
||||
# include "freeSurfaceContinuityErrs.H"
|
||||
}
|
||||
|
||||
# include "volContinuity.H"
|
||||
|
||||
Info << "Total surface tension force: "
|
||||
<< interface.totalSurfaceTensionForce() << endl;
|
||||
|
||||
vector totalForce =
|
||||
interface.totalViscousForce()
|
||||
+ interface.totalPressureForce();
|
||||
|
||||
Info << "Total force: " << totalForce << endl;
|
||||
|
||||
runTime.write();
|
||||
|
||||
Info << "ExecutionTime = "
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
const dictionary& simple = mesh.solutionDict().subDict("SIMPLE");
|
||||
|
||||
int nTimeCorr = 0;
|
||||
|
||||
if (simple.found("nTimeCorrectors"))
|
||||
{
|
||||
nTimeCorr = readInt(simple.lookup("nTimeCorrectors"));
|
||||
}
|
||||
|
||||
int nNonOrthCorr = 0;
|
||||
|
||||
if (simple.found("nNonOrthogonalCorrectors"))
|
||||
{
|
||||
nNonOrthCorr = readInt(simple.lookup("nNonOrthogonalCorrectors"));
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
sloshingInterTrackFoam.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/sloshingInterTrackFoam
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
EXE_INC = \
|
||||
-I../freeSurface \
|
||||
-I$(LIB_SRC)/finiteArea/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/tetDecompositionFiniteElement/lnInclude \
|
||||
-I$(LIB_SRC)/dynamicMesh/meshMotion/tetDecompositionMotionSolver/lnInclude \
|
||||
$(WM_DECOMP_INC)
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfreeSurface \
|
||||
-lfiniteArea\
|
||||
-lfiniteVolume \
|
||||
-ldynamicMesh \
|
||||
-lmeshTools \
|
||||
$(WM_DECOMP_LIBS) \
|
||||
-llduSolvers
|
|
@ -1,80 +0,0 @@
|
|||
Info<< "Reading field p\n" << endl;
|
||||
|
||||
volScalarField p
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"p",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
|
||||
Info<< "Reading field U\n" << endl;
|
||||
|
||||
volVectorField U
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
|
||||
#include "createPhi.H"
|
||||
|
||||
|
||||
volScalarField rho
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rho",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("0", dimMass/dimVolume, 0)
|
||||
);
|
||||
|
||||
freeSurface interface(mesh, rho, U, p, phi);
|
||||
|
||||
rho = interface.fluidIndicator()*
|
||||
(
|
||||
interface.rhoFluidA()
|
||||
- interface.rhoFluidB()
|
||||
)
|
||||
+ interface.rhoFluidB();
|
||||
|
||||
|
||||
volScalarField mu
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"mu",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
interface.fluidIndicator()*
|
||||
(
|
||||
interface.muFluidA()
|
||||
- interface.muFluidB()
|
||||
)
|
||||
+ interface.muFluidB()
|
||||
);
|
||||
|
||||
|
||||
surfaceScalarField phiNet = fvc::interpolate(rho)*(phi - fvc::meshPhi(rho,U));
|
||||
phiNet.rename("phiNet");
|
|
@ -1,45 +0,0 @@
|
|||
mkDir(runTime.path()/"positions"/runTime.timeName());
|
||||
|
||||
OFstream positionsFile
|
||||
(
|
||||
runTime.path()
|
||||
/"positions"
|
||||
/runTime.timeName()
|
||||
/"leftAndRightPosition"
|
||||
);
|
||||
|
||||
positionsFile << "Time" << tab;
|
||||
|
||||
positionsFile << "Left" << tab << "Right" << endl;
|
||||
|
||||
|
||||
// Find left and right point label in the patch localPoints field
|
||||
|
||||
const pointField& locPoints =
|
||||
mesh.boundaryMesh()[interface.aPatchID()].localPoints();
|
||||
|
||||
label leftPointLabel = -1;
|
||||
label rightPointLabel = -1;
|
||||
|
||||
forAll(locPoints, pointI)
|
||||
{
|
||||
if(leftPointLabel == -1 || rightPointLabel == -1)
|
||||
{
|
||||
if(mag(locPoints[pointI].x()) < SMALL)
|
||||
{
|
||||
leftPointLabel = pointI;
|
||||
}
|
||||
else if(mag(locPoints[pointI].x() - 1.0) < SMALL)
|
||||
{
|
||||
rightPointLabel = pointI;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(leftPointLabel == -1 || rightPointLabel == -1)
|
||||
{
|
||||
Info << "Can't find left and right points labels!";
|
||||
return 0;
|
||||
}
|
||||
|
||||
// scalar dissipation = 0.0;
|
|
@ -1,29 +0,0 @@
|
|||
OFstream file
|
||||
(
|
||||
runTime.timePath()/"curvature.dat"
|
||||
);
|
||||
|
||||
const vectorField& C = interface.aMesh().areaCentres().internalField();
|
||||
const scalarField& K = interface.aMesh().faceCurvatures().internalField();
|
||||
|
||||
// const scalarField divUs = fac::div(Us)().internalField();
|
||||
|
||||
// const vectorField& nP = interface.aMesh().pointAreaNormals();
|
||||
// const vectorField& nF = interface.aMesh().faceAreaNormals();
|
||||
|
||||
// primitivePatchInterpolationZT
|
||||
// patchInterpolator(mesh.boundaryMesh()[movingPatchID]);
|
||||
|
||||
// vectorField nFAvr =
|
||||
// patchInterpolator.pointToFaceInterpolate(nP);
|
||||
|
||||
// nFAvr /= mag(nFAvr);
|
||||
|
||||
forAll(C, faceI)
|
||||
{
|
||||
file<< C[faceI].x() << ' '
|
||||
<< C[faceI].y() << ' '
|
||||
<< K[faceI] << endl;
|
||||
// << phi.boundaryField()[movingPatchID][faceI] << ' '
|
||||
// << (180.0/M_PI)*std::acos((nF[faceI])&(nFAvr[faceI])) << endl;
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
if(Pstream::master())
|
||||
{
|
||||
Info<< "Free surface flux: sum local = "
|
||||
<< sum(mag(phi.boundaryField()[interface.aPatchID()]))
|
||||
<< ", global = "
|
||||
<< sum(phi.boundaryField()[interface.aPatchID()]) << endl;
|
||||
|
||||
Info<< "Free surface continuity error : sum local = " <<
|
||||
sum
|
||||
(
|
||||
mag
|
||||
(
|
||||
phiNet.boundaryField()[interface.aPatchID()]/
|
||||
interface.rhoFluidA().value()
|
||||
)
|
||||
)
|
||||
<< ", global = " <<
|
||||
sum
|
||||
(
|
||||
phiNet.boundaryField()[interface.aPatchID()]/
|
||||
interface.rhoFluidA().value()
|
||||
)
|
||||
<< endl << endl;
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
const dictionary& simple = mesh.solutionDict().subDict("SIMPLE");
|
||||
|
||||
int nTimeCorr = 0;
|
||||
|
||||
if (simple.found("nTimeCorrectors"))
|
||||
{
|
||||
nTimeCorr = readInt(simple.lookup("nTimeCorrectors"));
|
||||
}
|
||||
|
||||
int nNonOrthCorr = 0;
|
||||
|
||||
if (simple.found("nNonOrthogonalCorrectors"))
|
||||
{
|
||||
nNonOrthCorr = readInt(simple.lookup("nNonOrthogonalCorrectors"));
|
||||
}
|
|
@ -1,155 +0,0 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2004-2007 Z. Tukovic and H. Jasak
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
Application
|
||||
sloshingInterTrackFoam
|
||||
|
||||
Description
|
||||
interTrackFoam application with data recording specific for 2D sloshing case
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "motionSolver.H"
|
||||
#include "freeSurface.H"
|
||||
#include "OFstream.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
# include "setRootCase.H"
|
||||
|
||||
# include "createTime.H"
|
||||
|
||||
# include "createMeshNoClear.H"
|
||||
|
||||
# include "createFields.H"
|
||||
|
||||
# include "initContinuityErrs.H"
|
||||
|
||||
# include "createPositions.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info << "\nStarting time loop\n" << endl;
|
||||
|
||||
# include "forceWriteData.H"
|
||||
|
||||
for (runTime++; !runTime.end(); runTime++)
|
||||
{
|
||||
Info << "Time = " << runTime.value() << endl;
|
||||
|
||||
# include "readInterfaceSIMPLEControls.H"
|
||||
# include "CourantNo.H"
|
||||
|
||||
interface.updateDisplacementDirections();
|
||||
|
||||
interface.moveMeshPointsForOldFreeSurfDisplacement();
|
||||
|
||||
// --- SIMPLE loop
|
||||
for (label timeCorr=0; timeCorr<=nTimeCorr; timeCorr++)
|
||||
{
|
||||
p.storePrevIter();
|
||||
|
||||
interface.correctBoundaryConditions();
|
||||
|
||||
tmp<fvVectorMatrix> UEqn
|
||||
(
|
||||
fvm::ddt(rho, U)
|
||||
+ fvm::div(phiNet, U)
|
||||
- fvm::laplacian(mu, U)
|
||||
);
|
||||
|
||||
UEqn().relax();
|
||||
|
||||
solve(UEqn() == - fvc::grad(p));
|
||||
|
||||
volScalarField AU = UEqn().A();
|
||||
|
||||
U = UEqn().H()/AU;
|
||||
U.correctBoundaryConditions();
|
||||
|
||||
UEqn.clear();
|
||||
|
||||
phi = (fvc::interpolate(U) & mesh.Sf());
|
||||
|
||||
|
||||
// Non-orthogonal pressure corrector loop
|
||||
for (label nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
{
|
||||
tmp<fvScalarMatrix> pEqn
|
||||
(
|
||||
fvm::laplacian(1.0/AU, p) == fvc::div(phi)
|
||||
);
|
||||
|
||||
pEqn().setReference(0, 0.0);
|
||||
pEqn().solve();
|
||||
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
{
|
||||
phi -= pEqn().flux();
|
||||
}
|
||||
}
|
||||
|
||||
# include "continuityErrs.H"
|
||||
|
||||
// Explicitly relax pressure for momentum corrector
|
||||
p.relax();
|
||||
|
||||
// Momentum corrector
|
||||
U -= fvc::grad(p)/AU;
|
||||
U.correctBoundaryConditions();
|
||||
|
||||
// Move mesh
|
||||
interface.movePoints();
|
||||
|
||||
// Update motion fluxes
|
||||
phiNet = fvc::interpolate(rho)*(phi - fvc::meshPhi(rho, U));
|
||||
|
||||
# include "freeSurfaceContinuityErrs.H"
|
||||
}
|
||||
|
||||
runTime.write();
|
||||
|
||||
# include "writeData.H"
|
||||
|
||||
if (runTime.outputTime())
|
||||
{
|
||||
# include "writePositions.H"
|
||||
}
|
||||
|
||||
Info << "ExecutionTime = "
|
||||
<< scalar(runTime.elapsedCpuTime())
|
||||
<< " s\n" << endl << endl;
|
||||
}
|
||||
|
||||
Info << "End\n" << endl;
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ************************************************************************* //
|
|
@ -1,4 +0,0 @@
|
|||
if (runTime.outputTime())
|
||||
{
|
||||
# include "forceWriteData.H"
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
|
||||
positionsFile << runTime.value() << tab;
|
||||
|
||||
const pointField& P =
|
||||
mesh.boundaryMesh()[interface.aPatchID()].localPoints();
|
||||
|
||||
// scalar ePot =
|
||||
// mag
|
||||
// (
|
||||
// rhoLiquid.value()*
|
||||
// sum((g.value()&mesh.C().internalField())*mesh.V())
|
||||
// );
|
||||
|
||||
// scalar eKin =
|
||||
// 0.5*rhoLiquid.value()*sum(magSqr(U)().internalField()*mesh.V());
|
||||
|
||||
|
||||
// tensorField gradU = fvc::grad(U, "test")().internalField();
|
||||
|
||||
// dissipation +=
|
||||
// 2.0*muLiquid.value()
|
||||
// *sum((symm(gradU) && gradU)*mesh.V())
|
||||
// *runTime.deltaT().value();
|
||||
|
||||
|
||||
// fvScalarMatrix eTotEqn
|
||||
// (
|
||||
// fvm::ddt(eTot)
|
||||
// + fvm::div(phi, eTot)
|
||||
// + dissipation
|
||||
// );
|
||||
|
||||
// eTotEqn.solve();
|
||||
|
||||
positionsFile.precision(12);
|
||||
|
||||
positionsFile << P[leftPointLabel].y() << tab
|
||||
<< P[rightPointLabel].y() << endl;
|
||||
// << ePot << tab
|
||||
// << eKin << tab
|
||||
// << ePot + eKin << tab
|
||||
// << ePot + eKin + dissipation << endl;
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright held by original author
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
|
|
@ -42,7 +42,6 @@ pointNormalsCorrectionPatches 0 ();
|
|||
|
||||
nFreeSurfaceCorrectors 1;
|
||||
|
||||
freeSurfaceSmoothing on;
|
||||
|
||||
surfactantProperties
|
||||
{
|
||||
|
|
|
@ -29,8 +29,8 @@ gradSchemes
|
|||
|
||||
divSchemes
|
||||
{
|
||||
default none;
|
||||
div(phi,U) Gauss GammaVDC 0.5;
|
||||
div(phiNet,U) Gauss GammaVDC 0.5;
|
||||
}
|
||||
|
||||
laplacianSchemes
|
||||
|
|
|
@ -34,19 +34,14 @@ solvers
|
|||
}
|
||||
}
|
||||
|
||||
SIMPLE
|
||||
PISO
|
||||
{
|
||||
nTimeCorrectors 4;
|
||||
nOuterCorrectors 6;
|
||||
nCorrectors 2;
|
||||
nNonOrthogonalCorrectors 1;
|
||||
|
||||
pRefPoint (0 0 0);
|
||||
pRefValue 0;
|
||||
}
|
||||
|
||||
relaxationFactors
|
||||
{
|
||||
p 0.7;
|
||||
U 0.7;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
cleanFaMesh ()
|
||||
{
|
||||
rm -rf ./constant/faMesh/faceLabels* \
|
||||
./constant/faMesh/boundary* \
|
||||
./constant/faMesh/faBoundary* \
|
||||
> /dev/null 2>&1
|
||||
}
|
||||
|
||||
|
|
|
@ -24,13 +24,12 @@ ddtSchemes
|
|||
gradSchemes
|
||||
{
|
||||
default Gauss linear;
|
||||
grad(p) Gauss linear;
|
||||
}
|
||||
|
||||
divSchemes
|
||||
{
|
||||
default none;
|
||||
div(phi,U) Gauss GammaVDC 0.5;
|
||||
div(phiNet,U) Gauss GammaVDC 0.5;
|
||||
}
|
||||
|
||||
laplacianSchemes
|
||||
|
@ -53,7 +52,7 @@ snGradSchemes
|
|||
|
||||
fluxRequired
|
||||
{
|
||||
p 0;
|
||||
p;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -35,16 +35,12 @@ solvers
|
|||
}
|
||||
}
|
||||
|
||||
SIMPLE
|
||||
PISO
|
||||
{
|
||||
nTimeCorrectors 5;
|
||||
nOuterCorrectors 5;
|
||||
nCorrectors 2;
|
||||
nNonOrthogonalCorrectors 1;
|
||||
}
|
||||
|
||||
relaxationFactors
|
||||
{
|
||||
p 0.7;
|
||||
U 0.7;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -26,9 +26,7 @@ boundaryField
|
|||
{
|
||||
walls
|
||||
{
|
||||
// type slip;
|
||||
type fixedValue;
|
||||
value uniform (0 0 0);
|
||||
type slip;
|
||||
}
|
||||
|
||||
freeSurface
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
cleanFaMesh ()
|
||||
{
|
||||
rm -rf ./constant/faMesh/faceLabels* \
|
||||
./constant/faMesh/boundary* \
|
||||
./constant/faMesh/faBoundary* \
|
||||
> /dev/null 2>&1
|
||||
}
|
||||
|
||||
|
|
|
@ -41,8 +41,6 @@ pointNormalsCorrectionPatches 2(inlet outlet);
|
|||
|
||||
nFreeSurfaceCorrectors 1;
|
||||
|
||||
freeSurfaceSmoothing on;
|
||||
|
||||
surfactantProperties
|
||||
{
|
||||
bulkConc bulkConc [ 0 -3 0 0 1 0 0 ] 1.0e-2;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 1.5 |
|
||||
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
|
||||
| \\ / O peration | Version: 1.6-ext |
|
||||
| \\ / A nd | Web: www.extend-project.de |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
|
|
|
@ -24,7 +24,6 @@ gradSchemes
|
|||
{
|
||||
default none;
|
||||
grad(Us) Gauss linear;
|
||||
grad((Us&faceAreaNormals)) Gauss linear;
|
||||
}
|
||||
|
||||
divSchemes
|
||||
|
|
|
@ -35,18 +35,11 @@ solvers
|
|||
}
|
||||
}
|
||||
|
||||
SIMPLE
|
||||
PISO
|
||||
{
|
||||
nTimeCorrectors 5;
|
||||
nOuterCorrectors 10;
|
||||
nCorrectors 2;
|
||||
nNonOrthogonalCorrectors 1;
|
||||
ddtPhiCorr no;
|
||||
}
|
||||
|
||||
relaxationFactors
|
||||
{
|
||||
p 0.7;
|
||||
U 0.7;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
cleanFaMesh ()
|
||||
{
|
||||
rm -rf ./constant/faMesh/faceLabels* \
|
||||
./constant/faMesh/boundary* \
|
||||
./constant/faMesh/faBoundary* \
|
||||
> /dev/null 2>&1
|
||||
}
|
||||
|
||||
|
|
|
@ -29,8 +29,8 @@ gradSchemes
|
|||
|
||||
divSchemes
|
||||
{
|
||||
defalut none;
|
||||
div(phi,U) Gauss linear;
|
||||
div(phiNet,U) Gauss linear;
|
||||
}
|
||||
|
||||
laplacianSchemes
|
||||
|
|
|
@ -35,18 +35,14 @@ solvers
|
|||
}
|
||||
}
|
||||
|
||||
SIMPLE
|
||||
PISO
|
||||
{
|
||||
nTimeCorrectors 10;
|
||||
nOuterCorrectors 10;
|
||||
nCorrectors 2;
|
||||
nNonOrthogonalCorrectors 1;
|
||||
pRefPoint (0.5 1.5 0);
|
||||
pRefValue 0;
|
||||
}
|
||||
|
||||
relaxationFactors
|
||||
{
|
||||
p 0.7;
|
||||
U 0.7;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
62
tutorials/surfaceTracking/interTrackFoam/tank3D/0/U
Normal file
62
tutorials/surfaceTracking/interTrackFoam/tank3D/0/U
Normal file
|
@ -0,0 +1,62 @@
|
|||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
|
||||
| \\ / O peration | Version: 1.6-ext |
|
||||
| \\ / A nd | Web: www.extend-project.de |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class volVectorField;
|
||||
location "0";
|
||||
object U;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [0 1 -1 0 0 0 0];
|
||||
|
||||
internalField uniform (0 0 0);
|
||||
|
||||
boundaryField
|
||||
{
|
||||
freeSurface
|
||||
{
|
||||
type fixedGradient;
|
||||
gradient uniform (0 0 0);
|
||||
}
|
||||
inlet
|
||||
{
|
||||
type fixedValue;
|
||||
value uniform (0 0 0.25);
|
||||
}
|
||||
outlet
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
bottom
|
||||
{
|
||||
type fixedValue;
|
||||
value uniform (0 0 0);
|
||||
}
|
||||
side-1
|
||||
{
|
||||
type slip;
|
||||
}
|
||||
side-2
|
||||
{
|
||||
type slip;
|
||||
}
|
||||
symm-1
|
||||
{
|
||||
type symmetryPlane;
|
||||
}
|
||||
symm-2
|
||||
{
|
||||
type symmetryPlane;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
63
tutorials/surfaceTracking/interTrackFoam/tank3D/0/motionU
Normal file
63
tutorials/surfaceTracking/interTrackFoam/tank3D/0/motionU
Normal file
|
@ -0,0 +1,63 @@
|
|||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
|
||||
| \\ / O peration | Version: 1.6-ext |
|
||||
| \\ / A nd | Web: www.extend-project.de |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class tetPointVectorField;
|
||||
location "0";
|
||||
object motionU;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [0 1 -1 0 0 0 0];
|
||||
|
||||
internalField uniform (0 0 0);
|
||||
|
||||
boundaryField
|
||||
{
|
||||
freeSurface
|
||||
{
|
||||
type fixedValue;
|
||||
value uniform (0 0 -1);
|
||||
}
|
||||
inlet
|
||||
{
|
||||
type fixedValue;
|
||||
value uniform (0 0 0);
|
||||
}
|
||||
outlet
|
||||
{
|
||||
type fixedValue;
|
||||
value uniform (0 0 0);
|
||||
}
|
||||
bottom
|
||||
{
|
||||
type fixedValue;
|
||||
value uniform (0 0 0);
|
||||
}
|
||||
side-1
|
||||
{
|
||||
type slip;
|
||||
}
|
||||
side-2
|
||||
{
|
||||
type slip;
|
||||
}
|
||||
symm-1
|
||||
{
|
||||
type symmetryPlane;
|
||||
}
|
||||
symm-2
|
||||
{
|
||||
type symmetryPlane;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
61
tutorials/surfaceTracking/interTrackFoam/tank3D/0/p
Normal file
61
tutorials/surfaceTracking/interTrackFoam/tank3D/0/p
Normal file
|
@ -0,0 +1,61 @@
|
|||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
|
||||
| \\ / O peration | Version: 1.6-ext |
|
||||
| \\ / A nd | Web: www.extend-project.de |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class volScalarField;
|
||||
location "0";
|
||||
object p;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [1 -1 -2 0 0 0 0];
|
||||
|
||||
internalField uniform 0;
|
||||
|
||||
boundaryField
|
||||
{
|
||||
freeSurface
|
||||
{
|
||||
type fixedValue;
|
||||
value uniform 0;
|
||||
}
|
||||
inlet
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
outlet
|
||||
{
|
||||
type fixedValue;
|
||||
value uniform 0;
|
||||
}
|
||||
bottom
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
side-1
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
side-2
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
symm-1
|
||||
{
|
||||
type symmetryPlane;
|
||||
}
|
||||
symm-2
|
||||
{
|
||||
type symmetryPlane;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
14
tutorials/surfaceTracking/interTrackFoam/tank3D/Allclean
Executable file
14
tutorials/surfaceTracking/interTrackFoam/tank3D/Allclean
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Source tutorial clean functions
|
||||
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
||||
|
||||
cleanFaMesh ()
|
||||
{
|
||||
rm -rf ./constant/faMesh/faceLabels* \
|
||||
./constant/faMesh/faBoundary* \
|
||||
> /dev/null 2>&1
|
||||
}
|
||||
|
||||
cleanCase
|
||||
cleanFaMesh
|
10
tutorials/surfaceTracking/interTrackFoam/tank3D/Allrun
Executable file
10
tutorials/surfaceTracking/interTrackFoam/tank3D/Allrun
Executable file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/sh
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
# Get application name from directory
|
||||
application="interTrackFoam"
|
||||
|
||||
runApplication blockMesh
|
||||
runApplication makeFaMesh
|
||||
runApplication $application
|
|
@ -0,0 +1,37 @@
|
|||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
|
||||
| \\ / O peration | Version: 1.6-ext |
|
||||
| \\ / A nd | Web: www.extend-project.de |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object dynamicMeshDict;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dynamicFvMesh dynamicMotionSolverFvMesh;
|
||||
|
||||
twoDMotion yes;
|
||||
|
||||
solver laplaceFaceDecomposition;
|
||||
|
||||
diffusivity quadratic;
|
||||
|
||||
distancePatches 1 (freeSurface);
|
||||
|
||||
frozenDiffusion yes;
|
||||
|
||||
pseudoSolid
|
||||
{
|
||||
poissonsRatio 0.3;
|
||||
nCorrectors 3;
|
||||
convergenceTolerance 1e-9;
|
||||
};
|
||||
|
||||
// ************************************************************************* //
|
|
@ -0,0 +1,51 @@
|
|||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
|
||||
| \\ / O peration | Version: 1.6-ext |
|
||||
| \\ / A nd | Web: www.extend-project.de |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object faMeshDefinition;
|
||||
}
|
||||
// ************************************************************************** //
|
||||
|
||||
polyMeshPatches 1( freeSurface );
|
||||
|
||||
boundary
|
||||
{
|
||||
symm-1
|
||||
{
|
||||
type symmetryPlane;
|
||||
ownerPolyPatch freeSurface;
|
||||
neighbourPolyPatch symm-1;
|
||||
}
|
||||
|
||||
symm-2
|
||||
{
|
||||
type symmetryPlane;
|
||||
ownerPolyPatch freeSurface;
|
||||
neighbourPolyPatch symm-2;
|
||||
}
|
||||
|
||||
side-1
|
||||
{
|
||||
type patch;
|
||||
ownerPolyPatch freeSurface;
|
||||
neighbourPolyPatch side-1;
|
||||
}
|
||||
|
||||
side-2
|
||||
{
|
||||
type patch;
|
||||
ownerPolyPatch freeSurface;
|
||||
neighbourPolyPatch side-2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************** //
|
|
@ -0,0 +1,63 @@
|
|||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
|
||||
| \\ / O peration | Version: 1.6-ext |
|
||||
| \\ / A nd | Web: www.extend-project.de |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object freeSurfaceProperties;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
twoFluids no;
|
||||
|
||||
normalMotionDir no;
|
||||
|
||||
motionDir (0 0 1);
|
||||
|
||||
cleanInterface yes;
|
||||
|
||||
muFluidA muFluidA [ 1 -1 -1 0 0 0 0 ] 0.01;
|
||||
|
||||
muFluidB muFluidB [ 1 -1 -1 0 0 0 0 ] 0;
|
||||
|
||||
rhoFluidA rhoFluidA [ 1 -3 0 0 0 0 0 ] 100;
|
||||
|
||||
rhoFluidB rhoFluidB [ 1 -3 0 0 0 0 0 ] 1.0;
|
||||
|
||||
surfaceTension surfaceTension [ 1 -2 0 0 0 0 0 ] 0;
|
||||
|
||||
g g [ 0 1 -2 0 0 0 0 ] (0 0 -9.81);
|
||||
|
||||
fixedFreeSurfacePatches 0( );
|
||||
|
||||
pointNormalsCorrectionPatches 4(side-1 side-2 symm-1 symm-2);
|
||||
|
||||
nFreeSurfaceCorrectors 1;
|
||||
|
||||
smoothing yes;
|
||||
|
||||
surfactantProperties
|
||||
{
|
||||
bulkConc bulkConc [ 0 -3 0 0 1 0 0 ] 1.0e-2;
|
||||
|
||||
saturatedConc saturatedSurfConc [ 0 -2 0 0 1 0 0 ] 5.0e-6;
|
||||
|
||||
adsorptionCoeff adsorptionCoeff [ 0 3 -1 0 -1 0 0 ] 40.0;
|
||||
|
||||
desorptionCoeff desorptionCoeff [ 0 -3 0 0 1 0 0 ] 8.93e-2;
|
||||
|
||||
bulkDiffusion bulkDiffusion [ 0 2 -1 0 0 0 0 ] 1.0e-9;
|
||||
|
||||
diffusion diffusion [ 0 2 -1 0 0 0 0 ] 1.0e-9;
|
||||
|
||||
temperature temperature [ 0 0 0 1 0 0 0 ] 293.0;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
|
@ -0,0 +1,149 @@
|
|||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
|
||||
| \\ / O peration | Version: 1.6-ext |
|
||||
| \\ / A nd | Web: www.extend-project.de |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object blockMeshDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
convertToMeters 0.1;
|
||||
|
||||
vertices
|
||||
(
|
||||
(0 0 0)
|
||||
(0.15 0 0)
|
||||
(0.4 0 0)
|
||||
(0.5 0 0)
|
||||
|
||||
(0 0.15 0)
|
||||
(0.15 0.15 0)
|
||||
(0.4 0.15 0)
|
||||
(0.5 0.15 0)
|
||||
|
||||
(0 0.4 0)
|
||||
(0.15 0.4 0)
|
||||
(0.4 0.4 0)
|
||||
(0.5 0.4 0)
|
||||
|
||||
(0 0.5 0)
|
||||
(0.15 0.5 0)
|
||||
(0.4 0.5 0)
|
||||
(0.5 0.5 0)
|
||||
|
||||
//
|
||||
(0 0 0.3)
|
||||
(0.15 0 0.3)
|
||||
(0.4 0 0.3)
|
||||
(0.5 0 0.3)
|
||||
|
||||
(0 0.15 0.3)
|
||||
(0.15 0.15 0.3)
|
||||
(0.4 0.15 0.3)
|
||||
(0.5 0.15 0.3)
|
||||
|
||||
(0 0.4 0.3)
|
||||
(0.15 0.4 0.3)
|
||||
(0.4 0.4 0.3)
|
||||
(0.5 0.4 0.3)
|
||||
|
||||
(0 0.5 0.3)
|
||||
(0.15 0.5 0.3)
|
||||
(0.4 0.5 0.3)
|
||||
(0.5 0.5 0.3)
|
||||
);
|
||||
|
||||
blocks
|
||||
(
|
||||
hex (0 1 5 4 16 17 21 20) (12 12 24) simpleGrading (1 1 0.5)
|
||||
hex (1 2 6 5 17 18 22 21) (20 12 24) simpleGrading (1 1 0.5)
|
||||
hex (2 3 7 6 18 19 23 22) (8 12 24) simpleGrading (1 1 0.5)
|
||||
hex (4 5 9 8 20 21 25 24) (12 20 24) simpleGrading (1 1 0.5)
|
||||
hex (5 6 10 9 21 22 26 25) (20 20 24) simpleGrading (1 1 0.5)
|
||||
hex (6 7 11 10 22 23 27 26) (8 20 24) simpleGrading (1 1 0.5)
|
||||
hex (8 9 13 12 24 25 29 28) (12 8 24) simpleGrading (1 1 0.5)
|
||||
hex (9 10 14 13 25 26 30 29) (20 8 24) simpleGrading (1 1 0.5)
|
||||
hex (10 11 15 14 26 27 31 30) (8 8 24) simpleGrading (1 1 0.5)
|
||||
);
|
||||
|
||||
edges
|
||||
(
|
||||
);
|
||||
|
||||
patches
|
||||
(
|
||||
patch freeSurface
|
||||
(
|
||||
(16 17 21 20)
|
||||
(17 18 22 21)
|
||||
(18 19 23 22)
|
||||
(20 21 25 24)
|
||||
(21 22 26 25)
|
||||
(22 23 27 26)
|
||||
(24 25 29 28)
|
||||
(25 26 30 29)
|
||||
(26 27 31 30)
|
||||
)
|
||||
|
||||
patch inlet
|
||||
(
|
||||
(4 5 1 0)
|
||||
)
|
||||
|
||||
patch outlet
|
||||
(
|
||||
(14 15 11 10)
|
||||
)
|
||||
|
||||
wall bottom
|
||||
(
|
||||
(5 6 2 1)
|
||||
(6 7 3 2)
|
||||
(8 9 5 4)
|
||||
(9 10 6 5)
|
||||
(10 11 7 6)
|
||||
(12 13 9 8)
|
||||
(13 14 10 9)
|
||||
)
|
||||
|
||||
wall side-1
|
||||
(
|
||||
(3 7 23 19)
|
||||
(7 11 27 23)
|
||||
(11 15 31 27)
|
||||
)
|
||||
|
||||
wall side-2
|
||||
(
|
||||
(15 14 30 31)
|
||||
(14 13 29 30)
|
||||
(13 12 28 29)
|
||||
)
|
||||
|
||||
symmetryPlane symm-1
|
||||
(
|
||||
(0 1 17 16)
|
||||
(1 2 18 17)
|
||||
(2 3 19 18)
|
||||
)
|
||||
|
||||
symmetryPlane symm-2
|
||||
(
|
||||
(12 8 24 28)
|
||||
(8 4 20 24)
|
||||
(4 0 16 20)
|
||||
)
|
||||
);
|
||||
|
||||
mergePatchPairs
|
||||
(
|
||||
);
|
||||
|
||||
// ************************************************************************* //
|
|
@ -0,0 +1,70 @@
|
|||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
|
||||
| \\ / O peration | Version: 1.6-ext |
|
||||
| \\ / A nd | Web: www.extend-project.de |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class polyBoundaryMesh;
|
||||
location "constant/polyMesh";
|
||||
object boundary;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
8
|
||||
(
|
||||
freeSurface
|
||||
{
|
||||
type patch;
|
||||
nFaces 1600;
|
||||
startFace 111680;
|
||||
}
|
||||
inlet
|
||||
{
|
||||
type patch;
|
||||
nFaces 144;
|
||||
startFace 113280;
|
||||
}
|
||||
outlet
|
||||
{
|
||||
type patch;
|
||||
nFaces 64;
|
||||
startFace 113424;
|
||||
}
|
||||
bottom
|
||||
{
|
||||
type wall;
|
||||
nFaces 1392;
|
||||
startFace 113488;
|
||||
}
|
||||
side-1
|
||||
{
|
||||
type wall;
|
||||
nFaces 960;
|
||||
startFace 114880;
|
||||
}
|
||||
side-2
|
||||
{
|
||||
type wall;
|
||||
nFaces 960;
|
||||
startFace 115840;
|
||||
}
|
||||
symm-1
|
||||
{
|
||||
type symmetryPlane;
|
||||
nFaces 960;
|
||||
startFace 116800;
|
||||
}
|
||||
symm-2
|
||||
{
|
||||
type symmetryPlane;
|
||||
nFaces 960;
|
||||
startFace 117760;
|
||||
}
|
||||
)
|
||||
|
||||
// ************************************************************************* //
|
|
@ -0,0 +1,48 @@
|
|||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
|
||||
| \\ / O peration | Version: 1.6-ext |
|
||||
| \\ / A nd | Web: www.extend-project.de |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "system";
|
||||
object controlDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application interTrackFoam;
|
||||
|
||||
startFrom latestTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
stopAt endTime;
|
||||
|
||||
endTime 10;
|
||||
|
||||
deltaT 0.001;
|
||||
|
||||
writeControl runTime;
|
||||
|
||||
writeInterval 0.01;
|
||||
|
||||
cycleWrite 0;
|
||||
|
||||
writeFormat ascii;
|
||||
|
||||
writeCompression compressed;
|
||||
|
||||
timeFormat general;
|
||||
|
||||
timePrecision 6;
|
||||
|
||||
runTimeModifiable yes;
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
|
||||
| \\ / O peration | Version: 1.6-ext |
|
||||
| \\ / A nd | Web: www.extend-project.de |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "system";
|
||||
object decomposeParDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
numberOfSubdomains 4;
|
||||
|
||||
method simple;
|
||||
|
||||
simpleCoeffs
|
||||
{
|
||||
n (2 2 1);
|
||||
delta 0.001;
|
||||
}
|
||||
|
||||
hierarchicalCoeffs
|
||||
{
|
||||
n (1 1 1);
|
||||
delta 0.001;
|
||||
order xyz;
|
||||
}
|
||||
|
||||
metisCoeffs
|
||||
{
|
||||
processorWeights
|
||||
(
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
);
|
||||
}
|
||||
|
||||
manualCoeffs
|
||||
{
|
||||
dataFile "";
|
||||
}
|
||||
|
||||
distributed no;
|
||||
|
||||
roots
|
||||
(
|
||||
);
|
||||
|
||||
// ************************************************************************* //
|
|
@ -0,0 +1,52 @@
|
|||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
|
||||
| \\ / O peration | Version: 1.6-ext |
|
||||
| \\ / A nd | Web: www.extend-project.de |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "system";
|
||||
object faSchemes;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
ddtSchemes
|
||||
{
|
||||
}
|
||||
|
||||
gradSchemes
|
||||
{
|
||||
default none;
|
||||
grad(Us) Gauss linear;
|
||||
}
|
||||
|
||||
divSchemes
|
||||
{
|
||||
default none;
|
||||
div(Us) Gauss linear;
|
||||
}
|
||||
|
||||
laplacianSchemes
|
||||
{
|
||||
}
|
||||
|
||||
interpolationSchemes
|
||||
{
|
||||
}
|
||||
|
||||
snGradSchemes
|
||||
{
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
|
@ -0,0 +1,20 @@
|
|||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
|
||||
| \\ / O peration | Version: 1.6-ext |
|
||||
| \\ / A nd | Web: www.extend-project.de |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "system";
|
||||
object faSolution;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// ************************************************************************* //
|
|
@ -0,0 +1,58 @@
|
|||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
|
||||
| \\ / O peration | Version: 1.6-ext |
|
||||
| \\ / A nd | Web: www.extend-project.de |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "system";
|
||||
object fvSchemes;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
ddtSchemes
|
||||
{
|
||||
ddt(rho,U) backward;
|
||||
}
|
||||
|
||||
gradSchemes
|
||||
{
|
||||
default Gauss linear;
|
||||
grad(p) Gauss linear;
|
||||
}
|
||||
|
||||
divSchemes
|
||||
{
|
||||
div(phi,U) Gauss GammaVDC 0.5;
|
||||
}
|
||||
|
||||
laplacianSchemes
|
||||
{
|
||||
default none;
|
||||
laplacian(mu,U) Gauss linear corrected;
|
||||
laplacian((1|A(U)),p) Gauss linear corrected;
|
||||
}
|
||||
|
||||
interpolationSchemes
|
||||
{
|
||||
default linear;
|
||||
}
|
||||
|
||||
snGradSchemes
|
||||
{
|
||||
default corrected;
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
{
|
||||
p;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
|
@ -0,0 +1,45 @@
|
|||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
|
||||
| \\ / O peration | Version: 1.6-ext |
|
||||
| \\ / A nd | Web: www.extend-project.de |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "system";
|
||||
object fvSolution;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
solvers
|
||||
{
|
||||
p
|
||||
{
|
||||
solver PCG;
|
||||
preconditioner DIC;
|
||||
tolerance 1e-07;
|
||||
relTol 0;
|
||||
}
|
||||
|
||||
U
|
||||
{
|
||||
solver PBiCG;
|
||||
preconditioner DILU;
|
||||
tolerance 1e-06;
|
||||
relTol 0;
|
||||
}
|
||||
}
|
||||
|
||||
PISO
|
||||
{
|
||||
nOuterCorrectors 10;
|
||||
nCorrectors 2;
|
||||
nNonOrthogonalCorrectors 1;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
|
@ -0,0 +1,30 @@
|
|||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM Extend Project: Open source CFD |
|
||||
| \\ / O peration | Version: 1.6-ext |
|
||||
| \\ / A nd | Web: www.extend-project.de |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "system";
|
||||
object tetFemSolution;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
solvers
|
||||
{
|
||||
motionU
|
||||
{
|
||||
solver PCG;
|
||||
preconditioner DIC;
|
||||
tolerance 1e-09;
|
||||
relTol 0.001;
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
|
@ -1,22 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
currDir=`pwd`
|
||||
application=`basename $currDir`
|
||||
cases="sphereTransport"
|
||||
|
||||
tutorialPath=`dirname $0`/..
|
||||
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
||||
|
||||
cleanFaMesh ()
|
||||
{
|
||||
rm -rf ./constant/faMesh/faceLabels* \
|
||||
./constant/faMesh/boundary* \
|
||||
> /dev/null 2>&1
|
||||
}
|
||||
|
||||
for case in $cases
|
||||
do
|
||||
(cd $case; cleanTimeDirectories)
|
||||
(cd $case; cleanFaMesh)
|
||||
done
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
currDir=`pwd`
|
||||
application=`basename $currDir`
|
||||
cases="sphereTransport"
|
||||
|
||||
tutorialPath=`dirname $0`/..
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
for case in $cases
|
||||
do
|
||||
(cd $case; runApplication makeFaMesh)
|
||||
(cd $case; runApplication $application)
|
||||
done
|
Reference in a new issue