CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   ReactingFoam (OF 5.0) - skyrocketing min/max temp (https://www.cfd-online.com/Forums/openfoam-solving/223830-reactingfoam-5-0-skyrocketing-min-max-temp.html)

KerThan January 28, 2020 07:03

ReactingFoam (OF 5.0) - skyrocketing min/max temp
 
Hello, I've pretty big problem with pressure-driven flow in simple 2D pipe. I want to push out gas from pipe (N2) via another gas (CH4). For low pressures (max ~500 Pascals on inlet/outlet/internal) everything is okay, but for those that I would like to simulate (atmospheric pressure as internal, flow driven by \DeltaP ~ 2 atm), everything is running wild. My mesh is pretty good, and I've tried to set up Co to 0.1 but it didn't solve my problem.


Warning that I get:

Code:

diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
PIMPLE: iteration 1
DILUPBiCGStab:  Solving for H2O, Initial residual = 1.00507e-06, Final residual = 1.73363e-07, No Iterations 1
DILUPBiCGStab:  Solving for CH4, Initial residual = 0.17301, Final residual = 0.00542353, No Iterations 1
DILUPBiCGStab:  Solving for CO2, Initial residual = 1.22766e-06, Final residual = 2.11756e-07, No Iterations 1
DILUPBiCGStab:  Solving for N2, Initial residual = 0.248774, Final residual = 0.00658698, No Iterations 1
DILUPBiCGStab:  Solving for h, Initial residual = 0.760182, Final residual = 0.0245965, No Iterations 1
--> FOAM Warning :
    From function Foam::scalar Foam::janafThermo<EquationOfState>::limit(Foam::scalar) const [with EquationOfState = Foam::perfectGas<Foam::specie>; Foam::scalar = double]
    in file /home/ubuntu/OpenFOAM/OpenFOAM-5.x/src/thermophysicalModels/specie/lnInclude/janafThermoI.H at line 117
    attempt to use janafThermo<EquationOfState> out of temperature range 200 -> 5000;  T = -8.2578

T:

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  5                                    |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      volScalarField;
    location    "0";
    object      T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 0 1 0 0 0];

internalField  uniform 293;

boundaryField
{
    inlet   
    {
        type    zeroGradient;
        value    uniform 293;

    }
    outlet
    {
        type    zeroGradient;
    }
    frontAndBack
    {
        type            empty;
    }
   
    walls
    {
        type            zeroGradient;
    }
}
// ************************************************************************* //

I've heard that there was option in older versions of OF to fix Lewis number at 1, but I can't find hsEqn file in my OpenFoam version.

Swagga5aur January 29, 2020 17:28

Hello KerThan, would it be possilbe for you to share your case? Regarding the Lewis number in openfoam, the majority of combustion solvers (such as reactingfoam) in openfoam assume this as explained here https://bugs.openfoam.org/view.php?id=277

Regards Lasse

KerThan January 30, 2020 04:40

Hello, thank you for your respond. Here is my case: https://drive.google.com/drive/folde...78NLKA6Q7s-hRP


Anyway something goes wrong and now even for low pressures that doesn't work well (there is some flux of methane that push off nitrogen from pipe, but pressure goes wild too, even for small values).


If I understand it well, if I want to have pressure driven flow, I have to put BCs that allow me to have gradient of pressure in my geometry. I can use as it two different fixedValues (always =/=0 - I don't know why, but I don't have any iteration if I put as outlet 0 pressure), or totalPressure condition (where value = internalfield in my casE) and use pressureInletVelocity for velocity BC.



I've tried before to make it with totalPressure on inlet and zeroGradient/outletInlet/totalPressure at outlet (with pressureInletVelocity; / pressureInletOutletVelocity; in U), but always I've got no flux and only one iteration, or any flux at all.

Swagga5aur January 31, 2020 16:11

Alright so, first of all the pressure you specify isn't the gauge pressure so 30 is total pressure of 30 Pascal, which I don't know if is realistic so I specified a inlet pressure of 3e5 and outlet of 1e5.

Afterwards I changed the temperature equation as it was overdefined previously with fixed at inlet and outlet.

I turned of combustion and chemistry model as there is no combustion.

I updated your fvSolution directory regarding relaxationFactors (from 1 (no relaxation) to 0.3(under-relaxation) as reactingFoam is quite sensitive, especially when not being used for its intended purposes.

Note that the temperature equation of reactingFoam may cause unrealistic temperature increases, so if you are solving for a flow with no temperature field I would make a new solver than removes the u necessary parts (or fix it via fvOption). This is further describe here: https://www.cfd-online.com/Forums/op...urned-off.html

A side note, I didn't check but check what you Mach number is but check it in any case.

Case download: https://www.dropbox.com/s/jcxjpkx8do...nFlow.zip?dl=0

Regards Lasse

KerThan February 3, 2020 07:02

Thank you a lot! :) In the meantime, I've partly solve my problem in other way. I don't know why, but after switch to OF 7.0, temperature limiter (tmin and tmax = 293 K) started to work as it should, and my case ran prety well (I had to use really small timestep, but result was pretty good). Maybe I had some problems with my OF installation.



Regards,
KerThan

lisa.yelistratova March 23, 2024 17:30

Hi Swagga5aur! I am working on a similar problem as KerThan. Could you resend this case pls? The archive in your link is empty :(

Swagga5aur April 11, 2024 05:12

Hello Lisa,

Sorry for the inconvenience don't know why its corrupted, remade the case in OF7, haven't tested it much though.
https://www.dropbox.com/scl/fo/9sxi6...ip0on9rzx&dl=0


Regards Lasse


All times are GMT -4. The time now is 10:25.