|
[Sponsors] |
December 6, 2012, 14:50 |
rhoCentralFoam transport equation
|
#1 |
New Member
João Duarte Miranda
Join Date: Jan 2012
Posts: 13
Rep Power: 14 |
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 |
|
December 7, 2012, 05:39 |
|
#2 |
Member
Join Date: Mar 2012
Location: Munich, Germany
Posts: 67
Rep Power: 14 |
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 |
|
December 7, 2012, 11:01 |
|
#3 |
New Member
João Duarte Miranda
Join Date: Jan 2012
Posts: 13
Rep Power: 14 |
Thanks a lot! I will look into it!
|
|
December 5, 2013, 20:28 |
|
#4 |
New Member
Bryan Schmidt
Join Date: Sep 2013
Posts: 18
Rep Power: 13 |
Did you figure out a discretization of the transport equation that works with rhoCentralFoam? I'm trying to do the same thing. Thanks.
|
|
December 6, 2013, 08:03 |
|
#5 |
Member
Join Date: Nov 2012
Posts: 83
Rep Power: 14 |
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 |
|
December 6, 2013, 08:36 |
|
#6 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
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.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
December 6, 2013, 10:59 |
|
#7 |
Member
Join Date: Nov 2012
Posts: 83
Rep Power: 14 |
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 |
|
December 6, 2013, 14:42 |
|
#8 |
New Member
Bryan Schmidt
Join Date: Sep 2013
Posts: 18
Rep Power: 13 |
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 |
|
December 6, 2013, 18:53 |
|
#9 |
New Member
Bryan Schmidt
Join Date: Sep 2013
Posts: 18
Rep Power: 13 |
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 |
|
December 6, 2013, 19:02 |
|
#10 |
Member
Chris
Join Date: Aug 2012
Location: Calgary, Alberta, Canada
Posts: 77
Rep Power: 14 |
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. Last edited by ChrisA; December 7, 2013 at 01:49. |
|
December 6, 2013, 19:09 |
|
#11 | |
Member
Chris
Join Date: Aug 2012
Location: Calgary, Alberta, Canada
Posts: 77
Rep Power: 14 |
Quote:
Code:
Yt += Yi; (inside the loop species loop) Y[inertIndex] = scalar(1) - Yt; Y[inertIndex].max(0.0); |
||
December 6, 2013, 20:59 |
|
#12 |
New Member
Bryan Schmidt
Join Date: Sep 2013
Posts: 18
Rep Power: 13 |
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 |
|
December 6, 2013, 22:16 |
|
#13 |
New Member
Bryan Schmidt
Join Date: Sep 2013
Posts: 18
Rep Power: 13 |
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 |
|
December 7, 2013, 02:02 |
|
#14 | |
Member
Chris
Join Date: Aug 2012
Location: Calgary, Alberta, Canada
Posts: 77
Rep Power: 14 |
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) |
||
December 9, 2013, 13:16 |
|
#15 | ||
New Member
Bryan Schmidt
Join Date: Sep 2013
Posts: 18
Rep Power: 13 |
Quote:
Quote:
-B |
|||
December 9, 2013, 13:29 |
|
#16 |
Member
Chris
Join Date: Aug 2012
Location: Calgary, Alberta, Canada
Posts: 77
Rep Power: 14 |
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; forAll(Y, i) { fields.add(Y[i]); } 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. |
|
December 9, 2013, 14:09 |
|
#17 | |
New Member
Bryan Schmidt
Join Date: Sep 2013
Posts: 18
Rep Power: 13 |
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 |
||
December 9, 2013, 14:16 |
|
#18 |
Member
Chris
Join Date: Aug 2012
Location: Calgary, Alberta, Canada
Posts: 77
Rep Power: 14 |
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; forAll (Y, i) { fields.add(Y[i]); } PtrList<volScalarField> rhoY(Y.size()); forAll (Y, i) { rhoY.set ( i, new volScalarField ( IOobject ( "rhoYi", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), rho*Y[i] ) ); fields.add(Y[i]); } |
|
December 9, 2013, 14:49 |
|
#19 | |
New Member
Bryan Schmidt
Join Date: Sep 2013
Posts: 18
Rep Power: 13 |
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 |
||
December 9, 2013, 14:58 |
|
#20 |
Member
Chris
Join Date: Aug 2012
Location: Calgary, Alberta, Canada
Posts: 77
Rep Power: 14 |
The first few lines are as follows:
Code:
autoPtr<combustionModels::psiCombustionModel> reaction ( combustionModels::psiCombustionModel::New(mesh) ); psiReactionThermo& thermo = reaction->thermo(); thermo.validate(args.executable(), "h", "e"); basicMultiComponentMixture& composition = thermo.composition(); |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Solving Transport equation for additional variable using CFX | creddy_trddc | CFX | 11 | April 2, 2015 22:07 |
Calculation of the Governing Equations | Mihail | CFX | 7 | September 7, 2014 07:27 |
error message | cuteapathy | CFX | 14 | March 20, 2012 07:45 |
UDF Transport equation for transition momentum thickness Reynolds number | Wantami | FLUENT | 0 | April 9, 2011 03:50 |
Is it possible to use divergence in the source term of an scalar transport equation? | jannnesss | CFX | 0 | January 8, 2010 20:53 |