From 332b72d5619675a0ce24abc8605affb89854ebd9 Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Wed, 31 Jul 2019 15:57:18 +0100 Subject: [PATCH 1/2] tutorials: reactingTwoPhaseEulerFoam: Updates to steamInjection Added limiters for the phase temperatures to prevent divergence, and monitors to report the minimum and maximum values. Removed the setTimeStep functionObject as the temperature limiters make this unnecessary. Dereased the number of energy correctors and set a higher Courant number limit to reduce the execution-time of the case. Patch contributed by Juho Peltola, VTT. --- .../laminar/steamInjection/constant/fvOptions | 20 +++++++++++++++++++ .../laminar/steamInjection/system/controlDict | 17 +++++----------- .../steamInjection/system/deltaTvalues | 9 --------- .../laminar/steamInjection/system/fvSolution | 2 +- 4 files changed, 26 insertions(+), 22 deletions(-) delete mode 100644 tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/system/deltaTvalues diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/constant/fvOptions b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/constant/fvOptions index 8628ed295f..e32427e29f 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/constant/fvOptions +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/constant/fvOptions @@ -66,6 +66,26 @@ options h.steam (3700 0); // kg*m^2/s^3 } } + + limitTsteam + { + type limitTemperature; + active yes; + selectionMode all; + min 270; + max 2000; + phase steam; + } + + limitTwater + { + type limitTemperature; + active yes; + selectionMode all; + min 270; + max 2000; + phase water; + } } diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/system/controlDict b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/system/controlDict index cf3faac2f5..000d6ed513 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/system/controlDict +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/system/controlDict @@ -47,28 +47,21 @@ runTimeModifiable yes; adjustTimeStep yes; -maxCo 0.1; +maxCo 0.25; maxDeltaT 1e-2; functions { - timeStepping - { - type setTimeStep; - functionObjectLibs ("libutilityFunctionObjects.so"); - enabled yes; - deltaT tableFile; - file "system/deltaTvalues"; - } - - minMaxp + minMax { type fieldMinMax; functionObjectLibs ("libfieldFunctionObjects.so"); fields ( - p + T.steam + T.water + p ); location no; writeControl timeStep; diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/system/deltaTvalues b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/system/deltaTvalues deleted file mode 100644 index 03c2defea0..0000000000 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/system/deltaTvalues +++ /dev/null @@ -1,9 +0,0 @@ -( - (0 1e-3) - (0.99 1e-3) - (0.999 1e-4) - (0.9999 1e-5) - (1.001 1e-5) - (1.01 1e-4) - (1.1 1e-3) -); diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/system/fvSolution b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/system/fvSolution index 5e353fee62..4e76f88020 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/system/fvSolution +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/system/fvSolution @@ -81,7 +81,7 @@ PIMPLE nOuterCorrectors 3; nCorrectors 1; nNonOrthogonalCorrectors 0; - nEnergyCorrectors 2; + nEnergyCorrectors 1; faceMomentum yes; } From 006c3a5099a83632b85d218904e4c65924d44742 Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Wed, 31 Jul 2019 16:47:22 +0100 Subject: [PATCH 2/2] thermoPhysicalModels/specie: Corrected documentation Removed historic references to conversion from mass-based to mole-based properties in some thermodynamic and transport models --- .../equationOfState/icoPolynomial/icoPolynomial.H | 5 +---- .../specie/thermo/eConst/eConstThermo.H | 6 ++---- .../specie/thermo/hConst/hConstThermo.H | 3 +++ .../specie/thermo/hPolynomial/hPolynomialThermo.H | 11 +++++------ .../transport/logPolynomial/logPolynomialTransport.H | 12 ++---------- .../transport/polynomial/polynomialTransport.H | 10 ++-------- 6 files changed, 15 insertions(+), 32 deletions(-) diff --git a/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomial.H b/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomial.H index 70a9651090..41a5e887df 100644 --- a/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomial.H +++ b/src/thermophysicalModels/specie/equationOfState/icoPolynomial/icoPolynomial.H @@ -48,9 +48,6 @@ Usage \rho = 1000 - 0.05 T + 0.003 T^2 \f] -Note - Input in [kg/m^3], but internally uses [kg/m3/kmol]. - SourceFiles icoPolynomialI.H icoPolynomial.C @@ -116,7 +113,7 @@ class icoPolynomial { // Private Data - //- Density polynomial coefficients + //- Density polynomial coefficients [kg/m^3/K^i] Polynomial rhoCoeffs_; diff --git a/src/thermophysicalModels/specie/thermo/eConst/eConstThermo.H b/src/thermophysicalModels/specie/thermo/eConst/eConstThermo.H index a3efa8abed..a9692b6da7 100644 --- a/src/thermophysicalModels/specie/thermo/eConst/eConstThermo.H +++ b/src/thermophysicalModels/specie/thermo/eConst/eConstThermo.H @@ -88,12 +88,10 @@ class eConstThermo { // Private Data - //- Heat capacity at constant volume - // Note: input in [J/kg/K], but internally uses [J/kmol/K] + //- Heat capacity at constant volume [J/kg/K] scalar Cv_; - //- Heat of formation - // Note: input in [J/kg], but internally uses [J/kmol] + //- Heat of formation [J/kg] scalar Hf_; diff --git a/src/thermophysicalModels/specie/thermo/hConst/hConstThermo.H b/src/thermophysicalModels/specie/thermo/hConst/hConstThermo.H index 574410eaf5..4eac835346 100644 --- a/src/thermophysicalModels/specie/thermo/hConst/hConstThermo.H +++ b/src/thermophysicalModels/specie/thermo/hConst/hConstThermo.H @@ -86,7 +86,10 @@ class hConstThermo { // Private Data + //- Heat capacity at constant pressure [J/kmol/K] scalar Cp_; + + //- Heat of formation [J/kg] scalar Hf_; diff --git a/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.H b/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.H index e7ea439efc..87344f4611 100644 --- a/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.H +++ b/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermo.H @@ -56,8 +56,6 @@ Usage \f] Note - - Heat of formation is inputted in [J/kg], but internally uses [J/kmol] - - Standard entropy is inputted in [J/kg/K], but internally uses [J/kmol/K] - Specific heat at constant pressure polynomial coefficients evaluate to an expression in [J/kg/K]. @@ -132,14 +130,15 @@ class hPolynomialThermo //- Standard entropy scalar Sf_; - //- Specific heat at constant pressure polynomial coeffs + //- Specific heat at constant pressure polynomial coeffs [J/kg/K/K^i] Polynomial CpCoeffs_; - //- Enthalpy polynomial coeffs - derived from cp [J/kg] - // NOTE: relative to Tstd + //- Enthalpy polynomial coeffs [J/kg/K^i] + // Derived from Cp coeffs. Relative to Tstd. typename Polynomial::intPolyType hCoeffs_; - //- Entropy - derived from Cp [J/kg/K] - relative to Tstd + //- Entropy polynomial coeffs [J/kg/K/K^i] + // Derived from Cp coeffs. Relative to Tstd. Polynomial sCoeffs_; diff --git a/src/thermophysicalModels/specie/transport/logPolynomial/logPolynomialTransport.H b/src/thermophysicalModels/specie/transport/logPolynomial/logPolynomialTransport.H index 5dded993e2..4701f04a0d 100644 --- a/src/thermophysicalModels/specie/transport/logPolynomial/logPolynomialTransport.H +++ b/src/thermophysicalModels/specie/transport/logPolynomial/logPolynomialTransport.H @@ -63,12 +63,6 @@ Usage \kappa = 2000 - 0.15 ln(T) + 0.023 ln(T)^2 \f] -Note - - Dynamic viscosity polynomial coefficients evaluate to an expression in - [Pa.s], but internally uses [Pa.s/kmol]. - - Thermal conductivity polynomial coefficients evaluate to an expression in - [W/m/K], but internally uses [W/m/K/kmol]. - SourceFiles logPolynomialTransportI.H logPolynomialTransport.C @@ -125,12 +119,10 @@ class logPolynomialTransport { // Private Data - //- Dynamic viscosity polynomial coefficients - // Note: input in [Pa.s], but internally uses [Pa.s/kmol] + //- Dynamic viscosity polynomial coefficients [Pa.s/K^i] Polynomial muCoeffs_; - //- Thermal conductivity polynomial coefficients - // Note: input in [W/m/K], but internally uses [W/m/K/kmol] + //- Thermal conductivity polynomial coefficients [W/m/K/K^i] Polynomial kappaCoeffs_; diff --git a/src/thermophysicalModels/specie/transport/polynomial/polynomialTransport.H b/src/thermophysicalModels/specie/transport/polynomial/polynomialTransport.H index 7d4322b288..02f8fa81c5 100644 --- a/src/thermophysicalModels/specie/transport/polynomial/polynomialTransport.H +++ b/src/thermophysicalModels/specie/transport/polynomial/polynomialTransport.H @@ -54,12 +54,6 @@ Usage \kappa = 2000 - 0.15 T + 0.023 T^2 \f] -Note - - Dynamic viscosity polynomial coefficients evaluate to an expression in - [Pa.s], but internally uses [Pa.s/kmol]. - - Thermal conductivity polynomial coefficients evaluate to an expression in - [W/m/K], but internally uses [W/m/K/kmol]. - SourceFiles polynomialTransportI.H polynomialTransport.C @@ -116,10 +110,10 @@ class polynomialTransport { // Private Data - //- Dynamic viscosity polynomial coefficients + //- Dynamic viscosity polynomial coefficients [Pa.s/K^i] Polynomial muCoeffs_; - //- Thermal conductivity polynomial coefficients + //- Thermal conductivity polynomial coefficients [W/m/K/K^i] Polynomial kappaCoeffs_;