OGSTools Framework - Quick Start#

This is a condensed version of the OGSTools workflow.

Workflow: Setup → Compose → Run → Analyze → Store

For detailed explanations of each step, see OGSTools Framework - Complete Workflow Guide.

import ogstools as ot
from ogstools.examples import load_meshes_simple_lf, load_project_simple_lf

1. Setup: Load Project and Meshes#

project = load_project_simple_lf()
meshes = load_meshes_simple_lf()

model = ot.Model(project=project, meshes=meshes)
# Visualize setup with boundary conditions
fig = model.plot_constraints()
fig.show()
plot framework short

2. Run: Execute Simulation#

sim = model.run()
print(f"Simulation status: {sim.status_str}")
Simulation status: Status: completed successfully (results available)

3. Analyze: Visualize Results#

# Plot final pressure distribution
fig = ot.plot.contourf(sim.meshseries[-1], "pressure")
fig.show()
plot framework short

Plot convergence behavior

fig = sim.log.plot_convergence(metric="dx_x")
fig.show()
plot framework short

4. Store: Save Simulation#

tmp = ot.definitions.temp_dir("framework_short", "examples")
sim.save(tmp / "mysim", archive=True)
[]

Next Steps#

Total running time of the script: (0 minutes 0.839 seconds)