View Issue Details

IDProjectCategoryView StatusLast Update
0001736OpenFOAM[All Projects] Bugpublic2015-06-16 07:51
ReporterDanielJAssigned Tohenry 
PrioritynormalSeverityfeatureReproducibilityN/A
Status resolvedResolutionfixed 
PlatformGNU/LinuxOSUbuntuOS Version14.10
Product Version 
Fixed in Version 
Summary0001736: Add steady-state coal combustion solver
DescriptionI have prepared steady-state solver for coal combustion. This solver is based on coalChemistryFoam and LTSreactingParcelFoam.
TagsNo tags attached.

Activities

DanielJ

2015-06-10 13:26

reporter  

LTSCoalChemistryFoam-solver.patch (22,370 bytes)
From 02d2377fca92d18a68b75e9c54eb821c2432ed9e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20Jasi=C5=84ski?= <daniel.jasinski@gmail.com>
Date: Wed, 10 Jun 2015 12:28:38 +0200
Subject: [PATCH] LTSCoalChemistryFoam solver for steady-state coal combustion.

---
 .../solvers/lagrangian/coalChemistryFoam/Allwmake  |   8 ++
 .../LTSCoalChemistryFoam/LTSCoalChemistryFoam.C    | 120 ++++++++++++++++
 .../LTSCoalChemistryFoam/Make/files                |   3 +
 .../LTSCoalChemistryFoam/Make/options              |  55 +++++++
 .../LTSCoalChemistryFoam/createFields.H            | 158 +++++++++++++++++++++
 .../LTSCoalChemistryFoam/createRDeltaT.H           |  14 ++
 .../coalChemistryFoam/LTSCoalChemistryFoam/pEqn.H  |  75 ++++++++++
 .../LTSCoalChemistryFoam/readTimeControls.H        |  42 ++++++
 .../LTSCoalChemistryFoam/timeScales.H              | 116 +++++++++++++++
 9 files changed, 591 insertions(+)
 create mode 100755 applications/solvers/lagrangian/coalChemistryFoam/Allwmake
 create mode 100755 applications/solvers/lagrangian/coalChemistryFoam/LTSCoalChemistryFoam/LTSCoalChemistryFoam.C
 create mode 100755 applications/solvers/lagrangian/coalChemistryFoam/LTSCoalChemistryFoam/Make/files
 create mode 100755 applications/solvers/lagrangian/coalChemistryFoam/LTSCoalChemistryFoam/Make/options
 create mode 100755 applications/solvers/lagrangian/coalChemistryFoam/LTSCoalChemistryFoam/createFields.H
 create mode 100755 applications/solvers/lagrangian/coalChemistryFoam/LTSCoalChemistryFoam/createRDeltaT.H
 create mode 100755 applications/solvers/lagrangian/coalChemistryFoam/LTSCoalChemistryFoam/pEqn.H
 create mode 100755 applications/solvers/lagrangian/coalChemistryFoam/LTSCoalChemistryFoam/readTimeControls.H
 create mode 100755 applications/solvers/lagrangian/coalChemistryFoam/LTSCoalChemistryFoam/timeScales.H

diff --git a/applications/solvers/lagrangian/coalChemistryFoam/Allwmake b/applications/solvers/lagrangian/coalChemistryFoam/Allwmake
new file mode 100755
index 0000000..61c0fd5
--- /dev/null
+++ b/applications/solvers/lagrangian/coalChemistryFoam/Allwmake
@@ -0,0 +1,8 @@
+#!/bin/sh
+cd ${0%/*} || exit 1    # run from this directory
+set -x
+
+wmake
+wmake LTSCoalChemistryFoam
+
+# ----------------------------------------------------------------- end-of-file
diff --git a/applications/solvers/lagrangian/coalChemistryFoam/LTSCoalChemistryFoam/LTSCoalChemistryFoam.C b/applications/solvers/lagrangian/coalChemistryFoam/LTSCoalChemistryFoam/LTSCoalChemistryFoam.C
new file mode 100755
index 0000000..5872387
--- /dev/null
+++ b/applications/solvers/lagrangian/coalChemistryFoam/LTSCoalChemistryFoam/LTSCoalChemistryFoam.C
@@ -0,0 +1,120 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+Application
+    LTSCoalChemistryFoam
+
+Description
+    Local time stepping (LTS) solver for steady, compressible, laminar or
+    turbulent reacting and non-reacting flow with multiphase Lagrangian
+    parcels and porous media, including run-time selectable finitite volume
+    options, e.g. sources, constraints
+
+
+\*---------------------------------------------------------------------------*/
+
+#include "fvCFD.H"
+#include "turbulenceModel.H"
+#include "basicThermoCloud.H"
+#include "coalCloud.H"
+#include "rhoCombustionModel.H"
+#include "radiationModel.H"
+#include "IOporosityModelList.H"
+#include "fvIOoptionList.H"
+#include "SLGThermo.H"
+#include "fvcSmooth.H"
+#include "pimpleControl.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+int main(int argc, char *argv[])
+{
+    #include "setRootCase.H"
+
+    #include "createTime.H"
+    #include "createMesh.H"
+    #include "readGravitationalAcceleration.H"
+
+    pimpleControl pimple(mesh);
+
+    #include "readTimeControls.H"
+    #include "createFields.H"
+    #include "createFvOptions.H"
+    #include "createRDeltaT.H"
+    #include "createRadiationModel.H"
+    #include "createClouds.H"
+    #include "initContinuityErrs.H"
+
+    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+    Info<< "\nStarting time loop\n" << endl;
+
+    while (runTime.run())
+    {
+        #include "readTimeControls.H"
+
+        runTime++;
+
+        Info<< "Time = " << runTime.timeName() << nl << endl;
+
+        rhoEffLagrangian = coalParcels.rhoEff() + limestoneParcels.rhoEff();
+        pDyn = 0.5*rho*magSqr(U);
+
+        coalParcels.evolve();
+
+        limestoneParcels.evolve();
+
+        #include "timeScales.H"
+
+        #include "rhoEqn.H"
+
+        // --- Pressure-velocity PIMPLE corrector loop
+        while (pimple.loop())
+        {
+            turbulence->correct();
+
+            #include "UEqn.H"
+            #include "YEqn.H"
+            #include "EEqn.H"
+
+            // --- Pressure corrector loop
+            while (pimple.correct())
+            {
+                #include "pEqn.H"
+            }
+        }
+
+        runTime.write();
+
+        Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
+            << "  ClockTime = " << runTime.elapsedClockTime() << " s"
+            << nl << endl;
+    }
+
+    Info<< "End\n" << endl;
+
+    return(0);
+}
+
+
+// ************************************************************************* //
diff --git a/applications/solvers/lagrangian/coalChemistryFoam/LTSCoalChemistryFoam/Make/files b/applications/solvers/lagrangian/coalChemistryFoam/LTSCoalChemistryFoam/Make/files
new file mode 100755
index 0000000..b0d27fc
--- /dev/null
+++ b/applications/solvers/lagrangian/coalChemistryFoam/LTSCoalChemistryFoam/Make/files
@@ -0,0 +1,3 @@
+LTSCoalChemistryFoam.C
+
+EXE = $(FOAM_APPBIN)/LTSCoalChemistryFoam
diff --git a/applications/solvers/lagrangian/coalChemistryFoam/LTSCoalChemistryFoam/Make/options b/applications/solvers/lagrangian/coalChemistryFoam/LTSCoalChemistryFoam/Make/options
new file mode 100755
index 0000000..1a9ecb7
--- /dev/null
+++ b/applications/solvers/lagrangian/coalChemistryFoam/LTSCoalChemistryFoam/Make/options
@@ -0,0 +1,55 @@
+EXE_INC = \
+    -I.. \
+    -I$(LIB_SRC)/finiteVolume/lnInclude \
+    -I${LIB_SRC}/meshTools/lnInclude \
+    -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
+    -I$(LIB_SRC)/lagrangian/basic/lnInclude \
+    -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
+    -I$(LIB_SRC)/lagrangian/coalCombustion/lnInclude \
+    -I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
+    -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
+    -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
+    -I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
+    -I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
+    -I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
+    -I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
+    -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
+    -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
+    -I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
+    -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
+    -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
+    -I$(LIB_SRC)/ODE/lnInclude \
+    -I$(LIB_SRC)/regionModels/regionModel/lnInclude \
+    -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
+    -I$(LIB_SRC)/combustionModels/lnInclude \
+    -I$(LIB_SRC)/fvOptions/lnInclude \
+    -I$(LIB_SRC)/sampling/lnInclude
+
+
+EXE_LIBS = \
+    -lfiniteVolume \
+    -lmeshTools \
+    -lcompressibleTurbulenceModel \
+    -lcompressibleRASModels \
+    -lcompressibleLESModels \
+    -llagrangian \
+    -llagrangianIntermediate \
+    -llagrangianTurbulence \
+    -lcoalCombustion\
+    -lspecie \
+    -lfluidThermophysicalModels \
+    -lliquidProperties \
+    -lliquidMixtureProperties \
+    -lsolidProperties \
+    -lsolidMixtureProperties \
+    -lthermophysicalFunctions \
+    -lreactionThermophysicalModels \
+    -lSLGThermo \
+    -lchemistryModel \
+    -lradiationModels \
+    -lODE \
+    -lregionModels \
+    -lsurfaceFilmModels \
+    -lcombustionModels \
+    -lfvOptions \
+    -lsampling
diff --git a/applications/solvers/lagrangian/coalChemistryFoam/LTSCoalChemistryFoam/createFields.H b/applications/solvers/lagrangian/coalChemistryFoam/LTSCoalChemistryFoam/createFields.H
new file mode 100755
index 0000000..c4de287
--- /dev/null
+++ b/applications/solvers/lagrangian/coalChemistryFoam/LTSCoalChemistryFoam/createFields.H
@@ -0,0 +1,158 @@
+    Info<< "Creating combustion model\n" << endl;
+
+    autoPtr<combustionModels::rhoCombustionModel> combustion
+    (
+        combustionModels::rhoCombustionModel::New(mesh)
+    );
+
+    rhoReactionThermo& thermo = combustion->thermo();
+    thermo.validate(args.executable(), "h", "e");
+
+    SLGThermo slgThermo(mesh, thermo);
+
+    basicMultiComponentMixture& composition = thermo.composition();
+    PtrList<volScalarField>& Y = composition.Y();
+
+    const word inertSpecie(thermo.lookup("inertSpecie"));
+
+    if (!composition.contains(inertSpecie))
+    {
+        FatalErrorIn(args.executable())
+            << "Specified inert specie '" << inertSpecie << "' not found in "
+            << "species list. Available species:" << composition.species()
+            << exit(FatalError);
+    }
+
+    volScalarField& p = thermo.p();
+    const volScalarField& T = thermo.T();
+    const volScalarField& psi = thermo.psi();
+
+    volScalarField rho
+    (
+        IOobject
+        (
+            "rho",
+            runTime.timeName(),
+            mesh,
+            IOobject::NO_READ,
+            IOobject::AUTO_WRITE
+        ),
+        thermo.rho()
+    );
+
+    // lagrangian effective density field - used externally (optional)
+    volScalarField rhoEffLagrangian
+    (
+        IOobject
+        (
+            "rhoEffLagrangian",
+            runTime.timeName(),
+            mesh,
+            IOobject::NO_READ,
+            IOobject::AUTO_WRITE
+        ),
+        mesh,
+        dimensionedScalar("zero", dimDensity, 0.0)
+    );
+
+    // dynamic pressure field - used externally (optional)
+    volScalarField pDyn
+    (
+        IOobject
+        (
+            "pDyn",
+            runTime.timeName(),
+            mesh,
+            IOobject::NO_READ,
+            IOobject::AUTO_WRITE
+        ),
+        mesh,
+        dimensionedScalar("zero", dimPressure, 0.0)
+    );
+
+
+    Info<< "\nReading field U\n" << endl;
+    volVectorField U
+    (
+        IOobject
+        (
+            "U",
+            runTime.timeName(),
+            mesh,
+            IOobject::MUST_READ,
+            IOobject::AUTO_WRITE
+        ),
+        mesh
+    );
+
+    #include "compressibleCreatePhi.H"
+
+    dimensionedScalar rhoMax
+    (
+        "rhoMax",
+        dimDensity,
+        mesh.solutionDict().subDict("PIMPLE")
+       .lookupOrDefault<scalar>("rhoMax", GREAT)
+    );
+
+    dimensionedScalar rhoMin
+    (
+        "rhoMin",
+        dimDensity,
+        mesh.solutionDict().subDict("PIMPLE")
+       .lookupOrDefault<scalar>("rhoMin", -GREAT)
+    );
+
+    Info<< "Creating turbulence model\n" << endl;
+    autoPtr<compressible::turbulenceModel> turbulence
+    (
+        compressible::turbulenceModel::New
+        (
+            rho,
+            U,
+            phi,
+            thermo
+        )
+    );
+
+    // Set the turbulence into the combustion model
+    combustion->setTurbulence(turbulence());
+
+    Info<< "Creating field dpdt\n" << endl;
+    volScalarField dpdt
+    (
+        IOobject
+        (
+            "dpdt",
+            runTime.timeName(),
+            mesh
+        ),
+        mesh,
+        dimensionedScalar("dpdt", p.dimensions()/dimTime, 0)
+    );
+
+    Info<< "Creating field kinetic energy K\n" << endl;
+    volScalarField K("K", 0.5*magSqr(U));
+
+    Info<< "Creating multi-variate interpolation scheme\n" << endl;
+    multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
+
+    forAll(Y, i)
+    {
+        fields.add(Y[i]);
+    }
+    fields.add(thermo.he());
+
+    volScalarField dQ
+    (
+        IOobject
+        (
+            "dQ",
+            runTime.timeName(),
+            mesh,
+            IOobject::NO_READ,
+            IOobject::AUTO_WRITE
+        ),
+        mesh,
+        dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
+    );
diff --git a/applications/solvers/lagrangian/coalChemistryFoam/LTSCoalChemistryFoam/createRDeltaT.H b/applications/solvers/lagrangian/coalChemistryFoam/LTSCoalChemistryFoam/createRDeltaT.H
new file mode 100755
index 0000000..c445eae
--- /dev/null
+++ b/applications/solvers/lagrangian/coalChemistryFoam/LTSCoalChemistryFoam/createRDeltaT.H
@@ -0,0 +1,14 @@
+    volScalarField rDeltaT
+    (
+        IOobject
+        (
+            "rDeltaT",
+            runTime.timeName(),
+            mesh,
+            IOobject::READ_IF_PRESENT,
+            IOobject::AUTO_WRITE
+        ),
+        mesh,
+        dimensionedScalar("one", dimless/dimTime, 1),
+        zeroGradientFvPatchScalarField::typeName
+    );
diff --git a/applications/solvers/lagrangian/coalChemistryFoam/LTSCoalChemistryFoam/pEqn.H b/applications/solvers/lagrangian/coalChemistryFoam/LTSCoalChemistryFoam/pEqn.H
new file mode 100755
index 0000000..115d74a
--- /dev/null
+++ b/applications/solvers/lagrangian/coalChemistryFoam/LTSCoalChemistryFoam/pEqn.H
@@ -0,0 +1,75 @@
+{
+    rho = thermo.rho();
+
+    // Thermodynamic density needs to be updated by psi*d(p) after the
+    // pressure solution - done in 2 parts. Part 1:
+    thermo.rho() -= psi*p;
+
+    volScalarField rAU(1.0/UEqn.A());
+    surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
+
+    volVectorField HbyA("HbyA", U);
+    HbyA = rAU*UEqn.H();
+
+    surfaceScalarField phiHbyA
+    (
+        "phiHbyA",
+        (
+            (fvc::interpolate(rho*HbyA) & mesh.Sf())
+          + rhorAUf*fvc::ddtCorr(rho, U, phi)
+        )
+    );
+
+    fvOptions.makeRelative(fvc::interpolate(rho), phiHbyA);
+
+    fvScalarMatrix pDDtEqn
+    (
+        fvc::ddt(rho) + psi*correction(fvm::ddt(p))
+      + fvc::div(phiHbyA)
+     ==
+        coalParcels.Srho()
+      + fvOptions(psi, p, rho.name())
+    );
+
+    while (pimple.correctNonOrthogonal())
+    {
+        fvScalarMatrix pEqn
+        (
+            pDDtEqn
+          - fvm::laplacian(rhorAUf, p)
+        );
+
+        fvOptions.constrain(pEqn);
+
+        pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
+
+        if (pimple.finalNonOrthogonalIter())
+        {
+            phi = phiHbyA + pEqn.flux();
+        }
+    }
+
+    p.relax();
+
+    // Second part of thermodynamic density update
+    thermo.rho() += psi*p;
+
+    #include "rhoEqn.H" // NOTE: flux and time scales now inconsistent
+    #include "compressibleContinuityErrs.H"
+
+    U = HbyA - rAU*fvc::grad(p);
+    U.correctBoundaryConditions();
+    fvOptions.correct(U);
+    K = 0.5*magSqr(U);
+
+    if (thermo.dpdt())
+    {
+        dpdt = fvc::ddt(p);
+    }
+
+    rho = thermo.rho();
+    rho = max(rho, rhoMin);
+    rho = min(rho, rhoMax);
+
+    Info<< "p min/max = " << min(p).value() << ", " << max(p).value() << endl;
+}
diff --git a/applications/solvers/lagrangian/coalChemistryFoam/LTSCoalChemistryFoam/readTimeControls.H b/applications/solvers/lagrangian/coalChemistryFoam/LTSCoalChemistryFoam/readTimeControls.H
new file mode 100755
index 0000000..c2b7761
--- /dev/null
+++ b/applications/solvers/lagrangian/coalChemistryFoam/LTSCoalChemistryFoam/readTimeControls.H
@@ -0,0 +1,42 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+\*---------------------------------------------------------------------------*/
+
+// Maximum flow Courant number
+scalar maxCo(readScalar(pimple.dict().lookup("maxCo")));
+
+// Maximum time scale
+scalar maxDeltaT(pimple.dict().lookupOrDefault<scalar>("maxDeltaT", GREAT));
+
+// Smoothing parameter (0-1) when smoothing iterations > 0
+scalar rDeltaTSmoothingCoeff
+(
+    pimple.dict().lookupOrDefault<scalar>("rDeltaTSmoothingCoeff", 0.1)
+);
+
+// Maximum change in cell temperature per iteration (relative to previous value)
+scalar alphaTemp(pimple.dict().lookupOrDefault("alphaTemp", 0.05));
+
+
+// ************************************************************************* //
diff --git a/applications/solvers/lagrangian/coalChemistryFoam/LTSCoalChemistryFoam/timeScales.H b/applications/solvers/lagrangian/coalChemistryFoam/LTSCoalChemistryFoam/timeScales.H
new file mode 100755
index 0000000..1c72794
--- /dev/null
+++ b/applications/solvers/lagrangian/coalChemistryFoam/LTSCoalChemistryFoam/timeScales.H
@@ -0,0 +1,116 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
+     \\/     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 3 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, see <http://www.gnu.org/licenses/>.
+
+\*---------------------------------------------------------------------------*/
+
+Info<< "Time scales min/max:" << endl;
+
+
+{
+    // Cache old time scale field
+    tmp<volScalarField> trDeltaT
+    (
+        new volScalarField
+        (
+            IOobject
+            (
+                "rDeltaT0",
+                runTime.timeName(),
+                mesh,
+                IOobject::NO_READ,
+                IOobject::NO_WRITE,
+                false
+            ),
+            rDeltaT
+        )
+    );
+    const volScalarField& rDeltaT0 = trDeltaT();
+
+
+    // Flow time scale
+    // ~~~~~~~~~~~~~~~
+    {
+        rDeltaT =
+            fvc::surfaceSum
+            (
+                mag(phi)*mesh.deltaCoeffs()/(maxCo*mesh.magSf())
+            )
+           /rho;
+
+        rDeltaT.max(1.0/maxDeltaT);
+
+        Info<< "    Flow        = "
+            << gMin(1/rDeltaT.internalField()) << ", "
+            << gMax(1/rDeltaT.internalField()) << endl;
+    }
+
+
+    // Temperature source time scale
+    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+    {
+        scalarField tau
+        (
+            runTime.deltaTValue()
+           *mag
+            (
+                (coalParcels.hsTrans()+limestoneParcels.hsTrans())
+                    /(mesh.V()*runTime.deltaT())
+           // + fvOptions(rho, hs)
+              + combustion->Sh()()
+              - fvc::div(phi, 0.5*magSqr(U), "div(phi,K)")()
+            )
+           /rho
+        );
+
+        tau = alphaTemp*thermo.Cp()*T/(tau + ROOTVSMALL);
+
+        Info<< "    Temperature = " << min(maxDeltaT, gMin(tau)) << ", "
+            << min(maxDeltaT, gMax(tau)) << endl;
+
+        rDeltaT.internalField() = max(rDeltaT.internalField(), 1/tau);
+    }
+
+
+    // Limit rate of change of time scale
+    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    // - reduce as much as required for flow, but limit source contributions
+    const dimensionedScalar deltaTRamp("deltaTRamp", dimless, 1/(1 + 0.2));
+    rDeltaT = max(rDeltaT, rDeltaT0*deltaTRamp);
+
+
+    // Limit the largest time scale
+    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    rDeltaT.max(1/maxDeltaT);
+
+
+    // Spatially smooth the time scale field
+    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+    fvc::smooth(rDeltaT, rDeltaTSmoothingCoeff);
+
+    Info<< "    Overall     = " << min(1/rDeltaT).value()
+        << ", " << max(1/rDeltaT).value() << nl << endl;
+}
+
+
+// ************************************************************************* //
-- 
1.9.1

wyldckat

2015-06-11 10:57

updater   ~0004903

A few side notes:

 1- If you were to attach the source code folder (zipped or in a tar.gz), it would make it easier for the admins to handle the request and inspect the source code.

 2- 1 or 2 test cases that prove that this solver is working as intended is usually needed, since the smallest mistake in the source code is enough to make it a GIGO solver :( The use of test cases can aid in making it less likely for such errors to exist.

DanielJ

2015-06-11 14:42

reporter  

LTSCoalChemistryFoam.zip (483,004 bytes)

DanielJ

2015-06-11 14:42

reporter  

upDraft-test.zip (12,887 bytes)

DanielJ

2015-06-11 14:46

reporter   ~0004906

I uploaded source code for the solver.

I also uploaded simple case to test the solver.

henry

2015-06-15 21:58

manager   ~0004941

It is not clear why you have used density-based thermodynamics rather than the compressibility based thermodynamics of coalChemistryFoam. I would have used coalChemistryFoam as the base and added LTS.

henry

2015-06-15 22:39

manager   ~0004942

I have created an LTS version of coalChemistryFoam in OpenFOAM-dev using as much of the existing functionality as possible and uses the same thermodynamics. Let me know if it fulfills your requirements.

DanielJ

2015-06-15 22:47

reporter   ~0004943

This is very OK :)
Thanks.

henry

2015-06-15 23:20

manager   ~0004944

Why do you need an LTS version of coalChemistryFoam? Do you need the support for two cloud types? If not why not just use LTSreactingParcelFoam?

DanielJ

2015-06-16 07:07

reporter   ~0004945

Two clouds are not essential. LTSreactingParcelFoam does not support surface reactions which are necessary for coal combustion.

henry

2015-06-16 07:51

manager   ~0004946

Resolved by commit c0cb1d6e8f53ed6dbf6b0d2af4c5b277dae47ffb in OpenFOAM-dev

Issue History

Date Modified Username Field Change
2015-06-10 13:26 DanielJ New Issue
2015-06-10 13:26 DanielJ File Added: LTSCoalChemistryFoam-solver.patch
2015-06-11 10:57 wyldckat Note Added: 0004903
2015-06-11 14:42 DanielJ File Added: LTSCoalChemistryFoam.zip
2015-06-11 14:42 DanielJ File Added: upDraft-test.zip
2015-06-11 14:46 DanielJ Note Added: 0004906
2015-06-15 21:58 henry Note Added: 0004941
2015-06-15 22:39 henry Note Added: 0004942
2015-06-15 22:47 DanielJ Note Added: 0004943
2015-06-15 23:20 henry Note Added: 0004944
2015-06-16 07:07 DanielJ Note Added: 0004945
2015-06-16 07:51 henry Note Added: 0004946
2015-06-16 07:51 henry Status new => resolved
2015-06-16 07:51 henry Resolution open => fixed
2015-06-16 07:51 henry Assigned To => henry