Skip to content

Commit 7248afc

Browse files
committed
update doc examples
1 parent 4db0265 commit 7248afc

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed

docs/source/tutorial_01_pump.rst

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ is equivalent to:
2626
],
2727
)
2828
29+
The script:
2930

3031
.. code-block:: python
3132
@@ -43,6 +44,9 @@ is equivalent to:
4344
rate = -1e-3
4445
# model setup
4546
model = OGS(task_root="pump_test", task_id="model")
47+
model.pcs.add_block( # set the process type
48+
PCS_TYPE="GROUNDWATER_FLOW", NUM_TYPE="NEW"
49+
)
4650
# generate a radial mesh and geometry ("boundary" polyline)
4751
model.msh.generate("radial", dim=2, rad=rad, angles=angles)
4852
model.gli.generate("radial", dim=2, rad_out=rad[-1], angles=angles)
@@ -54,39 +58,36 @@ is equivalent to:
5458
GEO_TYPE=["POLYLINE", "boundary"],
5559
DIS_TYPE=["CONSTANT", 0.0],
5660
)
57-
model.st.add_block( # source term
58-
PCS_TYPE="GROUNDWATER_FLOW",
59-
PRIMARY_VARIABLE="HEAD",
60-
GEO_TYPE=["POINT", "pwell"],
61-
DIS_TYPE=["CONSTANT_NEUMANN", rate],
62-
)
6361
model.ic.add_block( # initial condition
6462
PCS_TYPE="GROUNDWATER_FLOW",
6563
PRIMARY_VARIABLE="HEAD",
6664
GEO_TYPE="DOMAIN",
6765
DIS_TYPE=["CONSTANT", 0.0],
6866
)
67+
model.st.add_block( # source term
68+
PCS_TYPE="GROUNDWATER_FLOW",
69+
PRIMARY_VARIABLE="HEAD",
70+
GEO_TYPE=["POINT", "pwell"],
71+
DIS_TYPE=["CONSTANT_NEUMANN", rate],
72+
)
6973
model.mmp.add_block( # medium properties
7074
GEOMETRY_DIMENSION=2,
7175
STORAGE=[1, storage],
7276
PERMEABILITY_TENSOR=["ISOTROPIC", transmissivity],
7377
)
7478
model.num.add_block( # numerical solver
7579
PCS_TYPE="GROUNDWATER_FLOW",
76-
LINEAR_SOLVER=[2, 5, 1e-14, 1000, 1.0, 100, 4],
80+
LINEAR_SOLVER=[2, 5, 1e-14, 1000, 1.0, 100, 4]
7781
)
7882
model.out.add_block( # point observation
7983
PCS_TYPE="GROUNDWATER_FLOW",
8084
NOD_VALUES="HEAD",
8185
GEO_TYPE=["POINT", "owell"],
8286
DAT_TYPE="TECPLOT",
8387
)
84-
model.pcs.add_block( # set the process type
85-
PCS_TYPE="GROUNDWATER_FLOW", NUM_TYPE="NEW"
86-
)
8788
model.tim.add_block( # set the timesteps
8889
PCS_TYPE="GROUNDWATER_FLOW",
89-
**generate_time(time)
90+
**generate_time(time) # generate input from time-series
9091
)
9192
model.write_input()
9293
success = model.run_model()

docs/source/tutorial_02_pump.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ and perform a steady pumping test.
1515
# covariance model for conductivity field
1616
cov_model = Gaussian(dim=3, var=2, len_scale=10, anis=[1, 0.2])
1717
srf = SRF(model=cov_model, mean=-9, seed=1000)
18-
# ogs base class
18+
# model setup
1919
model = OGS(task_root="test_het_3D", task_id="model", output_dir="out")
20+
model.pcs.add_block( # set the process type
21+
PCS_TYPE="GROUNDWATER_FLOW", NUM_TYPE="NEW", TIM_TYPE="STEADY"
22+
)
2023
# generate a radial 3D mesh and conductivity field
2124
model.msh.generate(
2225
"radial", dim=3, angles=64, rad=np.arange(101), z_arr=-np.arange(11)
@@ -29,6 +32,9 @@ and perform a steady pumping test.
2932
DIS_TYPE="ELEMENT",
3033
DATA=by_id(cond),
3134
)
35+
model.mmp.add_block( # permeability, storage and porosity
36+
GEOMETRY_DIMENSION=3, PERMEABILITY_DISTRIBUTION=model.mpd.file_name
37+
)
3238
model.gli.generate("radial", dim=3, angles=64, rad_out=100, z_size=-10)
3339
model.gli.add_polyline("pwell", [[0, 0, 0], [0, 0, -10]])
3440
for srf in model.gli.SURFACE_NAMES: # set boundary condition
@@ -44,9 +50,6 @@ and perform a steady pumping test.
4450
GEO_TYPE=["POLYLINE", "pwell"],
4551
DIS_TYPE=["CONSTANT_NEUMANN", 1.0e-3],
4652
)
47-
model.mmp.add_block( # permeability, storage and porosity
48-
GEOMETRY_DIMENSION=3, PERMEABILITY_DISTRIBUTION=model.mpd.file_name
49-
)
5053
model.num.add_block( # numerical solver
5154
PCS_TYPE="GROUNDWATER_FLOW",
5255
LINEAR_SOLVER=[2, 5, 1.0e-14, 1000, 1.0, 100, 4],
@@ -57,9 +60,6 @@ and perform a steady pumping test.
5760
GEO_TYPE="DOMAIN",
5861
DAT_TYPE="VTK",
5962
)
60-
model.pcs.add_block( # set the process type
61-
PCS_TYPE="GROUNDWATER_FLOW", NUM_TYPE="NEW", TIM_TYPE="STEADY"
62-
)
6363
model.write_input()
6464
success = model.run_model()
6565

0 commit comments

Comments
 (0)