Liquid film solvers, finite area reorganisation

This commit is contained in:
Hrvoje Jasak 2015-05-11 13:24:40 +01:00 committed by Dominik Christ
parent 4608dddc89
commit 95084dcb87
105 changed files with 15326 additions and 4 deletions

View file

@ -0,0 +1,3 @@
liquidFilmFoam.C
EXE = $(FOAM_APPBIN)/liquidFilmFoam

View file

@ -0,0 +1,7 @@
{
// Stabilisation of friction factor calculation
// Friction factor is defined with standard gravity
frictionFactor.internalField() =
mag(2*9.81*sqr(manningField.internalField())/
pow(mag(h.internalField()) + 1e-7, 1.0/3.0));
}

View file

@ -0,0 +1,13 @@
{
scalar CoNumSigma = max
(
sqrt
(
2*M_PI*sigma*sqr(aMesh.edgeInterpolation::deltaCoeffs())
*aMesh.edgeInterpolation::deltaCoeffs()
/rhol
)
).value()*runTime.deltaT().value();
Info<< "Max Capillary Courant Number = " << CoNumSigma << '\n' << endl;
}

View file

@ -0,0 +1,156 @@
Info << "Reading field h" << endl;
areaScalarField h
(
IOobject
(
"h",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
aMesh
);
Info << "Reading field Us" << endl;
areaVectorField Us
(
IOobject
(
"Us",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
aMesh
);
edgeScalarField phis
(
IOobject
(
"phis",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
fac::interpolate(Us) & aMesh.Le()
);
edgeScalarField phi2s
(
IOobject
(
"phi2s",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
fac::interpolate(h*Us) & aMesh.Le()
);
const areaVectorField& Ns = aMesh.faceAreaNormals();
areaVectorField Gs = g - Ns*(Ns & g);
areaScalarField Gn = mag(g - Gs);
// Mass source
areaScalarField Sm
(
IOobject
(
"Sm",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
aMesh,
dimensionedScalar("Sm", dimLength/dimTime, 0)
);
// Mass sink
areaScalarField Sd
(
IOobject
(
"Sd",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
aMesh,
dimensionedScalar("Sd", dimLength/dimTime, 0)
);
areaVectorField Ug
(
IOobject
(
"Sg",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
aMesh,
dimensionedVector("Ug", dimVelocity, vector::zero)
);
// Surface pressure
areaScalarField ps
(
IOobject
(
"ps",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
rhol*Gn*h - sigma*fac::laplacian(h)
);
// Friction factor
areaScalarField dotProduct
(
aMesh.faceAreaNormals() & (g/mag(g))
);
Info<< "View factor: min = " << min(dotProduct.internalField())
<< " max = " << max(dotProduct.internalField()) << endl;
areaScalarField manningField
(
IOobject
(
"manningField",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
aMesh
);
areaScalarField frictionFactor
(
IOobject
(
"frictionFactor",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
aMesh,
dimensionedScalar("one", dimless, 0.01)
);

View file

@ -0,0 +1,31 @@
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedVector("0", dimVelocity, vector::zero)
);
volScalarField H
(
IOobject
(
"H",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("0", dimLength, 0)
);
// Create volume-to surface mapping object
volSurfaceMapping vsm(aMesh);

View file

@ -0,0 +1,152 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration |
\\ / A nd | For copyright notice see file Copyright
\\/ 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Application
liquidFilmFoam
Description
Transient solver for incompressible, laminar flow of Newtonian fluids in
liquid film formulation.
Author
Zeljko Tukovic, FMENA
Hrvoje Jasak, Wikki Ltd. All rights reserved.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "faCFD.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
# include "setRootCase.H"
# include "createTime.H"
# include "createMesh.H"
# include "createFaMesh.H"
# include "readGravitationalAcceleration.H"
# include "readTransportProperties.H"
# include "createFaFields.H"
# include "createFvFields.H"
Info << "\nStarting time loop\n" << endl;
while (runTime.run())
{
# include "readSolutionControls.H"
# include "readTimeControls.H"
# include "surfaceCourantNo.H"
# include "capillaryCourantNo.H"
# include "setDeltaT.H"
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
for (int iCorr = 0; iCorr < nCorr; iCorr++)
{
phi2s = fac::interpolate(h)*phis;
# include "calcFrictionFactor.H"
faVectorMatrix UsEqn
(
fam::ddt(h, Us)
+ fam::div(phi2s, Us)
+ fam::Sp(0.0125*frictionFactor*mag(Us), Us)
==
Gs*h
- fam::Sp(Sd, Us)
);
UsEqn.relax();
solve(UsEqn == - fac::grad(ps*h)/rhol + ps*fac::grad(h)/rhol);
areaScalarField UsA = UsEqn.A();
Us = UsEqn.H()/UsA;
Us.correctBoundaryConditions();
phis = (fac::interpolate(Us) & aMesh.Le())
- fac::interpolate(1.0/(rhol*UsA))
*fac::lnGrad(ps*h)*aMesh.magLe()
+ fac::interpolate(ps/(rhol*UsA))
*fac::lnGrad(h)*aMesh.magLe();
faScalarMatrix hEqn
(
fam::ddt(h)
+ fam::div(phis, h)
==
Sm
- fam::Sp
(
Sd/(h + dimensionedScalar("small", dimLength, SMALL)),
h
)
);
hEqn.relax();
hEqn.solve();
phi2s = hEqn.flux();
// Bound h
h.internalField() = max
(
max
(
h.internalField(),
fac::average(max(h, h0))().internalField()
*pos(h0.value() - h.internalField())
),
h0.value()
);
ps = rhol*Gn*h - sigma*fac::laplacian(h);
ps.correctBoundaryConditions();
Us -= (1.0/(rhol*UsA))*fac::grad(ps*h)
- (ps/(rhol*UsA))*fac::grad(h);
Us.correctBoundaryConditions();
}
if (runTime.outputTime())
{
vsm.mapToVolume(h, H.boundaryField());
vsm.mapToVolume(Us, U.boundaryField());
runTime.write();
}
Info << "ExecutionTime = "
<< scalar(runTime.elapsedCpuTime())
<< " s\n" << endl << endl;
}
return(0);
}
// ************************************************************************* //

View file

@ -0,0 +1,13 @@
int nCorr = 0;
if (aMesh.solutionDict().found("nOuterCorrectors"))
{
nCorr =
readInt(aMesh.solutionDict().lookup("nOuterCorrectors"));
}
else
{
FatalErrorIn(args.executable())
<< "Cannot find number of correctors"
<< abort(FatalError);
}

View file

@ -0,0 +1,41 @@
IOdictionary transportProperties
(
IOobject
(
"transportProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
dimensionedScalar mug
(
transportProperties.lookup("mug")
);
dimensionedScalar mul
(
transportProperties.lookup("mul")
);
dimensionedScalar sigma
(
transportProperties.lookup("sigma")
);
dimensionedScalar rhol
(
transportProperties.lookup("rhol")
);
dimensionedScalar rhog
(
transportProperties.lookup("rhog")
);
dimensionedScalar h0
(
transportProperties.lookup("h0")
);

View file

@ -0,0 +1,59 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Global
surfaceCourantNo
Author
Hrvoje Jasak, Wikki Ltd. All rights reserved.
Description
Calculates and outputs the mean and maximum Courant Numbers for the
Finite Area method.
\*---------------------------------------------------------------------------*/
scalar CoNum = 0.0;
scalar meanCoNum = 0.0;
scalar velMag = 0.0;
if (aMesh.nInternalEdges())
{
edgeScalarField SfUfbyDelta =
aMesh.edgeInterpolation::deltaCoeffs()*mag(phis);
CoNum = max(SfUfbyDelta/aMesh.magLe())
.value()*runTime.deltaT().value();
meanCoNum = (sum(SfUfbyDelta)/sum(aMesh.magLe()))
.value()*runTime.deltaT().value();
velMag = max(mag(phis)/aMesh.magLe()).value();
}
Info<< "Courant Number mean: " << meanCoNum
<< " max: " << CoNum
<< " velocity magnitude: " << velMag << endl;
// ************************************************************************* //

View file

@ -22,7 +22,7 @@ License
along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
Application
finiteAreaFoam
surfactantFoam
Description

View file

@ -5,6 +5,5 @@ wclean freeSurface
wclean interTrackFoam
wclean bubbleInterTrackFoam
wclean surfactantFoam
wclean ./utilities/setFluidIndicator

View file

@ -1,8 +1,6 @@
#!/bin/sh
set -x
wmake surfactantFoam
wmake libso freeSurface
wmake interTrackFoam

View file

@ -0,0 +1,3 @@
checkFaMesh.C
EXE = $(FOAM_APPBIN)/checkFaMesh

View file

@ -0,0 +1,7 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/finiteArea/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lfiniteArea

View file

@ -0,0 +1,73 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Application
Check a Finite Area mesh
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "faCFD.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
# include "setRootCase.H"
# include "createTime.H"
# include "createMesh.H"
# include "createFaMesh.H"
Info<< "Time = " << runTime.timeName() << nl << endl;
// General mesh statistics
Info<< "Number of points: " << aMesh.nPoints() << nl
<< "Number of internal edges: " << aMesh.nInternalEdges() << nl
<< "Number of edges: " << aMesh.nEdges() << nl
<< "Number of faces: " << aMesh.nFaces() << nl
<< endl;
// Check geometry
Info<< "Face area: min = " << min(aMesh.S().field())
<< " max = " << max(aMesh.S().field()) << nl
<< "Internal edge length: min = "
<< min(aMesh.magLe().internalField()) << nl
<< " max = " << max(aMesh.magLe().internalField()) << nl
<< "Edge length: min = "
<< min(aMesh.magLe()).value() << nl
<< " max = " << max(aMesh.magLe()).value() << nl
<< "Face area normals: min = " << min(aMesh.faceAreaNormals().field())
<< " max = " << max(aMesh.faceAreaNormals().field()) << nl
<< endl;
return(0);
}
// ************************************************************************* //

View file

@ -0,0 +1,3 @@
createFaMeshFromStl.C
EXE = $(FOAM_APPBIN)/createFaMeshFromStl

View file

@ -0,0 +1,8 @@
EXE_INC = \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/finiteArea/lnInclude
EXE_LIBS = \
-ltriSurface \
-lmeshTools \
-lfiniteArea

View file

@ -0,0 +1,93 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Application
Create a Finite Area mesh from an STL file
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "triSurface.H"
#include "Time.H"
#include "polyMesh.H"
#include "faCFD.H"
#include "IFstream.H"
#include "graph.H"
#include "Tuple2.H"
#include "matchPoints.H"
#include "standAlonePatch.H"
#include "fixedValueFaPatchFields.H"
#include "zeroGradientFaPatchFields.H"
#include "inletOutletFaPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
argList::validArgs.append("STL mesh file");
argList args(argc, argv);
if (!args.check())
{
FatalError.exit();
}
fileName prefix(args.additionalArgs()[0]);
# include "createTime.H"
# include "makePolyMesh.H"
# include "makeFaMesh.H"
Info<< " done." << nl << endl;
Info<< nl << "Write mesh vtk files... ";
standAlonePatch::writeVTK
(
runTime.caseName() + "Mesh",
aMesh.patch().localFaces(),
aMesh.patch().localPoints()
);
standAlonePatch::writeVTKNormals
(
runTime.caseName() + "Normals",
aMesh.patch().localFaces(),
aMesh.patch().localPoints()
);
Info<< " done." << nl << endl;
Info<< "End\n" << endl;
return(0);
}
// ************************************************************************* //

View file

@ -0,0 +1 @@
faMesh aMesh(mesh, faceLabels);

View file

@ -0,0 +1,58 @@
triSurface patch(prefix + ".stl");
// Read patches
List<Tuple2<word, label> > patchNames(patch.patches().size());
forAll (patch.patches(), patchI)
{
patchNames[patchI] =
Tuple2<word, label>(patch.patches()[patchI].name(), patchI);
}
Info << "Patches: " << patchNames << endl;
// Create polyMesh
faceList faces(patch.size());
labelList faceLabels(patch.size());
labelList faceRegion(patch.size());
forAll (patch, faceI)
{
faces[faceI] = face(patch[faceI]);
faceLabels[faceI] = faceI;
faceRegion[faceI] = patch[faceI].region();
}
polyMesh mesh
(
IOobject
(
polyMesh::defaultRegion,
runTime.constant(),
runTime
),
xferCopy(patch.points()),
xferCopy(faces),
xferCopy(labelList(0)),
xferCopy(labelList(0)),
false
);
{
// Add zones
List<pointZone*> pz(0);
List<faceZone*> fz(1);
List<cellZone*> cz(0);
fz[0] = new faceZone
(
"roof",
faceLabels,
boolList(patch.size(), false),
0,
mesh.faceZones()
);
mesh.addPatches(List<polyPatch*>(0), true);
mesh.addZones(pz, fz, cz);
}

View file

@ -0,0 +1,3 @@
makeFaMesh.C
EXE = $(FOAM_APPBIN)/makeFaMesh

View file

@ -0,0 +1,8 @@
EXE_INC = \
-I$(LIB_SRC)/finiteArea/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/cfdTools/general/lnInclude
EXE_LIBS = \
-lfiniteArea \
-lfiniteVolume

View file

@ -0,0 +1,328 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration |
\\ / A nd | For copyright notice see file Copyright
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of foam-extend.
foam-extend 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 3 of the License, or (at your
option) any later version.
foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
Application
makeFaMesh
Description
A mesh generator for finite area mesh.
\*---------------------------------------------------------------------------*/
#include "objectRegistry.H"
#include "Time.H"
#include "argList.H"
#include "OSspecific.H"
#include "faMesh.H"
#include "fvMesh.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
class faPatchData
{
public:
word name_;
word type_;
dictionary dict_;
label ownPolyPatchID_;
label ngbPolyPatchID_;
labelList edgeLabels_;
faPatchData()
:
name_(word::null),
type_(word::null),
ownPolyPatchID_(-1),
ngbPolyPatchID_(-1)
{}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
# include "setRootCase.H"
# include "createTime.H"
# include "createMesh.H"
// Reading faMeshDefinition dictionary
IOdictionary faMeshDefinition
(
IOobject
(
"faMeshDefinition",
runTime.constant(),
"faMesh",
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
wordList polyMeshPatches
(
faMeshDefinition.lookup("polyMeshPatches")
);
dictionary bndDict = faMeshDefinition.subDict("boundary");
wordList faPatchNames = bndDict.toc();
List<faPatchData> faPatches(faPatchNames.size()+1);
forAll (faPatchNames, patchI)
{
dictionary curPatchDict =
bndDict.subDict(faPatchNames[patchI]);
faPatches[patchI].name_ = faPatchNames[patchI];
faPatches[patchI].type_ =
word(curPatchDict.lookup("type"));
word ownName = curPatchDict.lookup("ownerPolyPatch");
faPatches[patchI].ownPolyPatchID_ =
mesh.boundaryMesh().findPatchID(ownName);
if ( faPatches[patchI].ownPolyPatchID_ < 0 )
{
FatalErrorIn("makeFaMesh:")
<< "neighbourPolyPatch " << ownName << " does not exist"
<< exit(FatalError);
}
word neiName = curPatchDict.lookup("neighbourPolyPatch");
faPatches[patchI].ngbPolyPatchID_ =
mesh.boundaryMesh().findPatchID(neiName);
if ( faPatches[patchI].ngbPolyPatchID_ < 0 )
{
FatalErrorIn("makeFaMesh:")
<< "neighbourPolyPatch " << neiName << " does not exist"
<< exit(FatalError);
}
}
// Setting faceLabels list size
label size = 0;
labelList patchIDs(polyMeshPatches.size(), -1);
forAll (polyMeshPatches, patchI)
{
patchIDs[patchI] =
mesh.boundaryMesh().findPatchID(polyMeshPatches[patchI]);
if ( patchIDs[patchI] < 0 )
{
FatalErrorIn("makeFaMesh:")
<< "Patch " << polyMeshPatches[patchI] << " does not exist"
<< exit(FatalError);
}
size += mesh.boundaryMesh()[patchIDs[patchI]].size();
}
labelList faceLabels(size, -1);
sort(patchIDs);
// Filling of faceLabels list
label faceI = -1;
forAll (polyMeshPatches, patchI)
{
label start = mesh.boundaryMesh()[patchIDs[patchI]].start();
label size = mesh.boundaryMesh()[patchIDs[patchI]].size();
for(label i = 0; i < size; i++)
{
faceLabels[++faceI] = start + i;
}
}
// Creating faMesh
Info << "Create faMesh ... ";
faMesh areaMesh
(
mesh,
faceLabels
);
Info << "Done" << endl;
// Determination of faPatch ID for each boundary edge.
// Result is in the bndEdgeFaPatchIDs list
const indirectPrimitivePatch& patch = areaMesh.patch();
labelList faceCells(faceLabels.size(), -1);
forAll (faceCells, faceI)
{
label faceID = faceLabels[faceI];
faceCells[faceI] = mesh.faceOwner()[faceID];
}
labelList meshEdges =
patch.meshEdges
(
mesh.edges(),
mesh.cellEdges(),
faceCells
);
const labelListList& edgeFaces = mesh.edgeFaces();
const label nTotalEdges = patch.nEdges();
const label nInternalEdges = patch.nInternalEdges();
labelList bndEdgeFaPatchIDs(nTotalEdges - nInternalEdges, -1);
for (label edgeI = nInternalEdges; edgeI < nTotalEdges; edgeI++)
{
label curMeshEdge = meshEdges[edgeI];
labelList curEdgePatchIDs(2, -1);
label patchI = -1;
forAll (edgeFaces[curMeshEdge], faceI)
{
label curFace = edgeFaces[curMeshEdge][faceI];
label curPatchID = mesh.boundaryMesh().whichPatch(curFace);
if (curPatchID != -1)
{
curEdgePatchIDs[++patchI] = curPatchID;
}
}
for(label pI = 0; pI < faPatches.size() - 1; pI++)
{
if
(
(
curEdgePatchIDs[0] == faPatches[pI].ownPolyPatchID_
&& curEdgePatchIDs[1] == faPatches[pI].ngbPolyPatchID_
)
||
(
curEdgePatchIDs[1] == faPatches[pI].ownPolyPatchID_
&& curEdgePatchIDs[0] == faPatches[pI].ngbPolyPatchID_
)
)
{
bndEdgeFaPatchIDs[edgeI - nInternalEdges] = pI;
break;
}
}
}
// Set edgeLabels for each faPatch
for(label pI=0; pI<(faPatches.size()-1); pI++)
{
SLList<label> tmpList;
forAll (bndEdgeFaPatchIDs, eI)
{
if (bndEdgeFaPatchIDs[eI] == pI)
{
tmpList.append(nInternalEdges + eI);
}
}
faPatches[pI].edgeLabels_ = tmpList;
}
// Check for undefined edges
SLList<label> tmpList;
forAll (bndEdgeFaPatchIDs, eI)
{
if (bndEdgeFaPatchIDs[eI] == -1)
{
tmpList.append(nInternalEdges + eI);
}
}
if (tmpList.size() > 0)
{
label pI = faPatches.size()-1;
faPatches[pI].name_ = "undefined";
faPatches[pI].type_ = "patch";
faPatches[pI].edgeLabels_ = tmpList;
}
// Add good patches to faMesh
SLList<faPatch*> faPatchLst;
for(label pI = 0; pI < faPatches.size(); pI++)
{
faPatches[pI].dict_.add("type", faPatches[pI].type_);
faPatches[pI].dict_.add("edgeLabels", faPatches[pI].edgeLabels_);
faPatches[pI].dict_.add
(
"ngbPolyPatchIndex",
faPatches[pI].ngbPolyPatchID_
);
if(faPatches[pI].edgeLabels_.size() > 0)
{
faPatchLst.append
(
faPatch::New
(
faPatches[pI].name_,
faPatches[pI].dict_,
pI,
areaMesh.boundary()
).ptr()
);
}
}
Info << "Add faPatches ... ";
areaMesh.addFaPatches(List<faPatch*>(faPatchLst));
Info << "Done" << endl;
// Writing faMesh
Info << "Write finite area mesh ... ";
areaMesh.write();
Info << "Done" << endl;
return(0);
}
// ************************************************************************* //

View file

@ -0,0 +1,52 @@
# git-ls-files --others --exclude-from=.git/info/exclude
# Lines that start with '#' are comments.
# editor and misc backup files - anywhere
*~
.*~
*.bak
*.bak[0-9][0-9]
*.orig
*.orig[0-9][0-9]
\#*\#
# file-browser settings - anywhere
.directory
# CVS recovered versions - anywhere
.#*
# SVN directories - anywhere
.svn/
# OpenFOAM results
[0-9]*/
!/0/
processor*
*/polyMesh/*
!*/polyMesh/blockMeshDict
cellToRegion*
log*
# packages - anywhere
*.tar.bz2
*.tar.gz
*.tar
*.tgz
*.gtgz
# Pictures and movies
*.png
*.jpg
*.jpeg
*.bmp
*.png
*.avi
*.mp4
*.mpg
#end-of-file

View file

@ -0,0 +1,50 @@
/*--------------------------------*- 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 areaVectorField;
location "0";
object Us;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type zeroGradient;
}
side
{
type slip;
}
symmetry
{
type symmetryPlane;
}
cylinder
{
type slip;
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View file

@ -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 areaScalarField;
location "0";
object h;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 0 0 0 0 0];
internalField uniform 0.000141;
boundaryField
{
inlet
{
type fixedValue;
value uniform 0.000141;
}
outlet
{
type zeroGradient;
}
side
{
type zeroGradient;
}
symmetry
{
type symmetryPlane;
}
cylinder
{
type zeroGradient;
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View file

@ -0,0 +1,50 @@
/*--------------------------------*- 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 areaScalarField;
location "0";
object manningField;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 0 0 0 0 0];
internalField uniform 0.1;
boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type zeroGradient;
}
side
{
type zeroGradient;
}
symmetry
{
type symmetryPlane;
}
cylinder
{
type zeroGradient;
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View file

@ -0,0 +1,7 @@
#!/bin/sh
# Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
cleanCase
cleanFaMesh

View file

@ -0,0 +1,10 @@
#!/bin/sh
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Set application name
application="liquidFilmFoam"
runApplication blockMesh
runApplication makeFaMesh
runApplication $application

View file

@ -0,0 +1,292 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 3.1 |
| \\ / A nd | Web: http://www.extend-project.de |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class faBoundaryMesh;
location "constant/faMesh";
object faBoundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
5
(
inlet
{
type patch;
edgeLabels List<label>
30
(
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4060
4062
4063
4064
4065
4066
4067
4068
4069
4070
)
;
ngbPolyPatchIndex 3;
}
outlet
{
type patch;
edgeLabels List<label>
30
(
3929
3931
3932
3933
3934
3935
3936
3937
3938
3939
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3979
)
;
ngbPolyPatchIndex 1;
}
side
{
type patch;
edgeLabels List<label>
60
(
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3978
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
)
;
ngbPolyPatchIndex 2;
}
symmetry
{
type symmetryPlane;
edgeLabels List<label>
60
(
3891
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3930
4061
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4100
)
;
ngbPolyPatchIndex 0;
}
cylinder
{
type patch;
edgeLabels List<label>
40
(
3890
3892
3893
3894
3895
3896
3897
3898
3899
3900
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4099
4101
4102
4103
4104
4105
4106
4107
4108
4109
)
;
ngbPolyPatchIndex 4;
}
)
// ************************************************************************* //

View file

@ -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 "constant/faMesh";
object faMeshDefinition;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
polyMeshPatches 1( film );
boundary
{
inlet
{
type patch;
ownerPolyPatch film;
neighbourPolyPatch inlet;
}
outlet
{
type patch;
ownerPolyPatch film;
neighbourPolyPatch outlet;
}
side
{
type patch;
ownerPolyPatch film;
neighbourPolyPatch side;
}
symmetry
{
type symmetryPlane;
ownerPolyPatch film;
neighbourPolyPatch symmetry;
}
cylinder
{
type patch;
ownerPolyPatch film;
neighbourPolyPatch cylinder;
}
}
// ************************************************************************** //

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,21 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 3.1 |
| \\ / A nd | Web: http://www.extend-project.de |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class uniformDimensionedVectorField;
location "constant";
object g;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -2 0 0 0 0];
value (4.905 0 -8.4957);
// ************************************************************************* //

View file

@ -0,0 +1,161 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 0.016;
vertices
(
(0.5 0 0)
(1 0 0)
(2 0 0)
(2 0.707107 0)
(0.707107 0.707107 0)
(0.353553 0.353553 0)
(2 2 0)
(0.707107 2 0)
(0 2 0)
(0 1 0)
(0 0.5 0)
(-0.5 0 0)
(-1 0 0)
(-2 0 0)
(-2 0.707107 0)
(-0.707107 0.707107 0)
(-0.353553 0.353553 0)
(-2 2 0)
(-0.707107 2 0)
(0.5 0 0.5)
(1 0 0.5)
(2 0 0.5)
(2 0.707107 0.5)
(0.707107 0.707107 0.5)
(0.353553 0.353553 0.5)
(2 2 0.5)
(0.707107 2 0.5)
(0 2 0.5)
(0 1 0.5)
(0 0.5 0.5)
(-0.5 0 0.5)
(-1 0 0.5)
(-2 0 0.5)
(-2 0.707107 0.5)
(-0.707107 0.707107 0.5)
(-0.353553 0.353553 0.5)
(-2 2 0.5)
(-0.707107 2 0.5)
);
blocks
(
hex (5 4 9 10 24 23 28 29) (10 10 1) simpleGrading (1 1 1)
hex (0 1 4 5 19 20 23 24) (10 10 1) simpleGrading (1 1 1)
hex (1 2 3 4 20 21 22 23) (20 10 1) simpleGrading (1 1 1)
hex (4 3 6 7 23 22 25 26) (20 20 1) simpleGrading (1 1 1)
hex (9 4 7 8 28 23 26 27) (10 20 1) simpleGrading (1 1 1)
hex (15 16 10 9 34 35 29 28) (10 10 1) simpleGrading (1 1 1)
hex (12 11 16 15 31 30 35 34) (10 10 1) simpleGrading (1 1 1)
hex (13 12 15 14 32 31 34 33) (20 10 1) simpleGrading (1 1 1)
hex (14 15 18 17 33 34 37 36) (20 20 1) simpleGrading (1 1 1)
hex (15 9 8 18 34 28 27 37) (10 20 1) simpleGrading (1 1 1)
);
edges
(
arc 0 5 (0.469846 0.17101 0)
arc 5 10 (0.17101 0.469846 0)
arc 1 4 (0.939693 0.34202 0)
arc 4 9 (0.34202 0.939693 0)
arc 19 24 (0.469846 0.17101 0.5)
arc 24 29 (0.17101 0.469846 0.5)
arc 20 23 (0.939693 0.34202 0.5)
arc 23 28 (0.34202 0.939693 0.5)
arc 11 16 (-0.469846 0.17101 0)
arc 16 10 (-0.17101 0.469846 0)
arc 12 15 (-0.939693 0.34202 0)
arc 15 9 (-0.34202 0.939693 0)
arc 30 35 (-0.469846 0.17101 0.5)
arc 35 29 (-0.17101 0.469846 0.5)
arc 31 34 (-0.939693 0.34202 0.5)
arc 34 28 (-0.34202 0.939693 0.5)
);
patches
(
symmetryPlane symmetry
(
(0 1 20 19)
(1 2 21 20)
(12 11 30 31)
(13 12 31 32)
)
patch outlet
(
(2 3 22 21)
(3 6 25 22)
)
patch side
(
(7 8 27 26)
(6 7 26 25)
(8 18 37 27)
(18 17 36 37)
)
patch inlet
(
(14 13 32 33)
(17 14 33 36)
)
wall cylinder
(
(10 5 24 29)
(5 0 19 24)
(16 10 29 35)
(11 16 35 30)
)
patch film
(
(5 4 1 0)
(4 3 2 1)
(7 6 3 4)
(8 7 4 9)
(9 4 5 10)
(18 8 9 15)
(15 9 10 16)
(17 18 15 14)
(14 15 12 13)
(15 16 11 12)
)
patch top
(
(19 20 23 24)
(20 21 22 23)
(23 22 25 26)
(29 24 23 28)
(28 23 26 27)
(35 29 28 34)
(34 28 27 37)
(32 31 34 33)
(33 34 37 36)
(31 30 35 34)
)
);
mergePatchPairs
(
);
// ************************************************************************* //

View file

@ -0,0 +1,28 @@
/*--------------------------------*- 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 transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
mug mug [0 2 -1 0 0 0 0] 0;
mul mul [0 2 -1 0 0 0 0] 1e-3;
rhog rhog [ 1 -3 0 0 0 0 0 ] 1;
rhol rhol [ 1 -3 0 0 0 0 0 ] 100;
sigma sigma [ 1 0 -2 0 0 0 0 ] 0.1;
h0 h0 [ 0 1 0 0 0 0 0] 1e-10;
// ************************************************************************* //

View file

@ -0,0 +1,55 @@
/*--------------------------------*- 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 liquidFilmFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 10;
deltaT 0.0002;
writeControl timeStep;
writeInterval 100;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
adjustTimeStep no;
maxCo 5;
maxDeltaT 0.1;
// ************************************************************************* //

View file

@ -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 faSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
ddt(h,Us) Euler;
ddt(h) Euler;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
default none;
div(phis,h) Gauss Gamma 0.5;
div(phi2s,Us) Gauss linearUpwind;
}
laplacianSchemes
{
default none;
laplacian(h) Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
fluxRequired
{
h;
}
// ************************************************************************* //

View file

@ -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 faSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
Us
{
solver BiCGStab;
preconditioner ILU0;
tolerance 1e-07;
relTol 0.01;
}
h
{
solver BiCGStab;
preconditioner ILU0;
tolerance 1e-07;
relTol 0.01;
}
}
nOuterCorrectors 15;
relaxationFactors
{
h 0.5;
Us 0.5;
}
// ************************************************************************* //

View file

@ -0,0 +1,53 @@
/*--------------------------------*- 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
{
default none;
}
gradSchemes
{
default none;
}
divSchemes
{
default none;
}
laplacianSchemes
{
default none;
}
interpolationSchemes
{
default none;
}
snGradSchemes
{
default none;
}
fluxRequired
{
}
// ************************************************************************* //

View file

@ -0,0 +1,19 @@
/*--------------------------------*- 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;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View file

@ -0,0 +1,52 @@
# git-ls-files --others --exclude-from=.git/info/exclude
# Lines that start with '#' are comments.
# editor and misc backup files - anywhere
*~
.*~
*.bak
*.bak[0-9][0-9]
*.orig
*.orig[0-9][0-9]
\#*\#
# file-browser settings - anywhere
.directory
# CVS recovered versions - anywhere
.#*
# SVN directories - anywhere
.svn/
# OpenFOAM results
[0-9]*/
!/0/
processor*
*/polyMesh/*
!*/polyMesh/blockMeshDict
cellToRegion*
log*
# packages - anywhere
*.tar.bz2
*.tar.gz
*.tar
*.tgz
*.gtgz
# Pictures and movies
*.png
*.jpg
*.jpeg
*.bmp
*.png
*.avi
*.mp4
*.mpg
#end-of-file

View file

@ -0,0 +1,47 @@
/*--------------------------------*- 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 areaVectorField;
location "0";
object Us;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
referenceLevel (0 0 0);
boundaryField
{
left
{
type zeroGradient;
}
right
{
type zeroGradient;
}
front
{
type zeroGradient;
}
back
{
type zeroGradient;
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View file

@ -0,0 +1,47 @@
/*--------------------------------*- 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 areaScalarField;
location "0";
object h;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 0 0 0 0 0];
internalField uniform 0;
referenceLevel 0;
boundaryField
{
left
{
type zeroGradient;
}
right
{
type zeroGradient;
}
front
{
type zeroGradient;
}
back
{
type zeroGradient;
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View file

@ -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 areaScalarField;
location "0";
object manningField;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 0 0 0 0 0];
internalField uniform 0.01;
boundaryField
{
left
{
type zeroGradient;
}
right
{
type zeroGradient;
}
front
{
type zeroGradient;
}
back
{
type zeroGradient;
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View file

@ -0,0 +1,9 @@
#!/bin/sh
# Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
\rm -f 0/h 0/h.gz
cleanCase
cleanFaMesh

View file

@ -0,0 +1,14 @@
#!/bin/sh
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Set application name
application="liquidFilmFoam"
\cp -f ./0/h.org ./0/h
runApplication blockMesh
runApplication makeFaMesh
compileApplication setInitialDroplet
runApplication setInitialDroplet
runApplication $application

View file

@ -0,0 +1,462 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 3.1 |
| \\ / A nd | Web: http://www.extend-project.de |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class faBoundaryMesh;
location "constant/faMesh";
object faBoundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
4
(
left
{
type patch;
edgeLabels List<label>
100
(
19800
19802
19803
19804
19805
19806
19807
19808
19809
19810
19811
19812
19813
19814
19815
19816
19817
19818
19819
19820
19821
19822
19823
19824
19825
19826
19827
19828
19829
19830
19831
19832
19833
19834
19835
19836
19837
19838
19839
19840
19841
19842
19843
19844
19845
19846
19847
19848
19849
19850
19851
19852
19853
19854
19855
19856
19857
19858
19859
19860
19861
19862
19863
19864
19865
19866
19867
19868
19869
19870
19871
19872
19873
19874
19875
19876
19877
19878
19879
19880
19881
19882
19883
19884
19885
19886
19887
19888
19889
19890
19891
19892
19893
19894
19895
19896
19897
19898
19899
19900
)
;
ngbPolyPatchIndex 1;
}
right
{
type patch;
edgeLabels List<label>
100
(
20098
20100
20101
20102
20103
20104
20105
20106
20107
20108
20109
20110
20111
20112
20113
20114
20115
20116
20117
20118
20119
20120
20121
20122
20123
20124
20125
20126
20127
20128
20129
20130
20131
20132
20133
20134
20135
20136
20137
20138
20139
20140
20141
20142
20143
20144
20145
20146
20147
20148
20149
20150
20151
20152
20153
20154
20155
20156
20157
20158
20159
20160
20161
20162
20163
20164
20165
20166
20167
20168
20169
20170
20171
20172
20173
20174
20175
20176
20177
20178
20179
20180
20181
20182
20183
20184
20185
20186
20187
20188
20189
20190
20191
20192
20193
20194
20195
20196
20197
20199
)
;
ngbPolyPatchIndex 2;
}
front
{
type patch;
edgeLabels List<label>
100
(
19801
19902
19904
19906
19908
19910
19912
19914
19916
19918
19920
19922
19924
19926
19928
19930
19932
19934
19936
19938
19940
19942
19944
19946
19948
19950
19952
19954
19956
19958
19960
19962
19964
19966
19968
19970
19972
19974
19976
19978
19980
19982
19984
19986
19988
19990
19992
19994
19996
19998
20000
20002
20004
20006
20008
20010
20012
20014
20016
20018
20020
20022
20024
20026
20028
20030
20032
20034
20036
20038
20040
20042
20044
20046
20048
20050
20052
20054
20056
20058
20060
20062
20064
20066
20068
20070
20072
20074
20076
20078
20080
20082
20084
20086
20088
20090
20092
20094
20096
20099
)
;
ngbPolyPatchIndex 3;
}
back
{
type patch;
edgeLabels List<label>
100
(
19901
19903
19905
19907
19909
19911
19913
19915
19917
19919
19921
19923
19925
19927
19929
19931
19933
19935
19937
19939
19941
19943
19945
19947
19949
19951
19953
19955
19957
19959
19961
19963
19965
19967
19969
19971
19973
19975
19977
19979
19981
19983
19985
19987
19989
19991
19993
19995
19997
19999
20001
20003
20005
20007
20009
20011
20013
20015
20017
20019
20021
20023
20025
20027
20029
20031
20033
20035
20037
20039
20041
20043
20045
20047
20049
20051
20053
20055
20057
20059
20061
20063
20065
20067
20069
20071
20073
20075
20077
20079
20081
20083
20085
20087
20089
20091
20093
20095
20097
20198
)
;
ngbPolyPatchIndex 4;
}
)
// ************************************************************************* //

View file

@ -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 "constant/faMesh";
object faMeshDefinition;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
polyMeshPatches 1( film );
boundary
{
left
{
type patch;
ownerPolyPatch film;
neighbourPolyPatch left;
}
right
{
type patch;
ownerPolyPatch film;
neighbourPolyPatch right;
}
front
{
type patch;
ownerPolyPatch film;
neighbourPolyPatch front;
}
back
{
type patch;
ownerPolyPatch film;
neighbourPolyPatch back;
}
}
// ************************************************************************** //

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,21 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 3.1 |
| \\ / A nd | Web: http://www.extend-project.de |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class uniformDimensionedVectorField;
location "constant";
object g;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -2 0 0 0 0];
value (0 0 -9.81);
// ************************************************************************* //

View file

@ -0,0 +1,74 @@
/*--------------------------------*- 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 "constant/faMesh";
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
vertices
(
(-0.005 -0.005 0)
( 0.005 -0.005 0)
( 0.005 0.005 0)
(-0.005 0.005 0)
(-0.005 -0.005 0.001)
( 0.005 -0.005 0.001)
( 0.005 0.005 0.001)
(-0.005 0.005 0.001)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (100 100 1) simpleGrading (1 1 1)
);
edges
(
);
patches
(
wall film
(
(3 2 1 0)
)
wall left
(
(4 7 3 0)
)
wall right
(
(1 2 6 5)
)
wall front
(
(0 1 5 4)
)
wall back
(
(2 3 7 6)
)
wall top
(
(4 5 6 7)
)
);
mergePatchPairs
(
);
// ************************************************************************* //

View file

@ -0,0 +1,29 @@
/*--------------------------------*- 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 transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
mug mug [0 2 -1 0 0 0 0] 0;
mul mul [0 2 -1 0 0 0 0] 1e-3;
rhog rhog [ 1 -3 0 0 0 0 0 ] 1;
rhol rhol [ 1 -3 0 0 0 0 0 ] 1000;
sigma sigma [ 1 0 -2 0 0 0 0 ] 20;
h0 ho [0 1 0 0 0 0 0] 1e-10;
// ************************************************************************* //

View file

@ -0,0 +1,3 @@
setInitialDroplet.C
EXE = $(FOAM_APPBIN)/setInitialDroplet

View file

@ -0,0 +1,9 @@
EXE_INC = \
-I$(LIB_SRC)/finiteArea/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
-lfiniteArea \
-lfiniteVolume \
-lmeshTools

View file

@ -0,0 +1,16 @@
IOdictionary transportProperties
(
IOobject
(
"transportProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
dimensionedScalar h0
(
transportProperties.lookup("h0")
);

View file

@ -0,0 +1,86 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Set inital film thickness for droplet spreading case.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "faCFD.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
# include "setRootCase.H"
# include "createTime.H"
# include "createMesh.H"
# include "createFaMesh.H"
# include "readTransportProperties.H"
Info << "Reading field h" << endl;
areaScalarField h
(
IOobject
(
"h",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
aMesh
);
scalar D = 0.000038;
scalar A = 0.0014;
scalar R = (sqr(A) + sqr(D))/(2*D);
Info << "Spherical cap radius: " << R << " m" << endl;
scalarField& hI = h.internalField();
const vectorField& Cf = aMesh.areaCentres().internalField();
scalarField a = sqrt
(
sqr(Cf.component(vector::X))
+ sqr(Cf.component(vector::Y))
);
hI = pos(A - a)*(sqrt(sqr(R) - sqr(a)) - (R - D))
+ neg(A - a)*h0.value();
h.write();
Info<< "\nEnd" << endl;
return 0;
}
// ************************************************************************* //

View file

@ -0,0 +1,55 @@
/*--------------------------------*- 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 liquidFilmFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 0.05;
deltaT 2.5e-7;
writeControl timeStep;
writeInterval 100;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
adjustTimeStep no;
maxCo 5;
maxDeltaT 0.1;
// ************************************************************************* //

View file

@ -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 faSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
ddt(h,Us) Euler;
ddt(h) Euler;
}
gradSchemes
{
default Gauss linear;
grad(p) Gauss linear;
}
divSchemes
{
default none;
div(phis,h) Gauss Gamma 0.5;
div(phi2s,Us) Gauss Gamma 0.5;
}
laplacianSchemes
{
default none;
laplacian(h) Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
fluxRequired
{
h;
}
// ************************************************************************* //

View file

@ -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 faSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
Us
{
solver BiCGStab;
preconditioner ILU0;
tolerance 1e-07;
relTol 0.01;
}
h
{
solver BiCGStab;
preconditioner ILU0;
tolerance 1e-07;
relTol 0.01;
}
}
nOuterCorrectors 15;
relaxationFactors
{
h 0.5;
Us 0.5;
}
// ************************************************************************* //

View file

@ -0,0 +1,53 @@
/*--------------------------------*- 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
{
default none;
}
gradSchemes
{
default none;
}
divSchemes
{
default none;
}
laplacianSchemes
{
default none;
}
interpolationSchemes
{
default none;
}
snGradSchemes
{
default none;
}
fluxRequired
{
}
// ************************************************************************* //

View file

@ -0,0 +1,19 @@
/*--------------------------------*- 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;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View file

@ -0,0 +1,9 @@
EXE_INC = \
-I$(LIB_SRC)/finiteArea/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/cfdTools/general/lnInclude
EXE_LIBS = \
-lfiniteArea \
-lfiniteVolume \
-llduSolvers

Some files were not shown because too many files have changed in this diff Show more