CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

density calculated for reactingPhase wrong in reactingTwoPhaseEulerFoam solver

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 30, 2022, 06:23
Default density calculated for reactingPhase wrong in reactingTwoPhaseEulerFoam solver
  #1
New Member
 
Sk Hossen Ali
Join Date: Jul 2021
Location: India
Posts: 8
Rep Power: 3
Sk Hossen Ali is on a distinguished road
Dear All,

I am running a case with reactingTwoPhaseEulerFoam(rTPEF) solver to simulate the plug flow reactor condition on H2/Air combustion.

The model is a 1D constant area adiabatic duct of 5mm length consisting of an inlet at the left end and an outlet at the right end at the pressure of 1 atm filled with N2(g) initially.

Input::------------------
At the inlet, the unburnt stoichiometric H2/Air (Y_H2 = 0.02865, Y_O2= 0.23, Y_N2= 0.74135) mixture at 1000 K and 1m/sec enters.

Expected Output::------
I am expecting the gases leaving out at the outlet to be at adiabatic flame temperature and constant pressure equilibrium composition.

(Note::I have commented out all the diffusion terms from the EEqn, UEqn, and YiEqn to ensure the solvers solves for an ideal plug flow reactor model)

The results obtained in the above reactingTwoPhaseEulerFoam, is compared with the equilibrium calculation of NASA CEA and Cantera.
I have solved the same problem using reactingFoam solver under the same condition.

Results::-----------------
The reactingFoam simulation results were almost in line with NASA CEA and Cantera results which proves its solution to be accurate, so that the velocity and dynamic results of reactingFoam simulation can be used to compare the same from rTPEF simulation.

The temperature at the outlet is almost reaching the adiabatic flame temperature, T = 2665 K compared to the adiabatic flame temperature T_ad = 2696 K.
The composition at the outlet is also matching... (The details of the comparison is given in the attached file.)
The velocity at the outlet for the case of rTPEF is not matching with reactingFoam.


Findings and Warnings in rTPEF::-------------------
Although the mass, momentum and energy residuals have shown to be decreasing and very less at the final time steps results.
One of the major concerns to me is the density calculated for the reactingPhase in the rTPEF case.
I have output of rho object for both of the phases in the rTPEF simulation (note that the other phase is of no importance to us since its phase fraction throughout the domain is zero initially and maintained thereafter)

The density of individual species is being calculated correctly, while in the case where there is a mixture of species the density is being calculated incorrectly.
While I did similar things in reactingFoam it's able to calculate properly all density.

For example the density at the inlet at the stoichiometric condition is 0.254839 kg/m^3, but the density calculated in the rTPEF is 0.0710424.

I am providing the case file for both reactingFoam and rTPEF and a tabulated comparison of these with NASA CEA and Cantera for H2/Air and Ch4/Air.
https://github.com/alihossen1995/compPDF

Note::
To output rho in rTPEF and rF we need to change few things in creatFieldsRefs.H (like NoWrite to MustWrite) files of the respective folders.

Queries : -
I believe that the wrong density calculated for the reactingPhase in rTPEF is the main reason why velocity at the exit in the case of rF and rTPEF is not.
Since both rF and rTPEF are using the same thermophysicalProperties libraries what is the going wrong in calculating reactingPhase density in rTPEF?
Sk Hossen Ali is offline   Reply With Quote

Old   May 18, 2022, 06:38
Default Problem of density solved
  #2
New Member
 
Sk Hossen Ali
Join Date: Jul 2021
Location: India
Posts: 8
Rep Power: 3
Sk Hossen Ali is on a distinguished road
Dear All,

the above problem of the density calculation disparity was solved successfully by editing the code segment in

src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.H

Code:
template<class ThermoType>
const ThermoType& Foam::multiComponentMixture<ThermoType>::cellVolMixture
(
    const scalar p,
    const scalar T,
    const label celli
) const
{
//    scalar rhoInv = 0.0;
//    forAll(speciesData_, i)
//    {
//        rhoInv += Y_[i][celli]/speciesData_[i].rho(p, T);
//    }
//
//    mixtureVol_ =
//        Y_[0][celli]/speciesData_[0].rho(p, T)/rhoInv*speciesData_[0];
//
//    for (label n=1; n<Y_.size(); n++)
//    {
//        mixtureVol_ += 
// Y_[n][celli]/speciesData_[n].rho(p,T)/rhoInv*speciesData_[n];
//    }

    mixtureVol_ = Y_[0][celli] * speciesData_[0];

    for (label n=1; n<Y_.size(); n++)
    {
        mixtureVol_ += Y_[n][celli]*speciesData_[n];
    }
    return mixtureVol_;
}


template<class ThermoType>
const ThermoType& Foam::multiComponentMixture<ThermoType>::
patchFaceVolMixture
(
    const scalar p,
    const scalar T,
    const label patchi,
    const label facei
) const
{
//    scalar rhoInv = 0.0;
//    forAll(speciesData_, i)
//    {
//rhoInv += Y_[i].boundaryField()[patchi][facei]/speciesData_[i].rho(p,T);
//    }
//
//mixtureVol_ =Y_[0].boundaryField()[patchi][facei]/speciesData_[0].rho(p, 
//     T)/rhoInv * speciesData_[0];
//
//    for (label n=1; n<Y_.size(); n++)
//    {
//        mixtureVol_ +=
//            Y_[n].boundaryField()[patchi][facei]/speciesData_[n].rho(p,T)
//          / rhoInv*speciesData_[n];
//    }

    mixtureVol_ = Y_[0].boundaryField()[patchi][facei] * speciesData_[0];

    for (label n=1; n<Y_.size(); n++)
    {
        mixtureVol_ += Y_[n].boundaryField()[patchi][facei]*speciesData_[n];
    }

    return mixtureVol_;
}
Sk Hossen Ali is offline   Reply With Quote

Reply

Tags
density property, reactingfoam, reactingtwophaseeulerfoam

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fail to converge when solving with a fabricated solution zizhou FLUENT 0 March 22, 2021 07:33
PEMFC model with FLUENT brahimchoice FLUENT 22 April 19, 2020 16:44
Density or Pressure based solver Achu FLUENT 1 April 27, 2018 05:34
New solver with temperature-dependent density based on simpleFoam? fanta OpenFOAM Programming & Development 0 December 5, 2017 04:40
Warning 097- AB Siemens 6 November 15, 2004 05:41


All times are GMT -4. The time now is 14:47.