-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Soave-Redlich-Kwong (SRK) EOS #159
Comments
@corykinney Awesome, thanks for taking this on! Please feel free to reach out directly to me if you want to set up a meeting to go over the code structure or how to make additions to C++ 😄 |
@bryanwweber Thanks! I will most likely take you up on that once I have a chance to experiment a bit more and figure out the right questions to ask. Regarding the input file structure, I see on the example yaml files for the PR and RK equations of state that the I would think it would be most flexible if the critical temperature, pressure (and optionally acentric factor) were included in the yaml file and the user could set the equation of state upon loading the mechanism so that the files could be reused as much as possible, the |
Hi @corykinney Glad you are tacklling this! The code is set up to calculate |
@decaluwe Thanks for the explanation and the links to the code segments. I was aware of the Do you have any thoughts on reusing input files and specifying equation of state when the gas_ideal = ct.Solution("input.yaml", eos="ideal")
gas_PR = ct.Solution("input.yaml", eos="PR") |
I certainly see the value there. It would be a slight departure from current Cantera norms. Currently, to do this, you'd have a phase declaration for each phase, and just load that phase. Which is not a huge amount of extra work, if you just have the repeat the phase declarations in the input file, but can re-use the same species definitions. I actually don't know if this is possible, currently - can the ideal gas model use a species defined for a real gas phase? I'll try and look into it, when I've got a minute. |
@ischoegl So if the currenty YAML implementation supports multiple thermo models, would the current approach require copies of the file with different values for the Also, as a side note, I'll take an approach similar to @gkogekar did in documenting her approach with |
Hi @corykinney -- as in @gkogekar's input file, there, I think the prefered approach is to just have one input file. In this file, each species is defined just once, and each species definition can contain all the necessary info for multiple Then in the gas_RK = ct.Solution('input.yaml', 'RK_phase')
gas_SRK = ct.Solution('input.yaml', 'SRK_phase') where Hopefully I'm understanding your question correctly - let me know, if not! |
To provide a concrete example, the following is how you can currently define a species that can be used in either a Redlich-Kwong or Peng-Robinson thermo model: - name: H2O
composition: {H: 2, O: 1}
thermo:
model: NASA7
temperature-ranges: [200.0, 1000.0, 3500.0]
data:
- [4.19864056, -0.0020364341, 6.52040211e-06, -5.48797062e-09, 1.77197817e-12,
-30293.7267, -0.849032208]
- [3.03399249, 0.00217691804, -1.64072518e-07, -9.7041987e-11, 1.68200992e-14,
-30004.2971, 4.9667701]
critical-parameters:
critical-temperature: 647.096
critical-pressure: 22.064 MPa
acentric-factor: 0.344
equation-of-state:
- model: Peng-Robinson
binary-a:
H2: 4 bar*cm^6/mol^2
CO2: 7.897e7 bar*cm^6/mol^2
- model: Redlich-Kwong
a: [1.14972e+14, 0]
b: 166.7180412 This definition would also work if either the For phase definitions, to enable the use like in @decaluwe's example, the phases:
- name: RK_phase
thermo: Redlich-Kwong
kinetics: gas
state:
T: 300.0
P: 1.01325e+05
- name: SRK_phase
thermo: Soave-Redlich-Kwong
kinetics: gas
state:
T: 300.0
P: 1.01325e+05 Given the relatively small differences between the R-K and SRK equations of state, I hope this implementation can be done in a way that keeps as much functionality as possible in a common base class and avoids copy-pasting large chunks of the existing R-K implementation. |
@decaluwe @speth Thanks for the information, I didn't know it could be done that way! That's more or less what I was asking if was possible (aside maybe the explicit definition of compatible phases, but that's not inconvenient).
Right now I'm thinking about getting it working through large amounts of copying with the idea of writing test cases and then working back toward maybe a |
As you may have already noticed, there is a common base class used by the I'm not opposed to dropping the incomprehensible suffix from |
@speth so it can be assumed that the |
At present, I think that's probably a safe assumption. |
Abstract
Cantera currently offers the Redlich-Kwong and Peng-Robinson equations of state. Addition of a Soave-Redlich-Kwong model should not be too difficult as the implementation would largely parallel the other two equations of state.
Motivation
Addition of SRK support would allow for chemical kinetics simulations with Cantera for conditions and mixtures that are best modeled by this EOS (for example, supercritical CO2 cycle conditions).
I've started working on this over at
corykinney:SRK
but it'll likely take me a while as I'm not as experienced with C++ and thus I'll be leaning quite heavily on thePengRobinson
implementation.The text was updated successfully, but these errors were encountered: