Skip to content
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

GERG rewrite #61

Merged
merged 52 commits into from
Jan 12, 2022
Merged

GERG rewrite #61

merged 52 commits into from
Jan 12, 2022

Conversation

longemen3000
Copy link
Member

@longemen3000 longemen3000 commented Jan 12, 2022

  • GERG now uses the param machinery. it could open the door to parse parameters from files, like TREND does. with that rework, came a lot of other secundary things:
    New functions:
    pack_vectors(SingleParam{Vector{T}} -> PackedVectorSingleParam{T}, stores the vector of vectors in a flat buffer, speeding up access.
    pack_vectors(PairParam{Vector{T}} -> PackedSparsePairParam{T}, vector of vectors in a flat buffer, and in a sparse manner.
    Improved functions:
    -saturation_pressure and crit_pure are faster (we now use a MVector to perform the non linear solve in those cases. maybe going full static could speed up that case further)
    -volume(model,p,T,z,phase=phase) does not allocate (if the eos does not allocate) and is inferrable.
    -SingleParam and PairParam can now use a different storage type than Vector{T}
    new EoS:
  • EOS_LNG: source
  • LJRef: source (it needs a database of LJ data, supports multiple components via vdw1 mixing)
    there is also commented code of UFTheory. basically LJ and mie monomer data is needed.
    improved and/or fixed EoS:
    -error in IAPWS95 (that went unnoticed for a long time)
    -PropaneRef and IAPWS95 are faster
    -GERG2008 is faster (we need benchmarks), EOS_LNG uses the same code than GERG2008.
    -cubic translations and alphas were optimized. (now activity models are the main bottleneck)
    other
    The project was reestructured to make all the parts as independent as possible. with that, a clear view of what are the internal dependencies is possible:
base --> params -|-> database ----------------|
                 |-> split_model --> methods -|-> models
                 |-> macros ------------------|

The core functionality is in base --> params--> split_model --> methods it is possible to define new EoS with only that chain of files.

we now use a custom AD machinery, the functions ∂2f and ∂2a are faster and in general, the base differentials should make more legible errors, based on Improved ForwardDiff.jl Stacktraces With Package Tags

@codecov-commenter
Copy link

codecov-commenter commented Jan 12, 2022

Codecov Report

Merging #61 (38e80a0) into master (b0be126) will decrease coverage by 0.20%.
The diff coverage is 87.57%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #61      +/-   ##
==========================================
- Coverage   88.60%   88.39%   -0.21%     
==========================================
  Files         123      127       +4     
  Lines        7168     7396     +228     
==========================================
+ Hits         6351     6538     +187     
- Misses        817      858      +41     
Impacted Files Coverage Δ
src/Clapeyron.jl 100.00% <ø> (ø)
...rs/multicomponent/tp_flash/RachfordRicetp_flash.jl 88.09% <ø> (ø)
src/models/Activity/COSMOSAC/COSMOSAC02.jl 100.00% <ø> (ø)
src/models/Activity/COSMOSAC/COSMOSAC10.jl 100.00% <ø> (ø)
src/models/Activity/COSMOSAC/COSMOSACdsp.jl 86.84% <ø> (ø)
src/models/Activity/COSMOSAC/utils.jl 100.00% <ø> (ø)
src/models/Activity/NRTL/NRTL.jl 100.00% <ø> (ø)
src/models/Activity/UNIFAC/UNIFAC.jl 100.00% <ø> (ø)
src/models/Activity/UNIFAC/variants/PSRK.jl 100.00% <ø> (ø)
src/models/Activity/UNIFAC/variants/VTPR.jl 88.23% <ø> (ø)
... and 110 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b0be126...38e80a0. Read the comment docs.

@longemen3000 longemen3000 merged commit bd72362 into master Jan 12, 2022
@pw0908 pw0908 deleted the gerg-clapeyronparam branch March 25, 2022 07:55
pw0908 pushed a commit that referenced this pull request Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants