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 Tree7Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 11, 2023, 02:39
Default
  #21
New Member
 
Nam Danh Nguyen
Join Date: Feb 2020
Location: UNIST-Ulsan-Korea
Posts: 29
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, 02:45
Default
  #22
New Member
 
Nam Danh Nguyen
Join Date: Feb 2020
Location: UNIST-Ulsan-Korea
Posts: 29
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, 04:23
Default
  #23
New Member
 
ShinyRiver's Avatar
 
Roozbeh
Join Date: Aug 2016
Location: Stuttgart, Germany
Posts: 8
Rep Power: 10
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, 21: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, 23: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, 03: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, 04:52
Default
  #27
New Member
 
Nam Danh Nguyen
Join Date: Feb 2020
Location: UNIST-Ulsan-Korea
Posts: 29
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, 04:54
Default
  #28
New Member
 
Nam Danh Nguyen
Join Date: Feb 2020
Location: UNIST-Ulsan-Korea
Posts: 29
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, 05:03
Default
  #29
New Member
 
Nam Danh Nguyen
Join Date: Feb 2020
Location: UNIST-Ulsan-Korea
Posts: 29
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, 06: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, 06: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 6, 2023, 00:35
Default
  #32
New Member
 
Nam Danh Nguyen
Join Date: Feb 2020
Location: UNIST-Ulsan-Korea
Posts: 29
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, 10: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, 03:15
Default
  #34
New Member
 
Nam Danh Nguyen
Join Date: Feb 2020
Location: UNIST-Ulsan-Korea
Posts: 29
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, 04: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, 05: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

Old   April 27, 2024, 12:17
Default I'm facing the same problems as you
  #37
New Member
 
Ryan Cooper
Join Date: Oct 2023
Posts: 2
Rep Power: 0
shrigames is on a distinguished road
I got the same error for Allwake. And is the real Gas solver configured for openFoam 9 and above?
shrigames is offline   Reply With Quote

Old   June 18, 2024, 10:02
Default Port to esi (2312)
  #38
Member
 
Al Csc
Join Date: Jul 2018
Posts: 31
Rep Power: 8
al.csc is on a distinguished road
Thank you for sharing such a great work. Does anyone plan to port it to ESI? If not, I can start and create a pull request
al.csc is offline   Reply With Quote

Old   September 2, 2024, 12:49
Default
  #39
New Member
 
li xuejiao
Join Date: Jul 2024
Posts: 2
Rep Power: 0
Li Xuejiao is on a distinguished road
When I wanted to replace methane with hydrogen in the case tutorials/laminarCounterFlowFlame-2D/GRI30/, I used H2_Li from inputThermoData_OF_format, but I encountered the following error. Does anyone know the reason for this? I would greatly appreciate your help.
Selecting chemistryReader foamChemistryReader
#0 Foam::error:rintStack(Foam::Ostream&) at ??:?
#1 Foam::sigFpe::sigHandler(int) at ??:?
#2 ? in "/lib/x86_64-linux-gnu/libc.so.6"
#3 Foam:imensionedField<double, Foam::volMesh>:perator/=(Foam:imensionedField<double, Foam::volMesh> const&) at ??:?
#4 Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>:perator/=(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at ??:?
#5 Foam::SRKchungKineticMixture<Foam::chungKineticTra nsport<Foam::species::thermo<Foam::rfJanafThermo<F oam::soaveRedlichKwongFoam::rfSpecie >, Foam::sensibleEnthalpy> > >::correctMassFractions() at ??:?
#6 Foam::SRKchungKineticMixture<Foam::chungKineticTra nsport<Foam::species::thermo<Foam::rfJanafThermo<F oam::soaveRedlichKwongFoam::rfSpecie >, Foam::sensibleEnthalpy> > >::SRKchungKineticMixture(Foam::dictionary const&, Foam::ListFoam::word const&, Foam::HashPtrTable<Foam::chungKineticTransport<Foa m::species::thermo<Foam::rfJanafThermo<Foam::soave RedlichKwongFoam::rfSpecie >, Foam::sensibleEnthalpy> >, Foam::word, Foam::string::hash> const&, Foam::fvMesh const&, Foam::word const&) at ??:?
#7 Foam::SRKchungKineticReactingMixture<Foam::chungKi neticTransport<Foam::species::thermo<Foam::rfJanaf Thermo<Foam::soaveRedlichKwongFoam::rfSpecie >, Foam::sensibleEnthalpy> > >::SRKchungKineticReactingMixture(Foam::dictiona ry const&, Foam::fvMesh const&, Foam::word const&) at ??:?
#8 Foam::heThermo<Foam:siReactionThermo, Foam::SpecieMixture<Foam::SRKchungKineticReactingM ixture<Foam::chungKineticTransport<Foam::species:: thermo<Foam::rfJanafThermo<Foam::soaveRedlichKwong Foam::rfSpecie >, Foam::sensibleEnthalpy> > > > >::heThermo(Foam::fvMesh const&, Foam::word const&) at ??:?
#9 Foam::hePsiThermo<Foam:siReactionThermo, Foam::SpecieMixture<Foam::SRKchungKineticReactingM ixture<Foam::chungKineticTransport<Foam::species:: thermo<Foam::rfJanafThermo<Foam::soaveRedlichKwong Foam::rfSpecie >, Foam::sensibleEnthalpy> > > > >::hePsiThermo(Foam::fvMesh const&, Foam::word const&) at ??:?
#10 Foam:siReactionThermo::addfvMeshConstructorToTab le<Foam::hePsiThermo<Foam:siReactionThermo, Foam::SpecieMixture<Foam::SRKchungKineticReactingM ixture<Foam::chungKineticTransport<Foam::species:: thermo<Foam::rfJanafThermo<Foam::soaveRedlichKwong Foam::rfSpecie >, Foam::sensibleEnthalpy> > > > > >::New(Foam::fvMesh const&, Foam::word const&) at ??:?
Floating point exception (core dumped)
Li Xuejiao is offline   Reply With Quote

Old   October 25, 2024, 07:49
Question problems with externalWallHeatFluxTemperature BC
  #40
New Member
 
zhang ting
Join Date: Sep 2022
Posts: 1
Rep Power: 0
wellzt is on a distinguished road
Hi guys,

Did somebody ever tried BC "externalWallHeatFluxTemperature"?
I encounter some problems with this, when I use BC like
{
type externalWallHeatFluxTemperature;
mode flux;
q uniform 118000;

kappaMethod lookup;
kappa kappa;

value $internalField;
}
Solver will crush at EEqn.solve():
{
#0 Foam::error:rintStack(Foam::Ostream&) at ??:?
#1 Foam::sigFpe::sigHandler(int) at ??:?
#2 ? in "/lib/x86_64-linux-gnu/libc.so.6"
#3 Foam::rfJanafThermo<Foam::PengRobinson<Foam::rfSpe cie> >::Ha(double, double) const at ??:?
#4 Foam::heThermo<Foam::rhoReactionThermo, Foam::SpecieMixture<Foam::PRchungTakaReactingMixtu re<Foam::chungTakaTransport<Foam::species::thermo< Foam::rfJanafThermo<Foam::PengRobinson<Foam::rfSpe cie> >, Foam::sensibleEnthalpy> > > > >::he(Foam::Field<double> const&, Foam::Field<double> const&, int) const at ??:?
#5 Foam::mixedEnergyFvPatchScalarField::updateCoeffs( ) at ??:?
#6 Foam::fvMatrix<double>::fvMatrix(Foam::GeometricFi eld<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::dimensionSet const&) in "/home/wellzt/OpenFOAM/wellzt-6/platforms/linux64GccDPInt32Opt/bin/realFluidRhoReactingBuoyantFoam"
#7 Foam::tmp<Foam::fvMatrix<double> > Foam::fv:ptionList:perator()<double>(Foam::Geo metricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::word const&) in "/home/wellzt/OpenFOAM/wellzt-6/platforms/linux64GccDPInt32Opt/bin/realFluidRhoReactingBuoyantFoam"
#8 ? in "/home/wellzt/OpenFOAM/wellzt-6/platforms/linux64GccDPInt32Opt/bin/realFluidRhoReactingBuoyantFoam"
#9 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#10 ? in "/home/wellzt/OpenFOAM/wellzt-6/platforms/linux64GccDPInt32Opt/bin/realFluidRhoReactingBuoyantFoam"
Floating point exception
}
Why should it happend? externalWallHeatFluxTemperatureFvPatchScalarField. C located at src\TurbulenceModels\compressible\turbulentFluidTh ermoModels\derivedFvPatchFields\externalWallHeatFl uxTemperature. As I see, the turbulentFluidThermoModels were recompiled in realFluidThermophysicalModels-6

best,
jeff
wellzt 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 07: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 04:15
UDF velocity profile willroca Fluent UDF and Scheme Programming 2 January 10, 2016 04:13
Wrong flow in ratating domain problem Sanyo CFX 17 August 15, 2015 07:20
view factor yoollooz Fluent UDF and Scheme Programming 0 March 1, 2013 01:44


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