Commit Graph

1198 Commits

Author SHA1 Message Date
Trine Mykkeltvedt
3d8826fc28 some copyright for some new files 2022-06-27 13:11:28 +02:00
Trine Mykkeltvedt
6b62b32da2 added aCache, this probably should be added to ParameterCacheBase at some point 2022-06-27 13:03:37 +02:00
Kai Bao
1728d53371 fxing the warning related to compIdx in PTFlash 2022-06-27 11:19:26 +02:00
Kai Bao
41a489c9ad fixing a warning in PTFlash regarding local_res 2022-06-27 11:13:00 +02:00
Kai Bao
79d89bd7ea Merge remote-tracking branch 'trine/add-chi-flash-trine' into add-chi-flash-trine 2022-06-27 10:59:31 +02:00
Trine Mykkeltvedt
6304acb292 fixed test_components for the new actentric factor and criticalVolume 2022-06-27 10:37:17 +02:00
Trine Mykkeltvedt
8d91d3704e removed unused functions and did some renaming in PTFlash 2022-06-27 10:37:17 +02:00
Kai Bao
6f001d8792 adding includes files to test_components
But many components do not have the criticalVolume and acentricFactor
defined. So test_components does not compile.
2022-06-27 10:37:17 +02:00
Kai Bao
30839ee32b renaming ChiFlash to PTFlash 2022-06-27 10:37:17 +02:00
Kai Bao
07b05d5b06 white space cleaning up
no functionality change.
2022-06-27 10:37:17 +02:00
Trine Mykkeltvedt
1565cb1a96 more peng robinson 2022-06-27 10:37:16 +02:00
Kai Bao
13469c63a0 cleaning up FluidStateCompositionModules.hpp a little bit.
mostly removing the twophaselflag_, which is not used anywhere.

not functionality changes.
2022-06-27 10:37:16 +02:00
Trine Mykkeltvedt
7762589cea more peng robinson stuff 2022-06-27 10:37:16 +02:00
Trine Mykkeltvedt
a02a614948 more cleaning in the PengRobinson files 2022-06-27 10:37:16 +02:00
Trine Mykkeltvedt
13cc0a8197 cleaned PengRobinson, uncommented the stuff about extrema in the case of one rott - I think it can just be as it was 2022-06-27 10:37:16 +02:00
Trine Mykkeltvedt
06ef3bdc62 removed some printing in the polynomialsolver 2022-06-27 10:37:16 +02:00
Kai Bao
89ad5a1e81 slightly cleaning up PengRobinsonMixture.hpp a little bit
there are some more trivial cleaning work remains.
2022-06-27 10:37:16 +02:00
Trine Mykkeltvedt
eb3b24b14c cleaned up the viscositymodels, two choises availible: LBC and modified LBC 2022-06-27 10:37:16 +02:00
Trine Mykkeltvedt
647efce497 moved the viscositymodels to a separate folder alongside the fluidsystem, in principle there are two viscositymodels: the standard LBC and the modified LBC. However, there might me some discrepancy between LBC and LBCjulia - this needs to be sorted out before we split this file into two (or three) separte method files 2022-06-27 10:37:16 +02:00
Trine Mykkeltvedt
14a5a37249 moved and renamed fluidsystems and parametercache in chifluid 2022-06-27 10:37:16 +02:00
Trine Mykkeltvedt
afad4d23ad moved the components to opm/material/components, and made subsequent changes for checking of the components 2022-06-27 10:37:16 +02:00
Trine Mykkeltvedt
7c4f2bdcc3 removed unused files and started removing julianame 2022-06-27 10:37:16 +02:00
Kai Bao
314f86d9de removing test_chiflash_scalar and test_chiflashspe5
they are not needed anymore.
2022-06-27 10:37:16 +02:00
Kai Bao
18c9ee7581 fixing the compilation of test_chiflash
one reason is some code does not compile with DUNE2.6. And DUNE2.6 is
still supported by OPM.
2022-06-27 10:37:16 +02:00
Trine Mykkeltvedt
00f831117a added Kais startup cleaning, no functionality change 2022-06-27 10:37:16 +02:00
Trine Mykkeltvedt
ce4201a030 made additional test with co2 and brine working, similar as juliacode 2022-06-27 10:37:16 +02:00
Trine Mykkeltvedt
c386469479 wip co2brine 2022-06-27 10:37:16 +02:00
Trine Mykkeltvedt
54f7e67dcb fixed the derivatives for the single phase case 2022-06-27 10:37:16 +02:00
Trine Mykkeltvedt
b0863ec492 wip coupling to opm-models compositionalflash 2022-06-27 10:37:16 +02:00
Trine Mykkeltvedt
a8e34880c8 updated the fluidState derivatives correctly to be used in intensivequantities 2022-06-27 10:37:16 +02:00
Trine Mykkeltvedt
d210614eab wip copling to opm-models 2022-06-27 10:37:16 +02:00
Trine Mykkeltvedt
7aa1675f8e changes to ChiFlash 2022-06-27 10:37:16 +02:00
Trine Mykkeltvedt
eed51f4d55 added new cubic solver from Svenns old branch, also made a phaseStabilityTestMichelsen_ with the same wrapping as julia code - this does not work with newton right now. BUT the fix of the roots makes the stabilitytest give similar K as Olavs Julia code. Will never be completely equal due to minimization through gibbs (not implemented in opm) which will different choize of roots 2022-06-27 10:37:16 +02:00
Trine Mykkeltvedt
16f7fb8e9d added Svenns cubic solver 2022-06-27 10:37:16 +02:00
Trine Mykkeltvedt
a003b6c35c WIP stabilitutest ++ 2022-06-27 10:37:16 +02:00
Trine Mykkeltvedt
783b5011db added Kais last to commits and took values to fluid_state 2022-06-27 10:37:16 +02:00
Trine Mykkeltvedt
83d4194876 fixed the derivatives in PengRobinsonMixture with a rewrite of a term to get pri_jac correct, also a getValue to get sec_jac equal, did rewriting and printing in ugly way jus t compare with Julia-code values 2022-06-27 10:37:16 +02:00
Trine Mykkeltvedt
756c68042d problems with how ideal gas constant R was defined on mac, David helped me fix it 2022-06-27 10:37:16 +02:00
Kai Bao
2d939a828f WIP in generating the secondary jacobian 2022-06-27 10:37:16 +02:00
Kai Bao
b3b7ded57d wip in updating the derivatives after the two phase solution
it will be a very draft way to do it first, hopefully the results are
okay.

Then looking for better refactorization.
2022-06-27 10:37:16 +02:00
Kai Bao
d78f1ac178 using different forms of flash equations have better convergence
it is the fugacity coefficient equations. It begins with bigger
residual, while converges faster.

origionally,
 newton residual is 24.7536
 newton residual is 11.0045
 newton residual is 5.2655
 newton residual is 2.4048
 newton residual is 0.995777
 newton residual is 0.331732
 newton residual is 0.0663179
 newton residual is 0.00393044
 newton residual is 1.84752e-05
 newton residual is 1.55499e-08
 newton residual is 1.67839e-11

new form,
 newton residual is 694053
 newton residual is 5950.39
 newton residual is 52.1553
 newton residual is 0.470124
 newton residual is 0.00430846
 newton residual is 3.91461e-05
 newton residual is 3.55269e-07
 newton residual is 4.00957e-09
2022-06-27 10:37:16 +02:00
Kai Bao
1ff22fc49d first version of the assembleNewton_ for flash calculation 2022-06-27 10:37:16 +02:00
Kai Bao
68d0801453 cleaning up a little bit. 2022-06-27 10:37:16 +02:00
Kai Bao
5f0fcad220 WIP in getting the derivatives correct after flash calculation 2022-06-27 10:37:16 +02:00
Kai Bao
c38f72e0d6 some refactoring for the Newton flash solver. 2022-06-27 10:37:16 +02:00
Kai Bao
4bbc37358b moving the two phase flash solver to its own function 2022-06-27 10:37:16 +02:00
Kai Bao
e44fb2363f the newton solver for ChiFlash look working
while we need more checking.
2022-06-27 10:37:16 +02:00
Kai Bao
8a41b0c531 WIP in finishing the newton solver.
commiting for saving.
2022-06-27 10:37:16 +02:00
Kai Bao
8c566096e2 making the types for LBCJulia more proper
We will need to handle AD type with this function.
2022-06-27 10:37:16 +02:00
Kai Bao
b73cf5a93a adding a LBC viscosity function translated from Julia code
to make sure we get the same viscosity
2022-06-27 10:37:16 +02:00