rhoCentralFoam transport equation
Hello everybody,
I am trying to put a new transport equation to see the mixture of flow (non-reactive) in rhoCentralFoam. I found a very simple model, http://openfoamwiki.net/index.php/Ho...sport_equation, but this does not work for rhoCentralFoam. Has anyone implemented a transport equation for the purpouse of mixture in rhoCentralFoam? Can you give me some advice on how to do it? Thanks in advance for your help. João |
Hello,
I didn´t add a equation for mixture in rhoCentralFoam, but I´ve worked with this solver for some time. In rhoCentralFoam you need a special discretisation of the equation, not the "simple one" which is described in the wiki. You can have a look at the paper form Greenshield, Weller, Gasparini and Reese, "Implementation of semi-discrete, non-staggered central schemes in a colocated, polyhedral, finite volume framework, for high-speed viscous flows". Perhaps this helps you. The discretisation is based on an upwind sheme form Kurganov, Noelle and Petrova. regards treima |
Thanks a lot! I will look into it!
|
Did you figure out a discretization of the transport equation that works with rhoCentralFoam? I'm trying to do the same thing. Thanks.
|
i solved the problem for version 2.1.1 but it wont work on the new version.
i justed link the psireactionthermo libary in rhoCentralFoam. (see rhoreactionfoam for details) this should be pretty easy in v2.2.x |
Hi Henning,
I before added a transport equation to rhoCentralFoam that worked well but not a mixture one,could you tell us what equation you used and how?could you put the equation in this thread? that could be very helpful to OpenFOAMers. :) |
2 Attachment(s)
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 |
Thank you Henning, those are very helpful! I notice that the mass fraction of species 2 in the forward step case is greater than 1 in some places in the domain. Do you know the cause of this issue and if it can be fixed? Thanks!
-B |
Actually never mind. I'm an experimentalist so I didn't realize that this can happen with linear equations like the scalar transport equation in certain numerical schemes. I had a colleague explain it to me and it all makes sense now. Thanks for your help!
-B |
1 Attachment(s)
Henning,
Your Yeqn.H implementation is missing the central upwind scheme, you're going to notice some strange behavior in your solutions as a result. I've been using the following yeqn which works quite well (you're going to have to change the diffusion coefficient bits back to Schmidt number as this is developed for laminar diffusion problems.) It's a bit of a mess as I've just finished developing it to fit my purposes and cut a good chunk of that stuff out before posting it... I haven't had time to clean it up as well, as a result there's some spurious comments that should be deleted/ignored. Credit for the original upwind scheme implementation to the yeqn should go to tatu, who provided it to me. |
Quote:
Code:
|
Thanks Chris, I was wondering about that since the previous code submitted used the same discretization I was trying before with no success.
Could you please post a .zip file with all the files required for your solver? I am very interested in using it. I tried simply inserting your .H file into Henning's solver directory and recompiling, but your file includes a DijEqn.H file that I don't have. Thanks! -B |
Another issue that comes up with this is that I'd like to use a thermotype with hePsiThermo, multiComponentMixture, sutherlandTransport, hConstThermo, perfectGas, specie, and sensibleEnthalpy. This isn't one of the default supported options and there is a thread somewhere about how to create a new set of options and link that library to the solver, but I'm not clear on how to link libraries and compile a new thermo model etc. because as I mentioned I'm an experimentalist so I'm new to C++ and don't really know how to do this sort of thing.
Do any of you know of a nice set of step-by-step instructions for creating and compiling my own thermo model and then linking it to my solver? Thanks! -B |
Quote:
I changed the original file I uploaded to use the standard turbulent Schmidt number formulation. That should work when combined with the other files hennings provided... I think, completely untested though (Sorry I haven't been able to go through it more thoroughly, busy busy) |
Quote:
Quote:
-B |
That's and interesting and slightly uninformative error message that i've never seen before... not sure why it's not giving you actual functions and variable names. Anyway, based on the lines it trips up at it's missing a few declarations related to the multispecies bits. I took a quick look at henning's createFields.H, it looks like you're missing the following lines of code:
Code:
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields; Also, you can look at at reactingfoam and see what files it has linked, what initial headers are included at the top of the code and any general yeqn code differences. That's what the yeqn is based on with the addition of the central-upwind scheme so any additional headers and linked libraries that are required can be found there. |
Thanks Chris, both tips were very helpful. The error message is frustratingly vague, and it turns out it's referring to several different undeclared functions but calling them all â. So that's fun. I've fixed a couple of them by adding lines to createFields.H based on what I saw in rhoReactingFoam.
I've gone down from 4 errors to 2, and they may be coming from the same thing. I'm pretty sure it involves the variable rhoY in YEqn.H, which I assume is a volScalarField that is just rho*Y. I tried declaring it like this: Quote:
-B |
Yeah, somethings wrong with your compiler's error messages, I've never ever seen that happen; and I've seen my fair share of errors :P.
So, the error here comes in because Y is a list (or a list of pointers? this is where my knowledge gets vague) containing mass fraction information for each individual species Y[i]. So Y is sort of a 4D array if you want to think of it like that, its a list of all the 3D arrays of species mass fraction. Anyway, rhoY needs to be a list as well, containing rho*Y[i], the following is the proper declaration for createFields.H: Code:
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields; |
Thanks Chris, that fixed it. Turns out the last error is independent from that one, it comes from using "reaction" in YEqn.H, which isn't declared in Henning's createFields.H file. I tried copying the lines from rhoReactingFoam and reactingFoam's createFields.H files, neither seems to work. I also made sure to include the necessary libraries and files in my Make/options file, but that's not helping. I realize I could just take the reactions bit out of the equation YEqn.H because I don't have a source term for the application I have in mind, but it might be nice to have that utility later on.
What do the first few lines of your createFields file look like? At the moment I have Quote:
Thanks, -B |
The first few lines are as follows:
Code:
autoPtr<combustionModels::psiCombustionModel> reaction |
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:
-B |
1 Attachment(s)
Here's a copy of my chemistryProperties and combustionProperties files, they should get you started.
|
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:
... 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 |
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.
|
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 |
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. |
No ideas? :(
|
Quote:
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 |
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 03:44. |