Skip to content

Commit

Permalink
add some commentary for restarting sims or changing to transient
Browse files Browse the repository at this point in the history
  • Loading branch information
mberto79 committed Sep 26, 2024
1 parent 9aa493f commit 9c53d0a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
12 changes: 11 additions & 1 deletion docs/src/user_guide/4_runtime_and_solvers.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,14 @@ In XCALibre.jl the `run!` function is used to start a simulation, which will dis
```@docs; canonical=false
run!()
```
---

## Restarting simulations
---

It should be noted that when running a simulation with `run!`, the solution fields in the `Physics` model are mutated. Thus, running the simulation from the previous solution is simply a matter of reissuing the `run!` function. At present, this has the side effect of overwriting any existing solution files (`.vtk` or `.vtu`). Users must be aware of this behaviour.

In some cases, it may be desirable to solve a problem with a steady solver and use the solution to run transient simulations. This is possible using the `change` function.

```@docs; canonical=false
XCALibre.ModelPhysics.change
```
20 changes: 20 additions & 0 deletions src/ModelPhysics/3_physics_API.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
export change

"""
change(model::Physics, property, value) => updatedModel::Physics
A convenience function to change properties of an exisitng `Physics` model.
# Input arguments
- `model::Physics` a `Physics` model to modify
- `property` is a symbol specifying the property to change
- `value` is the new setting for the specified `property`
# Output
This function return a new `Physics` object
# Example
To change a model to run a transient simulation e.g. after converging in steady state
modelTransient = change(model, :time, Transient())
"""
function change(model::Physics, property, value)
@assert property fieldnames(Physics) throw(ArgumentError(
"""$value is not in Physics.
Expand Down

0 comments on commit 9c53d0a

Please sign in to comment.