From 742628f19b6eb5ddc18ab4369a3b3dda9c9b8c4a Mon Sep 17 00:00:00 2001 From: "Bernhard F.W. Gschaider" Date: Mon, 25 Oct 2010 21:26:50 +0200 Subject: [PATCH] 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 --- tutorials/lagrangian/icoLagrangianFoam/Allrun | 2 + .../constant/{cloudProperties => g} | 30 ++--- .../constant/injectorProperties | 44 ------- .../constant/kinematicCloudProperties | 108 ++++++++++++++++ .../constant/polyMesh/boundary | 6 +- .../constant/transportProperties | 1 + .../channelParticles/customRegexp | 12 ++ .../channelParticles/system/controlDict | 4 +- .../icoLagrangianFoam/Make/files | 3 + .../icoLagrangianFoam/Make/options | 14 ++ .../icoLagrangianFoam/createFields.H | 102 +++++++++++++++ .../icoLagrangianFoam/icoLagrangianFoam.C | 122 ++++++++++++++++++ 12 files changed, 379 insertions(+), 69 deletions(-) rename tutorials/lagrangian/icoLagrangianFoam/channelParticles/constant/{cloudProperties => g} (52%) delete mode 100644 tutorials/lagrangian/icoLagrangianFoam/channelParticles/constant/injectorProperties create mode 100644 tutorials/lagrangian/icoLagrangianFoam/channelParticles/constant/kinematicCloudProperties create mode 100644 tutorials/lagrangian/icoLagrangianFoam/channelParticles/customRegexp create mode 100644 tutorials/lagrangian/icoLagrangianFoam/icoLagrangianFoam/Make/files create mode 100644 tutorials/lagrangian/icoLagrangianFoam/icoLagrangianFoam/Make/options create mode 100644 tutorials/lagrangian/icoLagrangianFoam/icoLagrangianFoam/createFields.H create mode 100644 tutorials/lagrangian/icoLagrangianFoam/icoLagrangianFoam/icoLagrangianFoam.C diff --git a/tutorials/lagrangian/icoLagrangianFoam/Allrun b/tutorials/lagrangian/icoLagrangianFoam/Allrun index be6536cf7..0d128b94d 100755 --- a/tutorials/lagrangian/icoLagrangianFoam/Allrun +++ b/tutorials/lagrangian/icoLagrangianFoam/Allrun @@ -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) diff --git a/tutorials/lagrangian/icoLagrangianFoam/channelParticles/constant/cloudProperties b/tutorials/lagrangian/icoLagrangianFoam/channelParticles/constant/g similarity index 52% rename from tutorials/lagrangian/icoLagrangianFoam/channelParticles/constant/cloudProperties rename to tutorials/lagrangian/icoLagrangianFoam/channelParticles/constant/g index 9c751cad8..27d4d3248 100644 --- a/tutorials/lagrangian/icoLagrangianFoam/channelParticles/constant/cloudProperties +++ b/tutorials/lagrangian/icoLagrangianFoam/channelParticles/constant/g @@ -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; + version 2.0; + format ascii; + class uniformDimensionedVectorField; + location "constant"; + object g; } - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -interpolationSchemes -{ - U cellPointFace; -// U cell; -} +dimensions [0 1 -2 0 0 0 0]; +value ( 0 -9.81 0 ); // ************************************************************************* // diff --git a/tutorials/lagrangian/icoLagrangianFoam/channelParticles/constant/injectorProperties b/tutorials/lagrangian/icoLagrangianFoam/channelParticles/constant/injectorProperties deleted file mode 100644 index 8135223a1..000000000 --- a/tutorials/lagrangian/icoLagrangianFoam/channelParticles/constant/injectorProperties +++ /dev/null @@ -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; - } -) - - -// ************************************************************************* // diff --git a/tutorials/lagrangian/icoLagrangianFoam/channelParticles/constant/kinematicCloudProperties b/tutorials/lagrangian/icoLagrangianFoam/channelParticles/constant/kinematicCloudProperties new file mode 100644 index 000000000..2d147ecea --- /dev/null +++ b/tutorials/lagrangian/icoLagrangianFoam/channelParticles/constant/kinematicCloudProperties @@ -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 + ); +} + +// ************************************************************************* // diff --git a/tutorials/lagrangian/icoLagrangianFoam/channelParticles/constant/polyMesh/boundary b/tutorials/lagrangian/icoLagrangianFoam/channelParticles/constant/polyMesh/boundary index 20d374c43..568a07bc7 100644 --- a/tutorials/lagrangian/icoLagrangianFoam/channelParticles/constant/polyMesh/boundary +++ b/tutorials/lagrangian/icoLagrangianFoam/channelParticles/constant/polyMesh/boundary @@ -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 diff --git a/tutorials/lagrangian/icoLagrangianFoam/channelParticles/constant/transportProperties b/tutorials/lagrangian/icoLagrangianFoam/channelParticles/constant/transportProperties index 5e41f8695..f90d0f3c8 100644 --- a/tutorials/lagrangian/icoLagrangianFoam/channelParticles/constant/transportProperties +++ b/tutorials/lagrangian/icoLagrangianFoam/channelParticles/constant/transportProperties @@ -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; // ************************************************************************* // diff --git a/tutorials/lagrangian/icoLagrangianFoam/channelParticles/customRegexp b/tutorials/lagrangian/icoLagrangianFoam/channelParticles/customRegexp new file mode 100644 index 000000000..61f685917 --- /dev/null +++ b/tutorials/lagrangian/icoLagrangianFoam/channelParticles/customRegexp @@ -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 ); +} \ No newline at end of file diff --git a/tutorials/lagrangian/icoLagrangianFoam/channelParticles/system/controlDict b/tutorials/lagrangian/icoLagrangianFoam/channelParticles/system/controlDict index b7b81aef5..83d31cf1f 100644 --- a/tutorials/lagrangian/icoLagrangianFoam/channelParticles/system/controlDict +++ b/tutorials/lagrangian/icoLagrangianFoam/channelParticles/system/controlDict @@ -34,11 +34,11 @@ stopAt endTime; endTime 1.5; -deltaT 0.005; +deltaT 0.001; writeControl timeStep; -writeInterval 20; +writeInterval 100; purgeWrite 0; diff --git a/tutorials/lagrangian/icoLagrangianFoam/icoLagrangianFoam/Make/files b/tutorials/lagrangian/icoLagrangianFoam/icoLagrangianFoam/Make/files new file mode 100644 index 000000000..efa71c4b6 --- /dev/null +++ b/tutorials/lagrangian/icoLagrangianFoam/icoLagrangianFoam/Make/files @@ -0,0 +1,3 @@ +icoLagrangianFoam.C + +EXE = $(FOAM_USER_APPBIN)/icoLagrangianFoam diff --git a/tutorials/lagrangian/icoLagrangianFoam/icoLagrangianFoam/Make/options b/tutorials/lagrangian/icoLagrangianFoam/icoLagrangianFoam/Make/options new file mode 100644 index 000000000..81bc5bb01 --- /dev/null +++ b/tutorials/lagrangian/icoLagrangianFoam/icoLagrangianFoam/Make/options @@ -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 diff --git a/tutorials/lagrangian/icoLagrangianFoam/icoLagrangianFoam/createFields.H b/tutorials/lagrangian/icoLagrangianFoam/icoLagrangianFoam/createFields.H new file mode 100644 index 000000000..794eb514b --- /dev/null +++ b/tutorials/lagrangian/icoLagrangianFoam/icoLagrangianFoam/createFields.H @@ -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 + ); diff --git a/tutorials/lagrangian/icoLagrangianFoam/icoLagrangianFoam/icoLagrangianFoam.C b/tutorials/lagrangian/icoLagrangianFoam/icoLagrangianFoam/icoLagrangianFoam.C new file mode 100644 index 000000000..28eca1a25 --- /dev/null +++ b/tutorials/lagrangian/icoLagrangianFoam/icoLagrangianFoam/icoLagrangianFoam.C @@ -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