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

reactingParcelFoam thermophysicalProperties

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 8, 2014, 17:08
Default reactingParcelFoam thermophysicalProperties
  #1
Member
 
Clint Bedick
Join Date: May 2011
Posts: 43
Rep Power: 15
ecbmxer is on a distinguished road
Hi everyone!

I'm using the reactingParcelFoam tutorial to model particle impact and rebound (or sticking). This is in conjunction with an experiment we are conducting with high speed video and pyrometry. So I should end up with a pretty nice validation case in the end. I turned off all reactions (we are only interested in the stick/rebound behavior), and the carrier gas for the particles is N2.

Right now I am defining my particles as "ash". Initially I used the default particle properties (defaultCoeffs yes). But now that I have things working, I want to specify properties that are actually relevant to the different particles that I will be modeling (pyrite, etc).

So I changed the thermophysical properties file so that defaultCoeffs was "no", and specified constant values for rho, cp, k, Hf (0 here since I'm assuming solid phase only), and emissivity. Reading some posts on here and some other examples, I should be able to specify these as polynomials if I want, correct? Can anybody tell me how I would go about doing that? I was under the impression I could do that without having to actually alter the solver. However I tried a few different formats that I found in other tutorials and none of them seemed to work out.

Thanks for any help!

-Clint
ecbmxer is offline   Reply With Quote

Old   April 28, 2014, 17:16
Default
  #2
Member
 
Clint Bedick
Join Date: May 2011
Posts: 43
Rep Power: 15
ecbmxer is on a distinguished road
I wanted to try and bump this up. After looking at the "ash" class, it seems these properties can only be defined as constants. Can anyone help me out to modify the source code to define rho, cp, and k as a function of temperature?

Thanks!

-Clint
ecbmxer is offline   Reply With Quote

Old   April 28, 2014, 20:15
Default
  #3
Senior Member
 
Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 13
massive_turbulence is on a distinguished road
Quote:
Originally Posted by ecbmxer View Post
Hi everyone!

I'm using the reactingParcelFoam tutorial to model particle impact and rebound (or sticking). This is in conjunction with an experiment we are conducting with high speed video and pyrometry. So I should end up with a pretty nice validation case in the end. I turned off all reactions (we are only interested in the stick/rebound behavior), and the carrier gas for the particles is N2.

Right now I am defining my particles as "ash". Initially I used the default particle properties (defaultCoeffs yes). But now that I have things working, I want to specify properties that are actually relevant to the different particles that I will be modeling (pyrite, etc).

So I changed the thermophysical properties file so that defaultCoeffs was "no", and specified constant values for rho, cp, k, Hf (0 here since I'm assuming solid phase only), and emissivity. Reading some posts on here and some other examples, I should be able to specify these as polynomials if I want, correct? Can anybody tell me how I would go about doing that? I was under the impression I could do that without having to actually alter the solver. However I tried a few different formats that I found in other tutorials and none of them seemed to work out.

Thanks for any help!

-Clint
You should definitely try going the polynomial route because the other route, reverse engineering openfoam looks terribly complicated (I looked at github and I know C++ really well, but openfoam is something that has to be studied religiously before changing the source).

As for making up the polynomial, I too wonder how to add that into the properties (fortunately for me steam is simple, but I too wonder about other types of fluids to use in the future case).
massive_turbulence is offline   Reply With Quote

Old   April 28, 2014, 20:57
Default
  #4
Member
 
Clint Bedick
Join Date: May 2011
Posts: 43
Rep Power: 15
ecbmxer is on a distinguished road
Well right, that is what I want to do, define cp, rho, k, as polynomials. However in the solidProperties class (ash, C, or CaCO3) you can only define these as constants. In liquid phase Lagrangian simulations, you can in fact specify properties as polynomials. Ideally, I would like to steal parts of the liquidProperties code to modify solidProperties.
ecbmxer is offline   Reply With Quote

Old   April 28, 2014, 21:43
Default
  #5
Senior Member
 
Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 13
massive_turbulence is on a distinguished road
Quote:
Originally Posted by ecbmxer View Post
Well right, that is what I want to do, define cp, rho, k, as polynomials. However in the solidProperties class (ash, C, or CaCO3) you can only define these as constants. In liquid phase Lagrangian simulations, you can in fact specify properties as polynomials. Ideally, I would like to steal parts of the liquidProperties code to modify solidProperties.

If you can show me the two files I might be able to do it but I don't understand how these properties are used by the solver.
massive_turbulence is offline   Reply With Quote

Old   April 29, 2014, 09:45
Default
  #6
Member
 
Clint Bedick
Join Date: May 2011
Posts: 43
Rep Power: 15
ecbmxer is on a distinguished road
Yea, thats the thing. I don't know exactly how the polynomial functions are implemented. I was looking at these (2) files below and you can see in the liquidProperties file, under member functions rho, cp, etc are defined as functions of T and P. Then there are some properties defined as constants in the same way all of the properties are in solidProperties. I don't know what it would take to replicate the variable rho, cp, k, and emissivity for solidProperties. Maybe it isn't as simple as that. I was worried that there are other functions and classes associated with defining these variable properties.

solidProperties:
http://foam.sourceforge.net/docs/cpp/a09605_source.html

liquidProperties:
http://foam.sourceforge.net/docs/cpp/a09585_source.html

Thanks for any help or advice you might have!
ecbmxer is offline   Reply With Quote

Old   April 29, 2014, 16:35
Default
  #7
Senior Member
 
Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 13
massive_turbulence is on a distinguished road
Quote:
Originally Posted by ecbmxer View Post
Yea, thats the thing. I don't know exactly how the polynomial functions are implemented. I was looking at these (2) files below and you can see in the liquidProperties file, under member functions rho, cp, etc are defined as functions of T and P. Then there are some properties defined as constants in the same way all of the properties are in solidProperties. I don't know what it would take to replicate the variable rho, cp, k, and emissivity for solidProperties. Maybe it isn't as simple as that. I was worried that there are other functions and classes associated with defining these variable properties.

solidProperties:
http://foam.sourceforge.net/docs/cpp/a09605_source.html

liquidProperties:
http://foam.sourceforge.net/docs/cpp/a09585_source.html

Thanks for any help or advice you might have!

I'm not sure if you're experienced with debugging but my advice would be to compile openfoam with codeblocks and step through (with a debugger) a run of a reactingParcelFoam simulation to get the idea of how the liquidProperties.C variables are loaded when the simulation starts (assuming that is made only once; but in your case a change would need to be made where these properties (solidProperties.C) aren't constant and change in time so they would need to be called in every loop of the solver). That's my best guess.

Once you can get the debugger up and running and testing a simple run then it would still be next to very difficult to make those changes. I for one cannot do that since I have no real expertise how the solver itself works and my knowledge of thermodynamics is pretty general.

Last edited by massive_turbulence; April 29, 2014 at 16:37. Reason: grammar
massive_turbulence is offline   Reply With Quote

Old   April 30, 2014, 16:41
Default
  #8
Member
 
Clint Bedick
Join Date: May 2011
Posts: 43
Rep Power: 15
ecbmxer is on a distinguished road
Thats what I am worried about. I have no idea how reactingParcelFoam calls these things each iteration. The only thing that gave me a bit of hope was that I can define my particles as liquid H2O, and it will allow those variables to be updated each iteration.

I'm not too familiar with debugging like you mention. But that seems like a great way to see what is going on. Do you have a link for some kind of a tutorial on debugging source modifications in OpenFOAM?

Worst case scenario, I will call my particles "liquid" "H2O" but put in the properties of my solid. I just have to set the triple and critical point T/P/V right so it never thinks it's changing to vapor, etc. I got it to run already like that. I need to do a detailed comparison with constant props comparing the solid vs liquid definitions, to make sure my particle temps, velocities, etc stay the same.

It would have just been nice to be able to define as a solid "ash" since that is what I am modeling. Thanks for your time and input!
ecbmxer is offline   Reply With Quote

Old   April 30, 2014, 17:50
Default
  #9
Senior Member
 
Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 13
massive_turbulence is on a distinguished road
Quote:
Originally Posted by ecbmxer View Post
Thats what I am worried about. I have no idea how reactingParcelFoam calls these things each iteration. The only thing that gave me a bit of hope was that I can define my particles as liquid H2O, and it will allow those variables to be updated each iteration.

I'm not too familiar with debugging like you mention. But that seems like a great way to see what is going on. Do you have a link for some kind of a tutorial on debugging source modifications in OpenFOAM?
You might be able to do it without a debugger using these pages.

http://foam.sourceforge.net/docs/cpp/files.html

If you want to get into debugging codeblocks is a great IDE to start with. You just need some simple example code, like some C++ tutorials to start with and try stepping through a program using F7. Getting to the level of compiling and debugging openfoam however does require a much deeper understanding of C++ and that might take years if you haven't used their style of OOP.

Kind of off-topic but I noticed they use autopointers in openfoam and those are deprecated as of C++ 11 which just shows how much maintenance there is with openfoam.

Quote:
Worst case scenario, I will call my particles "liquid" "H2O" but put in the properties of my solid. I just have to set the triple and critical point T/P/V right so it never thinks it's changing to vapor, etc. I got it to run already like that. I need to do a detailed comparison with constant props comparing the solid vs liquid definitions, to make sure my particle temps, velocities, etc stay the same.

It would have just been nice to be able to define as a solid "ash" since that is what I am modeling. Thanks for your time and input!
I also wondered about that too, does it really matter what you put into these files, it's not like the computer can tell the difference.

The only thing you have to worry about in the end is whether or not the final result of your calculations have basis in reality (experimental data).
massive_turbulence is offline   Reply With Quote

Reply


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



All times are GMT -4. The time now is 23:24.