2017-10-18 06:24 BST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002572OpenFOAMPatchpublic2017-09-04 16:58
ReporterJuho 
Assigned Tohenry 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusresolvedResolutionfixed 
Product Versiondev 
Target VersionFixed in Versiondev 
Summary0002572: Add multiphase support to limitTemperature fvOption
DescriptionAllows limitTemperature fvOption to be used with reactingEulerFoam solvers.
TagsNo tags attached.
Attached Files
  • patch file icon limitTemperature-multiphase-support.patch (4,646 bytes) 2017-06-07 08:31 -
    From 04ad509db07674c5b8f1b038c3df299ae7d16029 Mon Sep 17 00:00:00 2001
    From: Juho Peltola <jpjuho@hila3.ad.vtt.fi>
    Date: Wed, 7 Jun 2017 10:22:14 +0300
    Subject: [PATCH] Add multiphase support to limitTemperature
    
    ---
     .../reactingMultiphaseEulerFoam/EEqns.H            |    1 +
     .../reactingTwoPhaseEulerFoam/EEqns.H              |    2 ++
     .../limitTemperature/limitTemperature.C            |   16 +++++++++++-----
     .../limitTemperature/limitTemperature.H            |    4 ++++
     4 files changed, 18 insertions(+), 5 deletions(-)
    
    diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/EEqns.H b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/EEqns.H
    index e4689ef..dc53815 100644
    --- a/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/EEqns.H
    +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/EEqns.H
    @@ -31,6 +31,7 @@ for (int Ecorr=0; Ecorr<nEnergyCorrectors; Ecorr++)
                 EEqn->relax();
                 fvOptions.constrain(EEqn.ref());
                 EEqn->solve();
    +            fvOptions.correct(phase.thermo().he());
             }
         }
     
    diff --git a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/EEqns.H b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/EEqns.H
    index d9f1e85..246bea1 100644
    --- a/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/EEqns.H
    +++ b/applications/solvers/multiphase/reactingEulerFoam/reactingTwoPhaseEulerFoam/EEqns.H
    @@ -25,6 +25,7 @@ for (int Ecorr=0; Ecorr<nEnergyCorrectors; Ecorr++)
                 E1Eqn->relax();
                 fvOptions.constrain(E1Eqn.ref());
                 E1Eqn->solve();
    +            fvOptions.correct(phase1.thermo().he());
             }
         }
     
    @@ -45,6 +46,7 @@ for (int Ecorr=0; Ecorr<nEnergyCorrectors; Ecorr++)
                 E2Eqn->relax();
                 fvOptions.constrain(E2Eqn.ref());
                 E2Eqn->solve();
    +            fvOptions.correct(phase2.thermo().he());
             }
         }
     
    diff --git a/src/fvOptions/corrections/limitTemperature/limitTemperature.C b/src/fvOptions/corrections/limitTemperature/limitTemperature.C
    index c5d7ead..63f9141 100644
    --- a/src/fvOptions/corrections/limitTemperature/limitTemperature.C
    +++ b/src/fvOptions/corrections/limitTemperature/limitTemperature.C
    @@ -2,7 +2,7 @@
       =========                 |
       \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
        \\    /   O peration     |
    -    \\  /    A nd           | Copyright (C) 2012-2016 OpenFOAM Foundation
    +    \\  /    A nd           | Copyright (C) 2012-2017 OpenFOAM Foundation
          \\/     M anipulation  |
     -------------------------------------------------------------------------------
     License
    @@ -57,13 +57,16 @@ Foam::fv::limitTemperature::limitTemperature
     :
         cellSetOption(name, modelType, dict, mesh),
         Tmin_(readScalar(coeffs_.lookup("min"))),
    -    Tmax_(readScalar(coeffs_.lookup("max")))
    +    Tmax_(readScalar(coeffs_.lookup("max"))),
    +    phaseName_(coeffs_.lookupOrDefault<word>("phaseName",""))
     {
         // Set the field name to that of the energy field from which the temperature
         // is obtained
    -
         const basicThermo& thermo =
    -        mesh_.lookupObject<basicThermo>(basicThermo::dictName);
    +        mesh_.lookupObject<basicThermo>
    +        (
    +            IOobject::groupName(basicThermo::dictName, phaseName_)
    +        );
     
         fieldNames_.setSize(1, thermo.he().name());
     
    @@ -92,7 +95,10 @@ bool Foam::fv::limitTemperature::read(const dictionary& dict)
     void Foam::fv::limitTemperature::correct(volScalarField& he)
     {
         const basicThermo& thermo =
    -        mesh_.lookupObject<basicThermo>(basicThermo::dictName);
    +        mesh_.lookupObject<basicThermo>
    +        (
    +            IOobject::groupName(basicThermo::dictName, phaseName_)
    +        );
     
         scalarField Tmin(cells_.size(), Tmin_);
         scalarField Tmax(cells_.size(), Tmax_);
    diff --git a/src/fvOptions/corrections/limitTemperature/limitTemperature.H b/src/fvOptions/corrections/limitTemperature/limitTemperature.H
    index 956515e..a9574ac 100644
    --- a/src/fvOptions/corrections/limitTemperature/limitTemperature.H
    +++ b/src/fvOptions/corrections/limitTemperature/limitTemperature.H
    @@ -39,6 +39,7 @@ Usage
             selectionMode   all;
             min             200;
             max             500;
    +        phaseName       gas; //optional
         }
         \endverbatim
     
    @@ -78,6 +79,9 @@ protected:
             //- Maximum temperature limit [K]
             scalar Tmax_;
     
    +        //- Optional phase name [K]
    +        word phaseName_;
    +
     
     private:
     
    -- 
    1.6.2.5
    
    
    patch file icon limitTemperature-multiphase-support.patch (4,646 bytes) 2017-06-07 08:31 +

-Relationships
+Relationships

-Notes

~0008678

wyldckat (updater)

@Henry: I was about to assign this to you... but I don't know if there is anything else missing here in order for this to be accepted?

~0008682

henry (manager)

Thanks for the reminder, this one got buried.

~0008683

henry (manager)

Thanks for the patch Juho, I have also updated twoPhaseEulerFoam and changed the phase name entry to "phase" for consistency with other phase and property name specification.

Resolved by commit 0ad0d34b421ed4d9bb38b322823f16cc16240b44
+Notes

-Issue History
Date Modified Username Field Change
2017-06-07 08:31 Juho New Issue
2017-06-07 08:31 Juho File Added: limitTemperature-multiphase-support.patch
2017-09-03 19:53 wyldckat Note Added: 0008678
2017-09-04 16:55 henry Note Added: 0008682
2017-09-04 16:58 henry Assigned To => henry
2017-09-04 16:58 henry Status new => resolved
2017-09-04 16:58 henry Resolution open => fixed
2017-09-04 16:58 henry Fixed in Version => dev
2017-09-04 16:58 henry Note Added: 0008683
+Issue History