Skip to content

Commit

Permalink
update doc examples
Browse files Browse the repository at this point in the history
  • Loading branch information
MuellerSeb committed Nov 18, 2019
1 parent 4db0265 commit 7248afc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
23 changes: 12 additions & 11 deletions docs/source/tutorial_01_pump.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ is equivalent to:
],
)
The script:

.. code-block:: python
Expand All @@ -43,6 +44,9 @@ is equivalent to:
rate = -1e-3
# model setup
model = OGS(task_root="pump_test", task_id="model")
model.pcs.add_block( # set the process type
PCS_TYPE="GROUNDWATER_FLOW", NUM_TYPE="NEW"
)
# generate a radial mesh and geometry ("boundary" polyline)
model.msh.generate("radial", dim=2, rad=rad, angles=angles)
model.gli.generate("radial", dim=2, rad_out=rad[-1], angles=angles)
Expand All @@ -54,39 +58,36 @@ is equivalent to:
GEO_TYPE=["POLYLINE", "boundary"],
DIS_TYPE=["CONSTANT", 0.0],
)
model.st.add_block( # source term
PCS_TYPE="GROUNDWATER_FLOW",
PRIMARY_VARIABLE="HEAD",
GEO_TYPE=["POINT", "pwell"],
DIS_TYPE=["CONSTANT_NEUMANN", rate],
)
model.ic.add_block( # initial condition
PCS_TYPE="GROUNDWATER_FLOW",
PRIMARY_VARIABLE="HEAD",
GEO_TYPE="DOMAIN",
DIS_TYPE=["CONSTANT", 0.0],
)
model.st.add_block( # source term
PCS_TYPE="GROUNDWATER_FLOW",
PRIMARY_VARIABLE="HEAD",
GEO_TYPE=["POINT", "pwell"],
DIS_TYPE=["CONSTANT_NEUMANN", rate],
)
model.mmp.add_block( # medium properties
GEOMETRY_DIMENSION=2,
STORAGE=[1, storage],
PERMEABILITY_TENSOR=["ISOTROPIC", transmissivity],
)
model.num.add_block( # numerical solver
PCS_TYPE="GROUNDWATER_FLOW",
LINEAR_SOLVER=[2, 5, 1e-14, 1000, 1.0, 100, 4],
LINEAR_SOLVER=[2, 5, 1e-14, 1000, 1.0, 100, 4]
)
model.out.add_block( # point observation
PCS_TYPE="GROUNDWATER_FLOW",
NOD_VALUES="HEAD",
GEO_TYPE=["POINT", "owell"],
DAT_TYPE="TECPLOT",
)
model.pcs.add_block( # set the process type
PCS_TYPE="GROUNDWATER_FLOW", NUM_TYPE="NEW"
)
model.tim.add_block( # set the timesteps
PCS_TYPE="GROUNDWATER_FLOW",
**generate_time(time)
**generate_time(time) # generate input from time-series
)
model.write_input()
success = model.run_model()
Expand Down
14 changes: 7 additions & 7 deletions docs/source/tutorial_02_pump.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ and perform a steady pumping test.
# covariance model for conductivity field
cov_model = Gaussian(dim=3, var=2, len_scale=10, anis=[1, 0.2])
srf = SRF(model=cov_model, mean=-9, seed=1000)
# ogs base class
# model setup
model = OGS(task_root="test_het_3D", task_id="model", output_dir="out")
model.pcs.add_block( # set the process type
PCS_TYPE="GROUNDWATER_FLOW", NUM_TYPE="NEW", TIM_TYPE="STEADY"
)
# generate a radial 3D mesh and conductivity field
model.msh.generate(
"radial", dim=3, angles=64, rad=np.arange(101), z_arr=-np.arange(11)
Expand All @@ -29,6 +32,9 @@ and perform a steady pumping test.
DIS_TYPE="ELEMENT",
DATA=by_id(cond),
)
model.mmp.add_block( # permeability, storage and porosity
GEOMETRY_DIMENSION=3, PERMEABILITY_DISTRIBUTION=model.mpd.file_name
)
model.gli.generate("radial", dim=3, angles=64, rad_out=100, z_size=-10)
model.gli.add_polyline("pwell", [[0, 0, 0], [0, 0, -10]])
for srf in model.gli.SURFACE_NAMES: # set boundary condition
Expand All @@ -44,9 +50,6 @@ and perform a steady pumping test.
GEO_TYPE=["POLYLINE", "pwell"],
DIS_TYPE=["CONSTANT_NEUMANN", 1.0e-3],
)
model.mmp.add_block( # permeability, storage and porosity
GEOMETRY_DIMENSION=3, PERMEABILITY_DISTRIBUTION=model.mpd.file_name
)
model.num.add_block( # numerical solver
PCS_TYPE="GROUNDWATER_FLOW",
LINEAR_SOLVER=[2, 5, 1.0e-14, 1000, 1.0, 100, 4],
Expand All @@ -57,9 +60,6 @@ and perform a steady pumping test.
GEO_TYPE="DOMAIN",
DAT_TYPE="VTK",
)
model.pcs.add_block( # set the process type
PCS_TYPE="GROUNDWATER_FLOW", NUM_TYPE="NEW", TIM_TYPE="STEADY"
)
model.write_input()
success = model.run_model()
Expand Down

0 comments on commit 7248afc

Please sign in to comment.