CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   rhoCentralFoam transport equation (https://www.cfd-online.com/Forums/openfoam-programming-development/110274-rhocentralfoam-transport-equation.html)

Bryan S December 9, 2013 15:46

Found it, I was missing #include "psiCombustionModel.H" in the main .C file. wmake worked successfully! Would you mind telling me what your chemistryProperties and combustionProperties would look like if you didn't want to model any reactions (i.e. passive scalar only)? I tried copying mine from the reactingFoam tutorial and changing "chemistry" to "off" in chemistryProperties and setting "active" to "false" in combustionProperties but the solver crashed immediately with
Quote:

terminate called after throwing an instance of 'std::bad_cast'
what(): std::bad_cast
Aborted (core dumped)
Any idea what's going on? Thanks!
-B

ChrisA December 9, 2013 15:50

1 Attachment(s)
Here's a copy of my chemistryProperties and combustionProperties files, they should get you started.

Bryan S December 9, 2013 19:48

Thanks Chris, that helped. I was able to work with my constant/ and system/ files and I successfully took 1 timestep forward before getting this:

Code:

...
Starting time loop

Mean and max Courant Numbers = 0.281002 0.96
deltaT = 0.000414938
Time = 0.000414938

diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUx, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoUy, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoE, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal:  Solving for rhoYi, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver:  Solving for Gas1, Initial residual = 1.62351e-14, Final residual = 1.62351e-14, No Iterations 0
diagonal:  Solving for rhoYi, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver:  Solving for Gas2, Initial residual = 1.62707e-14, Final residual = 1.62707e-14, No Iterations 0
#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::sigSegv::sigHandler(int) at ??:?
#2  in "/lib/x86_64-linux-gnu/libc.so.6"
#3  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::operator=(Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > const&) at ??:?
#4 
 at ??:?
#5  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#6 
 at ??:?
Segmentation fault (core dumped)


This error looks familiar. I've gotten sigHandler errors before and I've never been able to fix them. Is there an easy fix or is it time to give up and try something else? Thanks.
-B

ChrisA December 9, 2013 19:52

Hard to say what's giving you a segmentation fault, looks like its solved all of your equations (your new Y equations included), try finding out what line is causing the fault (if you can) check your BC's etc. etc. Try reducing the courant number as well, things get shaky at Co = 1 with rhocentral from my experience. My cases run at 0.3-0.5.

Bryan S December 9, 2013 20:10

Yeah... It's time for me to hang up my hat on this one. I'm going to try to post-process the passive scalar equation in MATLAB. Thanks for all your help Chris. If you ever get a working version of your solver to the point that you'd feel like sharing it, I'd love to get a copy of it. Best,
-B

chriss85 July 18, 2014 08:52

I have been looking into related problems right now, and the YEqn posted by Chris has been quite helpful to me so far.

In my case I have one default gas and I'm producing two others. Do I also need a transport equation for my default gas then?
I have added the mass source terms to the total density as well as to the single transport equations, so the total mass should be conserved as far as I can see. Then I'm basically saying Y0 = 1 - Y1 - Y2. Is this approach sufficient or should I solve for the default gas as well?

On another topic, I'm currently in the process of switching from a sonicFoam-based solver to a rhoCentralFoam-based one, and it's unclear to me how I need to treat additional source terms in impulse and energy equations, i.e. forces and energy sources/sinks (from radiation and electrical current).

In sonicFoam I could just add them as source terms, but here I don't know if they should be added in predictor and/or corrector steps, and if some kind of central scheme is required for them.

I have also posted this in the following thread:
http://www.cfd-online.com/Forums/ope...tml#post502094

If anyone can shed some light on this I would be very grateful.

chriss85 July 24, 2014 10:21

No ideas? :(

reza_65 October 7, 2016 10:36

Quote:

Originally Posted by Henning86 (Post 465140)
This Implementation should work for v2.2.2 it was easier than i tought

in version 2.1.1 you have to create an new class

Hi Henning,

I am wondering why you did not add any source term for combustion in the energy equation? if you solve just a cold flow it can be reasonable but for reacting flow this equations are missing combustion source term! So, it should not work for reacting flow!

Cheers,
Reza

TommyM January 15, 2020 09:12

Looking at the files provided by Henning, is the YEqn properly placed in the .C file?
As far as I know, the species concentration equation has to be solved between momentum and energy equation, while here it is solved last.
This is my opinion, but maybe I am missing something.


Tommy


All times are GMT -4. The time now is 07:57.