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

inconsitency in summary vector for an spe11b simulation #5807

Open
albertocominelli opened this issue Dec 17, 2024 · 10 comments
Open

inconsitency in summary vector for an spe11b simulation #5807

albertocominelli opened this issue Dec 17, 2024 · 10 comments

Comments

@albertocominelli
Copy link

I run one of the spe11b cases available in the benchmark folder (https://github.com/OPM/pyopmspe11/tree/main/benchmark/spe11b) using the latest version via docker. The name of the case is r2_cp_10mish.txt
. I noticed some strange results: cumulative gas injection does not match gas in place:

image

It looks like the gas I am injectiong is less than teh gas in place ..
I do not understand what is going on.
The simpler cases provided in the github repo look better..

@albertocominelli
Copy link
Author

sorry - some gas disappear...

@albertocominelli
Copy link
Author

This is using 10 days time step..
image

@albertocominelli
Copy link
Author

This is the txt file for pyopmspe11:
"""Set the full path to the flow executable and flags"""
flow --enable-opm-rst-file=true --output-extra-convergence-info=steps,iterations --enable-well-operability-check=false --min-time-step-before-shutting-problematic-wells-in-days=1e-99

"""Set the model parameters"""
spe11b master #Name of the spe case (spe11a, spe11b, or spe11c) and OPM Flow version (master or release)
complete gaswater #Name of the co2 model (immiscible, convective [convective requires a Flow version newer than 22-08-2024], or complete) and co2store implementation (gaswater or gasoil [oil properties are set to water internally in OPM flow])
corner-point #Type of grid (cartesian, tensor, or corner-point)
8400 1 1200 #Length, width, and depth [m]
840 #If cartesian, number of x cells [-]; otherwise, variable array of x-refinment
1 #If cartesian, number of y cells [-]; otherwise, variable array of y-refinment [-] (for spe11c)
9,7,1,5,5,3,7,7,10,7,7,8,6,15,5,24,24,7 #If cartesian, number of z cells [-]; if tensor, variable array of z-refinment; if corner-point, fix array of z-refinment (18 entries)
70 40 #Temperature bottom and top rig [C]
300 3e7 0.1 #Datum [m], pressure at the datum [Pa], and multiplier for the permeability in the z direction [-]
1e-9 2e-8 #Diffusion (in liquid and gas) [m^2/s]
8.5e-1 2500 #Rock specific heat and density (for spe11b/c)
0 5e4 1 #Added pore volume on top boundary (for spe11a [if 0, free flow bc]), pore volume on lateral boundaries, and width of buffer cell [m] (for spe11b/c)
0 0 #Elevation of the parabola and back boundary [m] (for spe11c)

"""Set the saturation functions"""
(max(0, (s_w - swi) / (1 - swi))) ** 1.5 #Wetting rel perm saturation function [-]
(max(0, (1 - s_w - sni) / (1 - sni))) ** 1.5 #Non-wetting rel perm saturation function [-]
penmax * math.erf(pen * ((s_w-swi) / (1.-swi)) ** (-(1.0 / 1.5)) * math.pi**0.5 / (penmax * 2)) #Capillary pressure saturation function [Pa]
(np.exp(np.flip(np.linspace(0, 5.0, npoints))) - 1) / (np.exp(5.0) - 1) #Points to evaluate the saturation functions (s_w) [-]

"""Properties sat functions"""
"""swi [-], sni [-], pen [Pa], penmax [Pa], npoints [-]"""
SWI1 0.32 SNI1 0.1 PEN1 193531.39 PENMAX1 3e7 NPOINTS1 1000
SWI2 0.14 SNI2 0.1 PEN2 8654.99 PENMAX2 3e7 NPOINTS2 1000
SWI3 0.12 SNI3 0.1 PEN3 6120.00 PENMAX3 3e7 NPOINTS3 1000
SWI4 0.12 SNI4 0.1 PEN4 3870.63 PENMAX4 3e7 NPOINTS4 1000
SWI5 0.12 SNI5 0.1 PEN5 3060.00 PENMAX5 3e7 NPOINTS5 1000
SWI6 0.10 SNI6 0.1 PEN6 2560.18 PENMAX6 3e7 NPOINTS6 1000
SWI7 0 SNI7 0 PEN7 0 PENMAX7 3e7 NPOINTS7 2

"""Properties rock"""
"""K [mD], phi [-], disp [m], thconr [W m-1 K-1]"""
PERM1 0.10132 PORO1 0.10 DISP1 10 THCONR1 1.90
PERM2 101.324 PORO2 0.20 DISP2 10 THCONR2 1.25
PERM3 202.650 PORO3 0.20 DISP3 10 THCONR3 1.25
PERM4 506.625 PORO4 0.20 DISP4 10 THCONR4 1.25
PERM5 1013.25 PORO5 0.25 DISP5 10 THCONR5 0.92
PERM6 2026.50 PORO6 0.35 DISP6 10 THCONR6 0.26
PERM7 1e-5 PORO7 1e-6 DISP7 0 THCONR7 2.00

"""Wells radius and position"""
"""radius (0 to use the SOURCE keyword instead of well keywords), x, y, and z position [m] (final positions as well for spe11c)"""
0.5 2700. 0.5 300. #Well 1
0.5 5100. 0.5 700. #Well 2

"""Define the injection values ([hours] for spe11a; [years] for spe11b/c)"""
"""injection time, time step size to write results, maximum solver time step, injected fluid (0 water, 1 co2) (well1), injection rate [kg/s] (well1), temperature [C] (well1), injected fluid (0 water, 1 co2) (well2), ..."""
25 5 0.1 1 0.020 10 1 0 10
25 5 0.1 1 0.020 10 1 0.020 10
50 50 0.5 1 0 10 1 0 10
900 50 5 1 0 10 1 0 10

There is maste but I am only using the docker version, which I suppose is a release...

@daavid00
Copy link
Contributor

Hi @albertocominelli, thanks for reporting this. I will try to run the configuration file you shared and look if I can reproduce this. At first sight I notice the flow simulator flags are different from the benchmark configuration files, e.g., --relaxed-max-pv-fraction=0 is missing, then you could try to rerun the case adding that flag. In addition, there have no been any updates from the docker since we merge this from another contributor more than a year ago, then I would recommend to install the repository and OPM Flow as described in https://opm.github.io/pyopmspe11/installation.html
If you have additional issues to report about pyopmspe11, you could raise them at https://github.com/OPM/pyopmspe11/issues

@albertocominelli
Copy link
Author

Thanks David.
The previous cases were run using
alias mpi_flow=' mpirun -np 12 flow --zoltan-imbalance-tol=1.05 --tolerance-mb=1e-7 --linear-solver=cprw
--enable-tuning=true
--enable-opm-rst-file=true --output-extra-convergence-info=steps,iterations
--newton-min-iterations=1 '

Now I run a case with these options:
alias flow_spe11='mpirun -np 10 flow --enable-opm-rst-file=true --output-extra-convergence-info=steps,iterations
--enable-well-operability-check=false --min-time-step-before-shutting-problematic-wells-in-days=1e-99
--enable-tuning=true '
and it looks ok:
image

I thin it is one of these option causing the problem:
--zoltan-imbalance-tol=1.05 --tolerance-mb=1e-7 --linear-solver=cprw
Hope it is not cprw...

@daavid00
Copy link
Contributor

If you use Flow from the latest release or from master, then cprw is the default and it seems to work fine for the spe11 cases. I would recommend using OPM Flow from the latest release or master branches, and also using the OPM Flow flags in the benchmark configuration files as starting point. Those configuration files will generate cases where sources are used instead of wells; if wells are preferred, then this can be achieved by giving the values of the well radius.

@albertocominelli
Copy link
Author

I am using the latest available from docker. I try to stick as much as possible to the configuration files provided in the folder you are mentioning with a radius of 0.5 for the wellbore (very large, but it should not be an issue)

@daavid00
Copy link
Contributor

Oh, sorry for that, some of the old confi files have not been updated/corrected, but a more realistic well radius can be found here

@albertocominelli
Copy link
Author

do not worry, larger radius means larger connection factor..Meanwhile, I had a an asster with the base runtime switch I used..
Now I am copying the one in the benchmark configuration files folder but two options are unavailable in the docker latest:
PartitionMethod="2"
ImbalanceTol="1.1"

@daavid00
Copy link
Contributor

This was added on July this year (OPM/opm-grid#725). Then you could try to remove those flags, and if zoltan complains about the partition, one could try by playing with --zoltan-imbalance-tol ,e.g., setting the value to 1.05.

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

No branches or pull requests

2 participants