Integrated impl_cubics features into main#282
Integrated impl_cubics features into main#282JelleLagerweij wants to merge 15 commits intofeos-org:mainfrom
Conversation
also auto test cubic module
|
Sorry, without the 30k changes, I already can see some problems in my pull request:
I will first remove those before submitting a new pull request and, I will be more careful with this in the future (so there are less useless pull requests in this repository). |
…ignificant changes in unreleated modules)
|
Lol its clear that I mostly work on my own projects. Now it should be a proper pull request with only changes regarding what I am responsible for. :) |
|
Hi Jelle and thanks again for the contribution. If I may, here is a tip for the usual workflow when contributing to projects on Github:
How branches are used is different in projects, but usually we create a branch per feature (Philipp and I can do that directly in this repo, contributors have to fork). For this PR, you can leave it as is. Regarding the actual implementation: I think the next step would be to add tests as you mentioned. Ideally, for all alpha functions (I didn't test them in my implementation back then). I have to check for a better/correct naming for the mixing-rule but this is a simple refactor that can be done at any point. |
… do not pass testing
|
Hey there,
If anything is unclear, just let us know. Sorry again for the extra confusion and thank you for your efforts in tackling this comprehensive implementation of cubics! |
|
Hi, I was having a bit more time this weekend and spend some hours on the cubic implementation. As I saw that there were updates in the main repository, I tried to merge these first with my cubic branch. The merging went fine, however I encountered a problem with the Parameter -> Parameters change. If I got it correctly, instead of creating a struct for CubicParameters and implement that for Parameter, we will now create a So i looked more into the saftvrmie implementation there we do pub type SaftVRMieParameters =
Parameters<SaftVRMieRecord, SaftVRMieBinaryRecord, SaftVRMieAssociationRecord>;
pub struct SaftVRMiePars {
pub m: Array1<f64>,
pub sigma: Array1<f64>,
pub epsilon_k: Array1<f64>,
pub lr: Array1<f64>,
pub la: Array1<f64>,
pub sigma_ij: Array2<f64>,
pub epsilon_k_ij: Array2<f64>,
pub lr_ij: Array2<f64>,
pub la_ij: Array2<f64>,
pub c_ij: Array2<f64>,
pub alpha_ij: Array2<f64>,
}
impl ...First I thought that this was a simple trick to avoid the impl issue for types outside the its containing crate by creating a sort of shadow struct which then depends fully on the SaftVRMieParameters. However lateron I saw that both (SaftVRMieParameters and SaftVRMiePars) were used in the saftvrmie equation of state module. So for the Cubics implementation: We will an approach similar to saftvrmie: pub type CubicParameters = Parameters<CubicRecord, CubicBinaryRecord, ()>;
pub struct CubicPars {
...
}
impl CubicPars {
pub fn new(parameters: &CubicParameters) -> Self {
...
}
}And in mod.rs we will now have cubic pub struct Cubic {
/// Parameters
pub parameters: Arc<CubicParameters>,
pub params: Arc<CubicPars>,
pub options: CubicOptions,
/// processed parameters using model and substance critical data
pub critical_parameters: CriticalParameters,
}However, what properties SHOULD be in |
|
Hi, just checking, because I'm not sure, you saw my previous post (we posted somewhat simultaneously). That should explain most of your questions around the |
As per request by @g-bauer, I created a new pull request comparing to main.
Jelle
For reference, original pull request text is below
Dear all,
I forked the feos main repository and copied all the added functions in impl_cubics to the new structure. During this project the following major changes are made:
Project level:
Feos create level:
Next steps:
While the code compiles correctly now, there are definetly some tasks left.
Regards,
Jelle