|
[Sponsors] |
September 7, 2012, 14:38 |
gasThermoPhysics thermo type and Cv
|
#1 |
Member
Chris
Join Date: Aug 2012
Location: Calgary, Alberta, Canada
Posts: 77
Rep Power: 13 |
I'm fairly new to OpenFOAM and my C++ experience is limited/rusty. I've done my best to understand how OpenFOAM organises itself at runtime but I'm having some issues. My nomenclature may be off while describing my problem but hopefully I'm somewhat understandable.
I want to be able to call Cv in my solver (rhoCentralFoam solver with reactions, my starting point was Nakul's reactingFoam implementation posted here: here). The original rhoCentralFoam solver is able to call Cv from the basicPsiThermo class which solves for it in specieThermo with my case's given thermotype. When implementing the reactions in the solver hsCombustionThermo is the class used to make the Cp/Cv calls. Cp is called and solved for fine but Cv gets the basicThermo notimplimented runtime error message. I can't figure out the issue as basicPsiThermo is called within hsCombustionThermo and the gasThermoPhysics thermotype has specieThermo defined within it. As far as I can tell there should be no difference between the two implementations. I think it has something to do with how OpenFoam handles the gasThermoPhysics thermotype at runtime but I can't be positive. Has anyone had a similar issue or able to offer up some insight regarding this? Last edited by ChrisA; September 7, 2012 at 15:04. |
|
September 7, 2012, 18:15 |
|
#2 |
Member
Chris
Join Date: Aug 2012
Location: Calgary, Alberta, Canada
Posts: 77
Rep Power: 13 |
I finally found the missing link. hsPsiMixtureThermo doesn't have Cv defined, I copied the Cp functions and it seems to work now.
|
|
January 11, 2013, 03:49 |
|
#3 |
Member
Hagen Müller
Join Date: Nov 2010
Posts: 34
Rep Power: 15 |
Hi Chris, I face the same problem and also added the missing member functions Cv, and Cv(T, face i) in hsRhoMixtureThermo by copying Cp and Cp(T, face i). Unfortunately this causes a new problem. When running a case I got the following message:
"new cannot satisfy memory request. This does not necessarily mean you have run out of virtual memory. It could be due to a stack violation caused by e.g. bad use of pointers or an out of date shared library Aborted" I figured it has to be in the line: tmp<scalarField> tCv(new scalarField(T.size())); Unfortunately I have no clue how to solve this. Did you have similar problems? Any idea why this doesn't work? Any help is appreciated, Hagen |
|
January 11, 2013, 12:52 |
|
#4 |
Member
Chris
Join Date: Aug 2012
Location: Calgary, Alberta, Canada
Posts: 77
Rep Power: 13 |
Hi Hagen,
I'm not sure I'll be of much help, my C++ is rusty at best, but I'll try! Where does this line pop up in the code? You have to copy the cp/Cp functions all the way down to where their calculated and not just in hsRhoMixtureThermo, I think... it was a really long time ago when I did this change and I seem to have only made notes on the non-obvious addition (for me, which was hsPsiMixtureThermo). Last edited by ChrisA; January 11, 2013 at 14:09. |
|
January 12, 2013, 09:26 |
|
#5 |
Member
Hagen Müller
Join Date: Nov 2010
Posts: 34
Rep Power: 15 |
Thank you for your help! I found the problem in the meantime. The error was however not in the implementation but in the wrong inclusion of Header files. I forgot to include the modified thermophysicalProperties, when compiling the turbulenceModels, but included them in the solver. The compiler did not complane at compile-time but called Cv during the calculation of the viscosity, which is nonsense. Recompiling the turbulenceModels helped. Thanks again and sorry for bothering you with this.
|
|
February 11, 2013, 09:07 |
|
#6 | |
New Member
Tatu Pinomaa
Join Date: Oct 2012
Location: Finland
Posts: 16
Rep Power: 13 |
Hi Chris,
Quote:
Tatu Last edited by tatu; February 22, 2013 at 03:55. Reason: typo: + sign --> - sign |
||
February 11, 2013, 11:49 |
|
#7 |
Member
Chris
Join Date: Aug 2012
Location: Calgary, Alberta, Canada
Posts: 77
Rep Power: 13 |
That is correct, but if memory serves, at the time I was having issues calling up the specific ideal gas constant for the mixture as well. So I had the choice to figure out how to get Cv or R, I picked Cv. At any rate, the whole adventure allowed me to better understand the internal structure of the thermodynamic and mixture solvers in OF.
|
|
|
|