otko/examples/README.md

227 lines
10 KiB
Markdown
Raw Permalink Normal View History

2026-09-08 02:12:15 -04:00
# Example models
Pre-built `.osmodel` files plus the Python scripts that generate them.
Each one carries the case types the post-processing views need, so you
can exercise the GUI without defining materials, sections, loads, and
cases by hand.
2026-09-08 02:12:15 -04:00
## Files
| Model | Nodes | Elements | Cases | Shows |
2026-09-08 02:12:15 -04:00
|---|---|---|---|---|
| `cantilever.osmodel` | 6 | 5 | Static × 2, Modal | Point + distributed loads, force diagrams, deformed shape, mode shapes |
| `portal_frame.osmodel` | 4 | 3 | Static, Modal, Transient | All Display features, smallest 3D |
| `space_frame_3d.osmodel` | 12 | 16 | Static, Modal, Transient (5% damping) | 3D rendering, multiple modes, damped EQ time-history |
2026-09-08 02:12:15 -04:00
| `sdof_pushover.osmodel` | 2 | 1 | Pushover, Modal | Monotonic pushover curve, HystereticMaterial |
| `portal_pushover.osmodel` | 4 | 3 | Pushover, Modal | Fiber sections, BeamWithHinges, yielding pushover |
| `ex1a_canti2d.osmodel` | 2 | 1 | Static preload, Pushover, Transient EQ | OpenSees Ex 1a, shared gravity + push + quake |
| `ex1b_portal2d.osmodel` | 4 | 3 | Static preload, Pushover, Transient EQ | OpenSees Ex 1b elastic portal, distributed gravity |
| `ex2a_canti2d_elastic_element.osmodel` | 2 | 1 | Static preload, Pushover, Transient EQ | Ex 2a cantilever, dimensions as named parameters |
| `ex2b_canti2d_inelastic_section.osmodel` | 2 | 1 | Static preload, Pushover, Transient EQ | Ex 2b, aggregated axial+flexure section |
| `ex2c_canti2d_inelastic_fiber_section.osmodel` | 2 | 1 | Static preload, Pushover, Transient EQ | Ex 2c, fiber section, coupled axial-flexure |
| `ex3_canti2d_elastic_element.osmodel` | 2 | 1 | Static preload, Pushover, Transient EQ | Ex 3 elastic build, unit-scaled parameters |
| `ex3_canti2d_inelastic_section.osmodel` | 2 | 1 | Static preload, Pushover, Transient EQ | Ex 3 aggregated-section build |
| `ex3_canti2d_inelastic_fiber_section.osmodel` | 2 | 1 | Static preload, Pushover, Transient EQ | Ex 3 fiber-section build |
| `ex4_portal2d_elastic_element.osmodel` | 4 | 3 | Static preload, Pushover, Transient sine | Ex 4 elastic portal, build/analysis split |
| `ex4_portal2d_inelastic_section.osmodel` | 4 | 3 | Static preload, Pushover, Transient sine | Ex 4 aggregated-section portal |
| `ex4_portal2d_inelastic_fiber_section.osmodel` | 4 | 3 | Static preload, Pushover, Transient sine | Ex 4 fiber-section portal |
| `ex1a_canti2d_eq.osmodel` | 2 | 1 | Static preload, Transient EQ | Ex 1a gravity + base excitation only |
| `eigen_two_storey_shear_frame.osmodel` | 6 | 6 | Modal | equalDOF floor constraints, shear-frame modes |
| `eigen_two_storey_one_bay_frame.osmodel` | 6 | 6 | Modal | Chopra 10.5 frame, sway modes, no constraints |
| `concrete04_cantilever.osmodel` | 2 | 1 | Static (gravity), Pushover | Concrete04 fiber section end-to-end |
2026-09-08 02:12:15 -04:00
## Quick tour
### 1. Force diagrams — `cantilever.osmodel`
```
File → Open → cantilever.osmodel
Analyze → Cases → run "Tip-Load"
Display → Show Force Diagram → component "M3" → linear moment, max at fixed end (50 kN·m)
→ component "V2" → constant -10 kN along the whole span
→ component "N" → ~zero (no axial load)
2026-09-08 02:12:15 -04:00
→ component "T" → ~zero (no torsion → console hint, no diagram)
Display → Show Deformed Shape → cantilever curve
2026-09-08 02:12:15 -04:00
```
Load runs along global Y (perpendicular to the beam, horizontal plane).
With the default 3D vertical-reference convention that lands on the
V2 / M3 pair — the in-plane bending pair.
2026-09-08 02:12:15 -04:00
UDL variant, parabolic moment:
2026-09-08 02:12:15 -04:00
```
Analyze → Cases → run "Uniform-Load"
Display → Show Force Diagram → M3 → parabolic, max 25 kN·m at fixed end
→ V2 → linear, max 10 kN at fixed end
```
### 2. Mode shapes — `space_frame_3d.osmodel`
2026-09-08 02:12:15 -04:00
```
File → Open → space_frame_3d.osmodel
Analyze → Cases → run "Modal-6"
Display → Animate Mode Shape → mode 1 = X-sway, mode 2 = Y-sway
→ Play, scrub timeline, change scale
2026-09-08 02:12:15 -04:00
```
### 3. Time-history and hysteresis — `space_frame_3d.osmodel`
2026-09-08 02:12:15 -04:00
```
File → Open → space_frame_3d.osmodel
Analyze → Cases → run "EQ-4s" (~5-10 sec on a modern laptop)
Display → Time-History Plot
- Node 12 (roof corner) + DOF 1 (X displacement) → "Add trace"
- Node 9 + DOF 1 → second trace, compare phase
2026-09-08 02:12:15 -04:00
Display → Hysteresis Plot
- X = Node 12 / DOF 1, Y = Node 12 / DOF 3 → orbit
```
### 4. Pushover — `sdof_pushover.osmodel`
```
File → Open → sdof_pushover.osmodel
Analyze → Cases → run "Push-X"
Display → Show Pushover Curve
→ linear from origin, then softens through yield
2026-09-08 02:12:15 -04:00
```
Column stays elastic here. Real nonlinear hinges need
BeamWithHinges + fiber sections; the machinery exists, the
fiber-section editor is still rough.
2026-09-08 02:12:15 -04:00
### 5. Nonlinear pushover with fiber hinges — `portal_pushover.osmodel`
```
File → Open → portal_pushover.osmodel
Analyze → Cases → run "Push-X"
Display → Show Pushover Curve
→ linear stiffness, then yield plateau as base hinges form
→ peak base shear = concrete crushing + rebar yield
2026-09-08 02:12:15 -04:00
```
Columns are BeamWithHinges + FiberSections (concrete core, rebar
layers) wrapped in a SectionAggregator for torsion.
2026-09-08 02:12:15 -04:00
### 6. Gravity + time-history chain — `ex1a_canti2d_eq.osmodel`
```
2026-09-08 02:12:15 -04:00
File → Open → ex1a_canti2d_eq.osmodel
Analyze → Cases → run "Earthquake"
Display → Time-History Plot
- Node 2 + DOF 1 (Ux) → tip horizontal response
- Node 2 + DOF 2 (Uy) → gravity should stay locked
2026-09-08 02:12:15 -04:00
```
Tiny model, exists for one reason: the standard transient recipe
`static preload → loadConst reset → UniformExcitation transient`
against a real ground-motion record in a `PathTimeSeries`.
2026-09-08 02:12:15 -04:00
### 7. OpenSees Ex 1a bundle — `ex1a_canti2d.osmodel`
```
2026-09-08 02:12:15 -04:00
File → Open → ex1a_canti2d.osmodel
Analyze → Cases → run "Push" or "Earthquake"
Display → Show Pushover Curve / Time-History Plot
```
Cantilever column with shared gravity preload and both lateral
variants. Small benchmark for checking pushover and transient agree
on the same geometry.
2026-09-08 02:12:15 -04:00
### 8. OpenSees Ex 1b bundle — `ex1b_portal2d.osmodel`
```
2026-09-08 02:12:15 -04:00
File → Open → ex1b_portal2d.osmodel
Analyze → Cases → run "Push" or "Earthquake"
Display → Show Pushover Curve / Time-History Plot
```
Elastic portal frame. Gravity comes from a distributed beam load
instead of nodal loads, which is the whole point of keeping it
around.
2026-09-08 02:12:15 -04:00
### 9. Ex 2a, parameter-driven — `ex2a_canti2d_elastic_element.osmodel`
```
2026-09-08 02:12:15 -04:00
File → Open → ex2a_canti2d_elastic_element.osmodel
Analyze → Cases → run "Push" or "Earthquake"
Display → Show Pushover Curve / Time-History Plot
```
Same physics as Ex 1a, but dimensions and derived quantities are
named parameters instead of literals.
2026-09-08 02:12:15 -04:00
### 10. Ex 2b, aggregated section — `ex2b_canti2d_inelastic_section.osmodel`
```
2026-09-08 02:12:15 -04:00
File → Open → ex2b_canti2d_inelastic_section.osmodel
Analyze → Cases → run "Push" or "Earthquake"
Display → Show Pushover Curve / Time-History Plot
```
First nonlinear cantilever in the series. Separate axial and flexural
uniaxial responses aggregated into one section on a force-based
beam-column.
2026-09-08 02:12:15 -04:00
### 11. Ex 2c, fiber section — `ex2c_canti2d_inelastic_fiber_section.osmodel`
```
2026-09-08 02:12:15 -04:00
File → Open → ex2c_canti2d_inelastic_fiber_section.osmodel
Analyze → Cases → run "Push" or "Earthquake"
Display → Show Pushover Curve / Time-History Plot
```
Ex 2b's fiber counterpart. Coupled axial-flexure with concrete and
steel assigned to fibers and rebar layers directly.
2026-09-08 02:12:15 -04:00
### 12. Ex 3 family — `ex3_canti2d_*.osmodel`
```
2026-09-08 02:12:15 -04:00
File → Open → ex3_canti2d_elastic_element.osmodel
Analyze → Cases → run "Push" or "Earthquake"
```
Same cantilever analyses on three build styles: elastic element,
aggregated uniaxial section, fiber section. All unit-scaled.
2026-09-08 02:12:15 -04:00
### 13. Modal shear building — `eigen_two_storey_shear_frame.osmodel`
```
2026-09-08 02:12:15 -04:00
File → Open → eigen_two_storey_shear_frame.osmodel
Analyze → Cases → run "Modal-2"
Display → Animate Mode Shape
- mode 1 → stories sway in phase
- mode 2 → stories sway out of phase
2026-09-08 02:12:15 -04:00
```
Validates modal workflows on a model small enough to check by hand,
with `equalDOF` doing the shear-frame duty.
2026-09-08 02:12:15 -04:00
### 14. Modal frame, Chopra 10.5 — `eigen_two_storey_one_bay_frame.osmodel`
2026-09-08 02:12:15 -04:00
```
File → Open → eigen_two_storey_one_bay_frame.osmodel
Analyze → Cases → run "Modal-2"
Display → Animate Mode Shape
- mode 1 → in-phase sway of both stories
- mode 2 → top story reverses against the first
```
Companion to the shear building above. Ordinary beam-column behavior,
no multi-point constraints.
2026-09-08 02:12:15 -04:00
### 15. Ex 4 portal family — `ex4_portal2d_*.osmodel`
2026-09-08 02:12:15 -04:00
```
File → Open → ex4_portal2d_elastic_element.osmodel
Analyze → Cases → run "Push" or "Sine-Uniform"
Display → Show Pushover Curve / Time-History Plot
```
Keeps the OpenSees split between model-building and analysis files,
recast as project variants. Covers pinned-base sway, distributed
girder gravity, and support-motion dynamics without an external quake
file. The fiber transient is kept as a nonlinear stress test — it may
stop early and still produce usable partial histories.
2026-09-08 02:12:15 -04:00
## Regenerating the .osmodel files
Scripts are the source of truth, `.osmodel` files are build artifacts
checked in for convenience. Change a script, rerun it:
2026-09-08 02:12:15 -04:00
```bash
python examples/cantilever.py
python examples/portal_frame.py
python examples/space_frame_3d.py
python examples/sdof_pushover.py
python examples/portal_pushover.py
python examples/ex1a_canti2d.py
python examples/ex1b_portal2d.py
python examples/ex2a_canti2d_elastic_element.py
python examples/ex1a_canti2d_eq.py
python examples/ex2b_canti2d_inelastic_section.py
python examples/ex2c_canti2d_inelastic_fiber_section.py
python examples/ex3_canti2d_elastic_element.py
python examples/ex3_canti2d_inelastic_section.py
python examples/ex3_canti2d_inelastic_fiber_section.py
python examples/ex4_portal2d_elastic_element.py
python examples/ex4_portal2d_inelastic_section.py
python examples/ex4_portal2d_inelastic_fiber_section.py
python examples/eigen_two_storey_shear_frame.py
python examples/eigen_two_storey_one_bay_frame.py
```
Each script builds the project, saves it, reloads it, and asserts a
clean round-trip.