Commit Graph

1103 Commits

Author SHA1 Message Date
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
Kai Bao
6d8ef5e99f adding compressFactor to FluidStateCompositionModules 2022-06-27 10:37:16 +02:00
Kai Bao
20d6078504 bug fixes. 2022-06-27 10:37:16 +02:00
Kai Bao
e3864e1a90 making the test_chiflash based on AD 2022-06-27 10:37:16 +02:00
Kai Bao
20b93ee3bf small cleaning up. 2022-06-27 10:37:16 +02:00
Kai Bao
96c3462571 making test_chiflash_scalar to be CO2, C10, C1 test 2022-06-27 10:37:16 +02:00
Kai Bao
7c2694bba4 WIP in creating the julia three component system. 2022-06-27 10:37:16 +02:00
Kai Bao
3d9c344d84 further cleaning up 2022-06-27 10:37:16 +02:00
Kai Bao
054a768225 adding the CO2, C1, C10 component with exact Julia properties 2022-06-27 10:37:16 +02:00
Kai Bao
fe42b8a5b3 some cleaning up, no functionality change 2022-06-27 10:37:16 +02:00
Kai Bao
ad4d1bee4f removing the tempalte parameter Evaluation for ChiFlash 2022-06-27 10:37:16 +02:00
Kai Bao
0c9cffbd60 adding the spe5 using chiflash
to compile, you need to change the function name criticalMolarVolume to
criticalVolume in Spe5FluidSystem.

And the commented out code in PengRobinson.hpp looks like needed for
spe5 flash.
2022-06-27 10:37:16 +02:00
Kai Bao
2fb4676fee remvoing unused types for clarity. 2022-06-27 10:37:16 +02:00
hnil
22e79cd97a fixed it 2022-06-27 10:37:16 +02:00
hnil
1637633b21 added a scalar test 2022-06-27 10:37:16 +02:00
Kai Bao
6833b8e434 some small changes, not functionality change. 2022-06-27 10:37:16 +02:00
Kai Bao
df50b67ed3 compiled and running now. 2022-06-27 10:37:16 +02:00
Kai Bao
52f23ec882 using the same types from the co2-compositional
it compiles now. Not sure why the running is terminated due to NaN.
2022-06-27 10:37:16 +02:00
Kai Bao
a205ff502e continuing WIP for the test_chiflash
not compiled but reproducing the same compilation error with much
smaller code.
2022-06-27 10:37:16 +02:00
Kai Bao
fc38c68735 WIP to make the test_chiflash using TwoPhaseThreeComponentFluidSystem 2022-06-27 10:37:16 +02:00
Kai Bao
db5ab02dd2 incoporating K, L, twophaseflag to FluidStateCompositionModules
It was done by Norce in the co2-compositional branch.
It removes some compilation errors.
2022-06-27 10:37:16 +02:00
Atgeirr Flø Rasmussen
261bf56fab [WIP] Add ChiFlash and test. Not compiling. 2022-06-27 10:37:16 +02:00
Tor Harald Sandve
694fe3b85c Merge pull request #515 from totto82/fixExtrapolateDiff
Extrapolate gas diffusion in CO2 module
2022-06-21 09:10:24 +02:00
Tor Harald Sandve
dba0fe19c5 Merge pull request #500 from plgbrts/JouleThomson
Adding Joule-Thomson effect in energy calculations
2022-06-20 11:04:15 +02:00
Tor Harald Sandve
f4118ed61d Extrapolate gas diffusion in CO2 module 2022-06-20 10:59:15 +02:00
Paul Egberts
0168b7719f added Rvw argument for gas inverseFormationVolumeFactor function 2022-06-13 15:04:40 +02:00
Paul Egberts
dcc6eb2e0c modified density calculation to include oil vapor and dissolved gas 2022-06-13 11:39:11 +02:00
Paul Egberts
25adfda7d9 adjustments needed for new Joule-Thomson keywords 2022-06-13 11:39:11 +02:00
Paul Egberts
a2aa7b9603 adjusted internal energy calculation to include (optional) Joule-Thomson effect 2022-06-13 11:39:10 +02:00
Paul Egberts
a721fbba1f joule thomson 2022-06-13 11:39:10 +02:00