|
[Sponsors] |
Extract a member function from a class of different solver for "Source Term" |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 24, 2019, 07:33 |
Extract a member function from a class of different solver for "Source Term"
|
#1 | |
Senior Member
|
Dear Foamers,
My topic of research is related to coal pyrolysis (solid region) in OpenFOAM. As we know that, when the coal decomposes due to heat, the gases will be released in different fashions. In my first step of work, I simulated coal decomposition process and calculated the heat release rates. In my next step, I need to figure out the path of coal decomposed gases - through streamline plot. Basically, there are 2 different models - Fluid and Solid. In Fluid model, there is a provision to draw streamline plot for fluid mediums. But in my case of solid pyrolysis model, its not possible to plot streamline graph for coal released gases, because there involve only Solid --> no gas (medium). Concerning this, I need to develop a separate gas flow (fluid) model for coal released gases based on equations mentioned below: Quote:
This source term comes from the member functions of the class "ODESolidChemistryModel". https://github.com/OpenFOAM/OpenFOAM...emistryModel.H So while developing fluid model, under createFields, I have to use a pointer to the class ODESolidChemistryModel". Only then, I can extract the member function RRg - as a source term for continuity equation. But I am not sure how to figure out this pointer. I'm not even sure with my approach... Any ideas as how to to extract the member function (RRg) from a class (ODESolidChemistryModel) for the gas flow modelling ? Kindly someone share ideas please. Thank you |
||
December 24, 2019, 18:05 |
|
#2 |
Senior Member
Join Date: Aug 2015
Posts: 494
Rep Power: 15 |
Have you looked at coalChemistryFoam? My understanding is that it uses solid (lagrangian) particles to track coal within the gas phase.
Caelan |
|
December 25, 2019, 01:06 |
|
#3 | ||||
Senior Member
|
Hello Mr. Clapointe,
Thank you for your response. (1) Your point is valid "solid (lagrangian) particles to track coal within the gas phase". As per your suggestion, I have looked into coalChemistryFoam, the foam was defined only with the following class below, (not related to solidChemistry model) Quote:
I look into solvers, in order to search for the class related to "solidChemistryModel for pyrolysis" In Heat_transfer solver: the class: basicSolidThermo is implemented as, Quote:
The class: basicSolidThermo is obtained from the thermophysicalModels, Quote:
(3) Guess, I'm looking for the Class::solidReaction defined in thermophysical model as, Quote:
This Class::solidReaction was not used anywhere in OpenFOAM. Any ideas how to proceed further ? Kindly share your ideas Thank you |
|||||
December 25, 2019, 17:30 |
|
#4 |
Senior Member
Join Date: Aug 2015
Posts: 494
Rep Power: 15 |
Well I imagine that a (lagrangian) solver that uses some form of reacting cloud would be able to handle reactions -- and by extension a solver named coalChemistryFoam would handle solid to gas phase change for subsequent (gas phase) combustion. And for a lagrangian solver, I would imagine that associated source code would be in src/lagrangian/.../. What you looked at is model instantiation (combustion/turbulence) for gas-phase modeling. But what about looking instead at the (solid particle) lagrangian modeling? Although I could be wrong, I don't think the solidThermo code you referenced will come into play.
Caelan |
|
December 26, 2019, 00:56 |
|
#5 | |
Senior Member
|
Hello Mr. Clapointe,
Thank you for your response. Yes, lagrangian solver that uses some form of reacting cloud to handle reaction. Under src/lagrangian, the pointers are declared. Here in OF 2.1.1, the suffix "New.C" folder name contains the pointer declaration with syntax: Foam::autoPtr XXX. Quote:
|
||
December 26, 2019, 02:10 |
|
#6 | |||
Senior Member
|
In addition, I looked into the solid pyrolysis modelling.
(1) The pointers are declared in thermophysicalModels as, Quote:
Quote:
Quote:
In my case, the RRg has been calculated already in another solver. So, I want to load the existing result and process them. Extract a member function from a class by using autoPtr As stated here in this link, (i) If the pointer declared is for new reaction calculations (or) (ii) to load existing results - each strategy requires different approaches. Keep exploring to find a way.. |
||||
December 26, 2019, 06:37 |
|
#7 |
Senior Member
Join Date: Aug 2015
Posts: 494
Rep Power: 15 |
If you look at the (gas phase) continuity equation for coalChemistryFoam, there is a particle source term so there is clearly some method for transfer of mass from the solid particle phase to the gas phase. So regardless of how you access it this is happening. I mentioned coalChemistryFoam as a potential method, but it seems that you already are set in the way you calculate it. So perhaps this thread may help : Extracting Reaction Rates OF20x.
Caelan |
|
December 26, 2019, 22:32 |
|
#8 | |
Senior Member
|
Hello Caelan, Thank you for your patient response then and there.
I guess, I didn't approach my problem in right manner. As stated above, In continuity equation, the source term RRg [reaction rate of pyrolysis gases from the solid pyrolysis model] was one of the already calculated variables in my 1D pyrolysis model. So, its not necessary to call any pointer variable, I think. Because, calling any member function (RRg) from a class simulates the respective phenomenon once again. But in my case, the reaction rate was already calculated, so I just need to extract it --> my first step to do. Then, I should load the reaction rate in the source term of continuity equation. Quote:
Kindly correct me if I'm wrong anywhere. **Your comments helps me to think better ^_^ Thank you again |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
issue compiling new turbulence model | perplexed user | OpenFOAM Programming & Development | 1 | January 13, 2012 03:40 |
[blockMesh] BlockMesh FOAM warning | gaottino | OpenFOAM Meshing & Mesh Conversion | 7 | July 19, 2010 14:11 |
latest OpenFOAM-1.6.x from git failed to compile | phsieh2005 | OpenFOAM Bugs | 25 | February 9, 2010 04:37 |
Compilation errors in ThirdPartymallochoard | feng_w | OpenFOAM Installation | 1 | January 25, 2009 06:59 |
Droplet Evaporation | Christian | Main CFD Forum | 2 | February 27, 2007 06:27 |