CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[Other] real gas model implementation for thermophysicalModels library

Register Blogs Community New Posts Updated Threads Search

Like Tree6Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 11, 2023, 01:39
Default
  #21
New Member
 
Nam Danh Nguyen
Join Date: Feb 2020
Location: UNIST-Ulsan-Korea
Posts: 25
Rep Power: 6
danhnam is on a distinguished road
Quote:
Originally Posted by eliotfoss View Post
Thanks for your reply, I see, I did not realize there would be a problem with the pimple loop itself, I hope that you can share you findings soon!

I had another question, in your paper, you define the strain rate for the counterflow non-premixed flame with a multiplying factor of 2. In the textbooks I've read this 2 is not included in the definition. Is this due to a lack of standardization for the definition, or some other reason?

Thank you for your time!
Hi Eliot Foss!

We referred to this paper for the global strain rate definition. https://www.researchgate.net/publica...ffusion_flames

Danh Nam,
danhnam is offline   Reply With Quote

Old   January 11, 2023, 01:45
Default
  #22
New Member
 
Nam Danh Nguyen
Join Date: Feb 2020
Location: UNIST-Ulsan-Korea
Posts: 25
Rep Power: 6
danhnam is on a distinguished road
Quote:
Originally Posted by rmishra View Post
In reference to the following file:

src/thermophysicalModels/specie/thermo/rfJanaf/rfJanafThermoI.H (Lines 286-295)

The dcpdT term is ideal. Since we are dealing with real gas combustion we need to solve for real gas Jacobian. So the temperature derivative will also include the derivative of departure function apart from the ideal gas part.

Please let me know if you have time to discuss this.

Hi Mishra!

You are right. When you retrieve the temperature from the enthalpy for real-gas cases, you need to derive dH/dT term (i.e., derivative of departure part w.t. the temperature). The existing code is only applicable for ideal gas problems.

Danh Nam,
danhnam is offline   Reply With Quote

Old   March 24, 2023, 03:23
Default
  #23
New Member
 
ShinyRiver's Avatar
 
Roozbeh
Join Date: Aug 2016
Location: Stuttgart, Germany
Posts: 7
Rep Power: 9
ShinyRiver is on a distinguished road
Quote:
Originally Posted by onofrio View Post
Good morning,

I found that, in PengRobinson equationOfState model, the M term, present in both Cp and CpMCv functions, is the same as in the soaveRedlichKwong model when actually it is not so (as you can see in the original PengRobinsonGas formulation). This fact leads to negative Cp (I’m dealing with nitrogen at cryogenic conditions).
If you substitute back the original formulation for the M term everything works fine.

Nicola
Hi Nicola,

I have the same problem of negative CP in FLUENT. There I have the possibility to correct the Peng-Robinson equation. Could you explain this modification a bit more in detail?

Thanks in advance
ShinyRiver is offline   Reply With Quote

Old   March 27, 2023, 20:14
Default Fast chemistry
  #24
New Member
 
Rohit Mishra
Join Date: Apr 2020
Posts: 2
Rep Power: 0
rmishra is on a distinguished road
Hello,

I believe one of the ways the chemistry libraries are changed, the chemistry model has to be selected among the different options of real gas EOS. However, can you tell me how would one go about also implementing reduction/tabulation since in classic OF the option was there as one of the entries to chemistryModel. Thanks.
rmishra is offline   Reply With Quote

Old   May 16, 2023, 22:37
Default cannot process ./Allwmake
  #25
New Member
 
araphi
Join Date: Apr 2023
Posts: 2
Rep Power: 0
araphi is on a distinguished road
Hello,
When I install, the directory ($WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments) is missing, the library cannot be installed, blockMesh and other operations cannot be performed.
araphi is offline   Reply With Quote

Old   June 29, 2023, 02:51
Default
  #26
Member
 
Ervin Adorean
Join Date: Mar 2009
Posts: 76
Rep Power: 17
adorean is on a distinguished road
Hello,

I saw in the tutorials that one is able to generate properties file for a temperature range but for a specific pressure.
How this library can be used for a case where one has 100 bar pressure difference between inlet and outlet?

Thank you!

Ervin
adorean is offline   Reply With Quote

Old   June 30, 2023, 03:52
Default
  #27
New Member
 
Nam Danh Nguyen
Join Date: Feb 2020
Location: UNIST-Ulsan-Korea
Posts: 25
Rep Power: 6
danhnam is on a distinguished road
Quote:
Originally Posted by rmishra View Post
Hello,

I believe one of the ways the chemistry libraries are changed, the chemistry model has to be selected among the different options of real gas EOS. However, can you tell me how would one go about also implementing reduction/tabulation since in classic OF the option was there as one of the entries to chemistryModel. Thanks.
Hi rmishra!

Sorry for my late reply. It's quite complicated. If you are still want to implement it for reduction/tabulation, please contact me via my email (danhnam11@gmail.com).

Danh Nam
danhnam is offline   Reply With Quote

Old   June 30, 2023, 03:54
Default
  #28
New Member
 
Nam Danh Nguyen
Join Date: Feb 2020
Location: UNIST-Ulsan-Korea
Posts: 25
Rep Power: 6
danhnam is on a distinguished road
Quote:
Originally Posted by araphi View Post
Hello,
When I install, the directory ($WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments) is missing, the library cannot be installed, blockMesh and other operations cannot be performed.
Hello araphi,

Did you solve your problem?
danhnam is offline   Reply With Quote

Old   June 30, 2023, 04:03
Default
  #29
New Member
 
Nam Danh Nguyen
Join Date: Feb 2020
Location: UNIST-Ulsan-Korea
Posts: 25
Rep Power: 6
danhnam is on a distinguished road
Quote:
Originally Posted by adorean View Post
Hello,

I saw in the tutorials that one is able to generate properties file for a temperature range but for a specific pressure.
How this library can be used for a case where one has 100 bar pressure difference between inlet and outlet?

Thank you!

Ervin
Hello Ervin!
Since the test case in the tutorial is designated only for generating thermophysical properties. Theoretically, if you provide p, T, then you can get properties. Actually, I don't know why you need to generate properties at such conditions (i.e., having a pressure difference between the inlet and outlet). If you need properties at 100 bar, just change the pressure in the internal domain to 100 bar. If you want to get the properties for a range of pressure, you can run several times corresponding to different pressures.
For your case, I have no idea. It would be better if you provide more information about your case. So that I may help you.

Danh Nam,
danhnam is offline   Reply With Quote

Old   June 30, 2023, 05:26
Default
  #30
Member
 
Ervin Adorean
Join Date: Mar 2009
Posts: 76
Rep Power: 17
adorean is on a distinguished road
Hello Danh Nam,

If I understand correctly, for a multiphase single component non reacting (CO2) simulation, for example if at time 0 the domain/outlet has 10 bar pressure, one needs to generate properties for 10 bar. And even if the inlet pressure BC is 100 bar, the model is able to get itself the correct properties, or I need to provide multiple .dat files (10,20, ... 100 bar)?

For example for interPhaseChangeFoam how should I change the thermophysicalProperties file and how to use the generated tabular properties file OF.p10.CO2.dat?

Is there somewhere such an example case, for whatever solver?

Thank you!

Best regards,

Ervin
adorean is offline   Reply With Quote

Old   July 5, 2023, 05:28
Default
  #31
Member
 
Ervin Adorean
Join Date: Mar 2009
Posts: 76
Rep Power: 17
adorean is on a distinguished road
Hello,

Anyone, please?

In Ansys, one can generate 1 real gas properties table for a range of temperatures and pressures. How can this be achieved here?

And how can one point the OpenFOAM solvers to use these properties files (OF.p10.CH4.dat, for example) in a case?

Thank you!

Best regards,

Ervin
adorean is offline   Reply With Quote

Old   July 5, 2023, 23:35
Default
  #32
New Member
 
Nam Danh Nguyen
Join Date: Feb 2020
Location: UNIST-Ulsan-Korea
Posts: 25
Rep Power: 6
danhnam is on a distinguished road
Hi Ervin!

Quote:
If I understand correctly, for a multiphase single component non reacting (CO2) simulation, for example if at time 0 the domain/outlet has 10 bar pressure, one needs to generate properties for 10 bar. And even if the inlet pressure BC is 100 bar, the model is able to get itself the correct properties, or I need to provide multiple .dat files (10,20, ... 100 bar)?

If you used the model in my library (and solver), it will automatically update your properties regardless your pressure inside the domain is 10 bar or 100 bar. As I sad, if you provide value of p and T, you can get properties.

For your case, you cannot use my real-gas library in interPhaseChangeFoam if you don't modify the solver since the interPhaseChangeFoam solver does not use "psiThermo" or "rhoThermo" class. And to develop a new version of "interPhaseChangeFoam" solver to be able used real-gas library is a different story.


Best regards,
Danh Nam
danhnam is offline   Reply With Quote

Old   July 6, 2023, 09:21
Question Use of the library in twoPhaseEulerFoam
  #33
New Member
 
riccardo
Join Date: Mar 2023
Posts: 7
Rep Power: 3
ricx is on a distinguished road
Hi!
Thank you for the library.
I am using a in house solver based on twoPhaseEulerFoam that requires Thermophysical models but not any kind of reactions. I am planning to add an equation of state for CH4 and also I would need the data for CH4 in order to calibrate the thermo coefficient to be chosen in a context of two phase liquid-gas non newtonian flow.
Would that make sense if I don`t consider reactions (and so also temperature effects)?

Thank you.
ricx is offline   Reply With Quote

Old   July 7, 2023, 02:15
Default
  #34
New Member
 
Nam Danh Nguyen
Join Date: Feb 2020
Location: UNIST-Ulsan-Korea
Posts: 25
Rep Power: 6
danhnam is on a distinguished road
Quote:
Originally Posted by ricx View Post
Hi!
Thank you for the library.
I am using a in house solver based on twoPhaseEulerFoam that requires Thermophysical models but not any kind of reactions. I am planning to add an equation of state for CH4 and also I would need the data for CH4 in order to calibrate the thermo coefficient to be chosen in a context of two phase liquid-gas non newtonian flow.
Would that make sense if I don`t consider reactions (and so also temperature effects)?

Thank you.
Hi!
I've just quickly checked the tutorial test case in "twoPhaseEulerFoam" and I found that this solver uses pureMixture model.
Actually, my real-gas library is not applicable for pureMixture model. If you want to implement it, pls contact me. I will let you know. For pureMixture its quite easy, you just copy my source code and do some modification.

Danh Nam.
danhnam is offline   Reply With Quote

Old   July 7, 2023, 03:28
Default
  #35
New Member
 
riccardo
Join Date: Mar 2023
Posts: 7
Rep Power: 3
ricx is on a distinguished road
Quote:
Originally Posted by danhnam View Post
Hi!
I've just quickly checked the tutorial test case in "twoPhaseEulerFoam" and I found that this solver uses pureMixture model.
Actually, my real-gas library is not applicable for pureMixture model. If you want to implement it, pls contact me. I will let you know. For pureMixture its quite easy, you just copy my source code and do some modification.

Danh Nam.
Hi,

Thank you for your answer. Yes, I am interested, I saw you shared your e-mail, I will contact you there.

Riccardo
ricx is offline   Reply With Quote

Old   October 15, 2023, 04:25
Default A problem during the installation
  #36
New Member
 
Congren Zheng
Join Date: Oct 2023
Posts: 1
Rep Power: 0
Congren_Zheng is on a distinguished road
Hi, the library is very nice. I got a problem during Allwmake.
The error code is like this:
In file included from specie/specie.H:155:0,
from specie/specie.C:26:
specie/specieI.H: In member function ‘void Foam::specie:perator+=(const Foam::specie&)’:
specie/specieI.H:108:21: error: ‘small’ was not declared in this scope
if (mag(sumY) > small)
^~~~~
specie/specieI.H:108:21: note: suggested alternative: ‘scalbl’
if (mag(sumY) > small)
^~~~~
scalbl
specie/specieI.H: In function ‘Foam::specie Foam:perator+(const Foam::specie&, const Foam::specie&)’:
specie/specieI.H:127:46: error: ‘small’ was not declared in this scope
const scalar sumY = max(st1.Y_ + st2.Y_, small);
^~~~~
specie/specieI.H:127:46: note: suggested alternative: ‘scalbl’
const scalar sumY = max(st1.Y_ + st2.Y_, small);
^~~~~
scalbl
specie/specieI.H: In function ‘Foam::specie Foam:perator==(const Foam::specie&, const Foam::specie&)’:
specie/specieI.H:157:22: error: ‘small’ was not declared in this scope
if (mag(diffY) < small)
^~~~~
specie/specieI.H:157:22: note: suggested alternative: ‘scalbl’
if (mag(diffY) < small)
^~~~~
scalbl
specie/specieI.H:165:24: error: ‘great’ was not declared in this scope
scalar molWeight = great;
^~~~~
specie/specieI.H:165:24: note: suggested alternative: ‘read’
scalar molWeight = great;
^~~~~
read
specie/specieI.H:166:23: error: ‘small’ was not declared in this scope
if (mag(diffRW) > small)
^~~~~
specie/specieI.H:166:23: note: suggested alternative: ‘scalbl’
if (mag(diffRW) > small)
^~~~~
scalbl
/usr/lib/openfoam/openfoam2306/wmake/rules/General/transform:37: recipe for target 'Make/linux64GccDPInt32Opt/specie/specie.o' failed
make: *** [Make/linux64GccDPInt32Opt/specie/specie.o] Error 1

The problem is that there is no definition of variable 'small'
Congren_Zheng 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compile User-Defined Real Gas Model (UDRGM) Captain Convergence Fluent UDF and Scheme Programming 31 November 6, 2020 06:30
make a new data from external .txt data and save it in a UDM etedalgara Fluent UDF and Scheme Programming 27 February 26, 2020 03:15
UDF velocity profile willroca Fluent UDF and Scheme Programming 2 January 10, 2016 03:13
Wrong flow in ratating domain problem Sanyo CFX 17 August 15, 2015 06:20
view factor yoollooz Fluent UDF and Scheme Programming 0 March 1, 2013 00:44


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