Added icoLagrangianFoam (adaption from 1.5-dev). Tutorial runs now
--HG-- branch : porousLagrangianBranch rename : tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/g => tutorials/lagrangian/icoLagrangianFoam/channelParticles/constant/g
This commit is contained in:
parent
51ada73b08
commit
742628f19b
12 changed files with 379 additions and 69 deletions
|
@ -7,6 +7,8 @@ case="channelParticles"
|
|||
tutorialPath=`dirname $0`/..
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
compileApplication icoLagrangianFoam
|
||||
|
||||
(cd $case; runApplication blockMesh)
|
||||
(cd $case; runApplication $application)
|
||||
|
||||
|
|
|
@ -1,32 +1,22 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 1.0 |
|
||||
| \\ / A nd | Web: http://www.openfoam.org |
|
||||
| \\ / O peration | Version: 1.6 |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
|
||||
root "";
|
||||
case "";
|
||||
instance "";
|
||||
local "";
|
||||
|
||||
class dictionary;
|
||||
object cloudProperties;
|
||||
class uniformDimensionedVectorField;
|
||||
location "constant";
|
||||
object g;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
interpolationSchemes
|
||||
{
|
||||
U cellPointFace;
|
||||
// U cell;
|
||||
}
|
||||
dimensions [0 1 -2 0 0 0 0];
|
||||
value ( 0 -9.81 0 );
|
||||
|
||||
|
||||
// ************************************************************************* //
|
|
@ -1,44 +0,0 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 1.0 |
|
||||
| \\ / A nd | Web: http://www.openfoam.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
|
||||
root "";
|
||||
case "";
|
||||
instance "";
|
||||
local "";
|
||||
|
||||
class dictionary;
|
||||
object injectorProperties;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
(
|
||||
{
|
||||
position (0.01 0.05 0.005);
|
||||
direction (1 0 0);
|
||||
startTime 0.2;
|
||||
endTime 0.8;
|
||||
nParticles 20;
|
||||
}
|
||||
|
||||
{
|
||||
position (0.01 0.095 0.005);
|
||||
direction (1 0 0);
|
||||
startTime 0;
|
||||
endTime 1;
|
||||
nParticles 60;
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
// ************************************************************************* //
|
|
@ -0,0 +1,108 @@
|
|||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 1.5 |
|
||||
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object kinematicCloud1Properties;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
active yes;
|
||||
|
||||
// Particle sub-models
|
||||
InjectionModel ConeInjection;
|
||||
DragModel SphereDrag;
|
||||
DispersionModel none;
|
||||
PatchInteractionModel StandardWallInteraction;
|
||||
PostProcessingModel PatchPostProcessing;
|
||||
|
||||
// Parcel basis type
|
||||
parcelBasisType mass;
|
||||
|
||||
constantProperties{
|
||||
rhoMin rhoMin [ 1 -3 0 0 0 ] 1e-15;
|
||||
|
||||
// Minimum particle mass
|
||||
minParticleMass minParticleMass [ 1 0 0 0 0] 1.0e-15;
|
||||
|
||||
// Parcel thermo properties
|
||||
rho0 rho0 [ 1 -3 0 0 0] 5000;
|
||||
}
|
||||
|
||||
// Coupling between particles and carrier phase via source terms
|
||||
coupled true;
|
||||
|
||||
cellValueSourceCorrection on;
|
||||
|
||||
// Integer used to identify different parcel types
|
||||
parcelTypeId 2;
|
||||
|
||||
interpolationSchemes
|
||||
{
|
||||
rho cell;
|
||||
U cellPointFace;
|
||||
mu cell;
|
||||
}
|
||||
|
||||
integrationSchemes
|
||||
{
|
||||
U Euler;
|
||||
}
|
||||
|
||||
particleForces
|
||||
{
|
||||
gravity on;
|
||||
virtualMass off;
|
||||
pressureGradient off;
|
||||
}
|
||||
|
||||
ConeInjectionCoeffs
|
||||
{
|
||||
SOI 0.2;
|
||||
parcelBasisType mass;
|
||||
duration 0.6;
|
||||
position (0.01 0.05 0.005);
|
||||
direction (1 0 0);
|
||||
parcelsPerSecond 10000;
|
||||
volumeFlowRate constant 0.01;
|
||||
Umag constant 5.0;
|
||||
thetaInner constant 0.0;
|
||||
thetaOuter constant 30.0;
|
||||
parcelPDF
|
||||
{
|
||||
pdfType RosinRammler;
|
||||
RosinRammlerPDF
|
||||
{
|
||||
minValue 50.0e-06;
|
||||
maxValue 100.0e-06;
|
||||
d (75.0e-06);
|
||||
n (0.5);
|
||||
}
|
||||
}
|
||||
|
||||
// Total mass to inject
|
||||
massTotal massTotal [ 1 0 0 0 0] 2.0e-4;
|
||||
}
|
||||
|
||||
StandardWallInteractionCoeffs
|
||||
{
|
||||
type rebound;
|
||||
}
|
||||
|
||||
PatchPostProcessingCoeffs
|
||||
{
|
||||
maxStoredParcels 10000;
|
||||
patches (
|
||||
in
|
||||
out
|
||||
);
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
|
@ -1,8 +1,8 @@
|
|||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 1.5-dev |
|
||||
| \\ / 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
|
||||
|
|
|
@ -26,5 +26,6 @@ FoamFile
|
|||
|
||||
nu nu [0 2 -1 0 0 0 0] 0.01;
|
||||
|
||||
rho rho [1 -3 0 0 0 0 0] 0.5;
|
||||
|
||||
// ************************************************************************* //
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
particleNum
|
||||
{
|
||||
theTitle "Number of particles";
|
||||
expr "Current number of parcels + = (%f%)";
|
||||
titles ( nr);
|
||||
}
|
||||
particlesAdded
|
||||
{
|
||||
theTitle "Particles added";
|
||||
expr "Added (%f%) new parcels";
|
||||
titles ( nr );
|
||||
}
|
|
@ -34,11 +34,11 @@ stopAt endTime;
|
|||
|
||||
endTime 1.5;
|
||||
|
||||
deltaT 0.005;
|
||||
deltaT 0.001;
|
||||
|
||||
writeControl timeStep;
|
||||
|
||||
writeInterval 20;
|
||||
writeInterval 100;
|
||||
|
||||
purgeWrite 0;
|
||||
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
icoLagrangianFoam.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/icoLagrangianFoam
|
|
@ -0,0 +1,14 @@
|
|||
EXE_INC = \
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-llagrangian \
|
||||
-llagrangianIntermediate \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-lthermophysicalFunctions \
|
||||
-lradiation \
|
||||
-llduSolvers
|
|
@ -0,0 +1,102 @@
|
|||
Info<< "Reading transportProperties\n" << endl;
|
||||
|
||||
IOdictionary transportProperties
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"transportProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
|
||||
dimensionedScalar nu
|
||||
(
|
||||
transportProperties.lookup("nu")
|
||||
);
|
||||
|
||||
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"
|
||||
|
||||
|
||||
label pRefCell = 0;
|
||||
scalar pRefValue = 0.0;
|
||||
setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
|
||||
dimensionedScalar rhoVal
|
||||
(
|
||||
transportProperties.lookup("rho")
|
||||
);
|
||||
|
||||
// dummy-fields to satisfy the requirements of the kinematicCloud
|
||||
volScalarField rho
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rho",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
rhoVal,
|
||||
"zeroGradient"
|
||||
);
|
||||
|
||||
volScalarField mu
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"mu",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
rhoVal*nu,
|
||||
"zeroGradient"
|
||||
);
|
||||
|
||||
# include "readGravitationalAcceleration.H"
|
||||
|
||||
Info<< "Constructing kinematicCloud" << endl;
|
||||
basicKinematicCloud kinematicCloud
|
||||
(
|
||||
"kinematicCloud",
|
||||
rho,
|
||||
U,
|
||||
mu,
|
||||
g
|
||||
);
|
|
@ -0,0 +1,122 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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
|
||||
icoFoam
|
||||
|
||||
Description
|
||||
Transient solver for incompressible, laminar flow of Newtonian fluids
|
||||
.... with particles
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
|
||||
#include "basicKinematicCloud.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
# include "setRootCase.H"
|
||||
|
||||
# include "createTime.H"
|
||||
# include "createMesh.H"
|
||||
# include "createFields.H"
|
||||
# include "initContinuityErrs.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
|
||||
while (runTime.loop())
|
||||
{
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
# include "readPISOControls.H"
|
||||
# include "CourantNo.H"
|
||||
|
||||
Info<< "Evolving kinematicCloud" << endl;
|
||||
kinematicCloud.evolve();
|
||||
kinematicCloud.info();
|
||||
|
||||
fvVectorMatrix UEqn
|
||||
(
|
||||
fvm::ddt(U)
|
||||
+ fvm::div(phi, U)
|
||||
- fvm::laplacian(nu, U)
|
||||
==
|
||||
kinematicCloud.SU()/rho
|
||||
);
|
||||
|
||||
solve(UEqn == -fvc::grad(p));
|
||||
|
||||
// --- PISO loop
|
||||
|
||||
for (int corr=0; corr<nCorr; corr++)
|
||||
{
|
||||
volScalarField rUA = 1.0/UEqn.A();
|
||||
|
||||
U = rUA*UEqn.H();
|
||||
phi = (fvc::interpolate(U) & mesh.Sf())
|
||||
+ fvc::ddtPhiCorr(rUA, U, phi);
|
||||
|
||||
adjustPhi(phi, U, p);
|
||||
|
||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
fvm::laplacian(rUA, p) == fvc::div(phi)
|
||||
);
|
||||
|
||||
pEqn.setReference(pRefCell, pRefValue);
|
||||
pEqn.solve();
|
||||
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
{
|
||||
phi -= pEqn.flux();
|
||||
}
|
||||
}
|
||||
|
||||
# include "continuityErrs.H"
|
||||
|
||||
U -= rUA*fvc::grad(p);
|
||||
U.correctBoundaryConditions();
|
||||
}
|
||||
|
||||
runTime.write();
|
||||
|
||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
}
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
Reference in a new issue