Skip to content

Commit da38600

Browse files
Bartek Florczyk Vik (CCI RPT RES1)Bartek Florczyk Vik (CCI RPT RES1)
authored andcommitted
Clean Krowgend add to factory water_oil_gas
make doc figures ruff check fix comic font + docs/pyscal removal test simplified + test warning Fix formatting issues noted in review Add 'The' prefix Fix minor last typos
1 parent 23f2c99 commit da38600

9 files changed

Lines changed: 588 additions & 23 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ instance/
7373

7474
# Sphinx documentation
7575
docs/_build/
76+
docs/pyscal/
7677
docs/modules.rst
7778
docs/pyscal.rst
7879

136 KB
Loading
127 KB
Loading
127 KB
Loading
103 KB
Loading

docs/make_plots.py

Lines changed: 315 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import matplotlib.pyplot as plt
66

77
from pyscal import GasOil, GasWater, WaterOil
8+
from pyscal.factory import create_water_oil_gas
89

910
IMG_DIR = Path(__file__).absolute().parent / "images"
1011

@@ -24,6 +25,9 @@ def main() -> None:
2425
"gaswater-icd2",
2526
"gasoil-cid2",
2627
"gaswater-dci1",
28+
"gasoil-condensate-cid2",
29+
"wateroil-condensate-idc2",
30+
"gaswater-condensate-icd2",
2731
"gaswater-co2-icd2",
2832
"gaswater-paleogas-dci3",
2933
"wateroil-paleooil-idc1",
@@ -437,6 +441,317 @@ def make_gasoil_cdi2(show: bool = True) -> None:
437441
plt.show()
438442

439443

444+
def make_gasoil_condensate_cid2(show: bool = True) -> None:
445+
plt.xkcd()
446+
_, axes = plt.subplots()
447+
swl = 0.1
448+
sgcr = 0.15
449+
sgro = 0.15
450+
sorg = 0.15
451+
krgend = 1
452+
krgmax = 1
453+
krowend = 0.8
454+
krogend = 0.8
455+
kromax = 1
456+
krgendanchor = ""
457+
nw = 2
458+
now = 3
459+
ng = 3
460+
nog = 3
461+
wog = create_water_oil_gas(
462+
{
463+
"nw": nw,
464+
"now": now,
465+
"ng": ng,
466+
"nog": nog,
467+
"krowend": krowend,
468+
"krogend": krogend,
469+
"kromax": kromax,
470+
"krgend": krgend,
471+
"krgmax": krgmax,
472+
"krgendanchor": krgendanchor,
473+
"swl": swl,
474+
"sgcr": sgcr,
475+
"sgro": sgro,
476+
"sorg": sorg,
477+
}
478+
)
479+
wog.gasoil.table.plot(
480+
ax=axes, x="SG", y="KRG", c="red", alpha=1, label="KRG", linewidth=2
481+
)
482+
wog.gasoil.table.plot(
483+
ax=axes, x="SG", y="KROG", c="green", alpha=1, label="KROG", linewidth=2
484+
)
485+
plt.ylim([-0.02, 1])
486+
plt.xlim([-0.01, 1])
487+
plt.xticks([0, 1])
488+
plt.yticks([0, 1])
489+
axes.annotate(
490+
"KROGEND",
491+
xy=(sgro, krogend),
492+
arrowprops={"arrowstyle": "->"},
493+
xytext=(sgro + 0.1, krogend - 0.05),
494+
)
495+
axes.annotate(
496+
"KROMAX",
497+
xy=(0, kromax),
498+
arrowprops={"arrowstyle": "->"},
499+
xytext=(0.1, kromax - 0.1),
500+
)
501+
axes.annotate(
502+
"KRGEND",
503+
xy=(1 - swl, krgend - 0.01),
504+
arrowprops={"arrowstyle": "->"},
505+
xytext=(1 - 0.35, krgend - 0.05),
506+
)
507+
axes.text(0.03, 0.04, "SGRO")
508+
axes.annotate(
509+
"", xy=(0, 0.02), xytext=(sgro, 0.02), arrowprops={"arrowstyle": "<->"}
510+
)
511+
axes.text(0.03, 0.14, "SGCR")
512+
axes.annotate(
513+
"", xy=(0, 0.12), xytext=(sgcr, 0.12), arrowprops={"arrowstyle": "<->"}
514+
)
515+
plt.xlabel("SG", labelpad=-10)
516+
axes.annotate(
517+
"",
518+
xy=(1 - sorg - swl, 0.08),
519+
xytext=(1 - swl, 0.08),
520+
arrowprops={"arrowstyle": "<->"},
521+
)
522+
axes.text(1 - sorg - swl + 0.02, 0.1, "SORG")
523+
axes.annotate(
524+
"", xy=(1 - swl, 0.02), xytext=(1, 0.02), arrowprops={"arrowstyle": "<->"}
525+
)
526+
axes.text(1 - swl + 0.02, 0.04, "SWL")
527+
axes.legend(loc="upper center")
528+
529+
# Krog endpoint and critical saturations:
530+
plt.vlines(sgro, ymin=0, ymax=krogend, colors="black", linestyles="dashed")
531+
532+
# Initial state and saturation direction:
533+
plt.vlines(1 - swl, ymin=0, ymax=1, colors="darkorange", linestyles="dashed")
534+
axes.arrow(
535+
1 - swl - 0.03,
536+
krgend - 0.03,
537+
-0.08,
538+
-0.2,
539+
head_width=0.025,
540+
fill=True,
541+
facecolor="darkorange",
542+
)
543+
axes.arrow(
544+
1 - swl - 0.03,
545+
0.03,
546+
-0.13,
547+
0.001,
548+
head_width=0.025,
549+
fill=True,
550+
facecolor="darkorange",
551+
)
552+
if show:
553+
plt.show()
554+
555+
556+
def make_wateroil_condensate_idc2(show: bool = True) -> None:
557+
plt.xkcd()
558+
_, axes = plt.subplots()
559+
swl = 0.1
560+
swcr = 0.1
561+
sorw = 0.2
562+
krwend = 0.8
563+
krwmax = 1
564+
krowend = 0.85
565+
kromax = 1
566+
nw = 4
567+
now = 1.8
568+
ng = 3
569+
nog = 3
570+
wog = create_water_oil_gas(
571+
{
572+
"nw": nw,
573+
"now": now,
574+
"ng": ng,
575+
"nog": nog,
576+
"krowend": krowend,
577+
"kromax": kromax,
578+
"krwend": krwend,
579+
"swl": swl,
580+
"sorw": sorw,
581+
"swcr": swcr,
582+
}
583+
)
584+
wog.wateroil.table.plot(
585+
ax=axes, x="SW", y="KRW", c="blue", alpha=1, label="KRW", linewidth=2
586+
)
587+
wog.wateroil.table.plot(
588+
ax=axes, x="SW", y="KROW", c="green", alpha=1, label="KROW", linewidth=2
589+
)
590+
plt.ylim([-0.02, 1.02])
591+
plt.xlim([-0.02, 1.02])
592+
plt.xticks([0, 1])
593+
plt.yticks([0, 1])
594+
axes.annotate(
595+
"KROWEND",
596+
xy=(swl, krowend),
597+
arrowprops={"arrowstyle": "->"},
598+
xytext=(swl, krowend + 0.1),
599+
)
600+
axes.annotate(
601+
"KRWEND",
602+
xy=(1 - sorw, krwend),
603+
arrowprops={"arrowstyle": "->"},
604+
xytext=(1 - 0.15, krwend - 0.02),
605+
)
606+
axes.annotate(
607+
"KRWMAX",
608+
xy=(1, krwmax),
609+
arrowprops={"arrowstyle": "->"},
610+
xytext=(1 - 0.3, krwmax - 0.04),
611+
)
612+
axes.annotate(
613+
"SWL≈SWCR",
614+
xy=(swl, 0),
615+
arrowprops={"arrowstyle": "->"},
616+
xytext=(swl - 0.055, 0 + 0.14),
617+
)
618+
plt.xlabel("SW", labelpad=-10)
619+
axes.legend(loc="upper center")
620+
axes.annotate(
621+
"", xy=(1 - sorw, 0.02), xytext=(1, 0.02), arrowprops={"arrowstyle": "<->"}
622+
)
623+
axes.text(1 - sorw + 0.04, 0.04, "SORW")
624+
625+
# Krw endpoint and critical saturations:
626+
plt.vlines(1 - sorw, ymin=0, ymax=krwend, colors="black", linestyles="dashed")
627+
628+
# Initial state and saturation direction:
629+
plt.vlines(swl, ymin=0, ymax=1, colors="darkorange", linestyles="dashed")
630+
axes.arrow(
631+
swl + 0.03,
632+
krowend - 0.01,
633+
0.05,
634+
-0.09,
635+
head_width=0.025,
636+
fill=True,
637+
facecolor="darkorange",
638+
)
639+
axes.arrow(
640+
swl + 0.03,
641+
0.03,
642+
0.05,
643+
0.01,
644+
head_width=0.025,
645+
fill=True,
646+
facecolor="darkorange",
647+
)
648+
if show:
649+
plt.show()
650+
651+
652+
def make_gaswater_condensate_icd2(show: bool = True) -> None:
653+
plt.xkcd()
654+
_, axes = plt.subplots()
655+
swl = 0.1
656+
swcr = 0.1
657+
sgcr = 0.15
658+
sgrw = 0.15
659+
krgend = 1
660+
krgmax = 1
661+
krwend = 0.8
662+
krwmax = 1
663+
nw = 4
664+
now = 3
665+
ng = 3
666+
nog = 3
667+
wog = create_water_oil_gas(
668+
{
669+
"nw": nw,
670+
"now": now,
671+
"ng": ng,
672+
"nog": nog,
673+
"krwend": krwend,
674+
"krwmax": krwmax,
675+
"krgend": krgend,
676+
"krgmax": krgmax,
677+
"swl": swl,
678+
"swcr": swcr,
679+
"sgcr": sgcr,
680+
"sgrw": sgrw,
681+
}
682+
)
683+
wog.wateroil.table.plot(
684+
ax=axes, x="SW", y="KRW", c="blue", alpha=1, label="KRW", linewidth=2
685+
)
686+
wog.gasoil.table.plot(
687+
ax=axes, x="SL", y="KRG", c="red", alpha=1, label="KRG", linewidth=2
688+
)
689+
plt.xlim([-0.02, 1.01])
690+
plt.ylim([-0.02, 1])
691+
plt.xticks([0, 1])
692+
plt.yticks([0, 1])
693+
axes.annotate(
694+
"KRGEND",
695+
xy=(swl, krgend),
696+
arrowprops={"arrowstyle": "->"},
697+
xytext=(swl + 0.1, krgend - 0.1),
698+
)
699+
axes.annotate(
700+
"KRWEND",
701+
xy=(1 - sgrw, krwend),
702+
arrowprops={"arrowstyle": "->"},
703+
xytext=(1 - 0.13, krwend - 0.15),
704+
)
705+
axes.annotate(
706+
"KRWMAX",
707+
xy=(1 - 0.01, krwmax),
708+
arrowprops={"arrowstyle": "->"},
709+
xytext=(1 - 0.23, krwmax - 0.05),
710+
)
711+
axes.annotate(
712+
"SWL≈SWCR",
713+
xy=(swl, 0),
714+
arrowprops={"arrowstyle": "->"},
715+
xytext=(swl - 0.055, 0 + 0.14),
716+
)
717+
plt.xlabel("SW", labelpad=-10)
718+
axes.legend(loc="upper center")
719+
axes.text(1 - sgrw + 0.03, 0.04, "SGRW")
720+
axes.annotate(
721+
"", xy=(1 - sgrw, 0.02), xytext=(1, 0.02), arrowprops={"arrowstyle": "<->"}
722+
)
723+
axes.text(1 - sgcr + 0.03, 0.14, "SGCR")
724+
axes.annotate(
725+
"", xy=(1 - sgcr, 0.12), xytext=(1, 0.12), arrowprops={"arrowstyle": "<->"}
726+
)
727+
728+
# Krw endpoint and critical saturations:
729+
plt.vlines(1 - sgcr, ymin=0, ymax=krwend, colors="black", linestyles="dashed")
730+
731+
# Initial state and saturation direction:
732+
plt.vlines(swl, ymin=0, ymax=1, colors="darkorange", linestyles="dashed")
733+
axes.arrow(
734+
swl + 0.03,
735+
krgend - 0.03,
736+
0.08,
737+
-0.2,
738+
head_width=0.025,
739+
fill=True,
740+
facecolor="darkorange",
741+
)
742+
axes.arrow(
743+
swl + 0.03,
744+
0.03,
745+
0.1,
746+
0.005,
747+
head_width=0.025,
748+
fill=True,
749+
facecolor="darkorange",
750+
)
751+
if show:
752+
plt.show()
753+
754+
440755
def make_gasoil_cid2(show: bool = True) -> None:
441756
plt.xkcd()
442757
_, axes = plt.subplots()

0 commit comments

Comments
 (0)