CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   reactingParcelFoam thermophysicalProperties (https://www.cfd-online.com/Forums/openfoam-solving/132979-reactingparcelfoam-thermophysicalproperties.html)

ecbmxer April 8, 2014 16:08

reactingParcelFoam thermophysicalProperties
 
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 April 28, 2014 16:16

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

massive_turbulence April 28, 2014 19:15

Quote:

Originally Posted by ecbmxer (Post 484754)
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).

ecbmxer April 28, 2014 19:57

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.

massive_turbulence April 28, 2014 20:43

Quote:

Originally Posted by ecbmxer (Post 488780)
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.

ecbmxer April 29, 2014 08:45

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!

massive_turbulence April 29, 2014 15:35

Quote:

Originally Posted by ecbmxer (Post 488899)
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.

ecbmxer April 30, 2014 15:41

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!

massive_turbulence April 30, 2014 16:50

Quote:

Originally Posted by ecbmxer (Post 489196)
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).


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