We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 9e5b343 + ecd05fe commit 47ce3e6Copy full SHA for 47ce3e6
CHANGELOG.md
@@ -6,7 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
## Version [v0.5.3] - 2026-02-19
7
8
### Added
9
-* No new functionality added
+* Added optional adaptive time stepping based on Courant number control (`AdaptiveTimeStepping`) [#98](@ref)
10
11
12
### Fixed
examples/2D_flatplate_fixedT_KOmega.jl
@@ -99,7 +99,8 @@ solvers = (
99
solver = Gmres(), # Bicgstab(), Gmres()
100
preconditioner = Jacobi(),
101
convergence = 1e-7,
102
- relax = 0.3,
+ # relax = 0.3,
103
+ relax = 0.2,
104
atol = 1e-2
105
),
106
h = SolverSetup(
src/Calculate/Calculate_0_gradient.jl
@@ -255,4 +255,9 @@ function grad!(grad::Grad{Midpoint,F,R,I,M}, phif, phi, BCs, time, config) where
255
correct_interpolation!(grad, phif, phi, config)
256
green_gauss!(grad, phif, config)
257
end
258
+end
259
+
260
+# This is a gradient method that does not take BCs as arguments (implicitly assuming the the gradient at boundaries is 0)
261
+function grad!(grad::Grad{Gauss,F,R,I,M}, phif, phi, time, config) where {F,R<:VectorField,I,M}
262
+ green_gauss!(grad, phif, config)
263
src/Discretise/Discretise_1_schemes.jl
@@ -30,7 +30,7 @@ end
30
@inline scheme_source!(
31
term::Operator{F,P,I,Time{Euler}}, cell, cID, cIndex, prev, runtime) where {F,P,I} = begin
32
volume = cell.volume
33
- vol_rdt = volume/runtime.dt
+ vol_rdt = volume/runtime.dt[1]
34
35
# Increment sparse and b arrays
36
ac = vol_rdt
@@ -48,7 +48,7 @@ end
48
49
term::Operator{F,P,I,Time{CrankNicolson}}, cell, cID, cIndex, prev, runtime) where {F,P,I} = begin
50
51
52
53
54
src/ModelPhysics/0_type_definition.jl
@@ -4,6 +4,7 @@ export Momentum
4
export AbstractTimeModel
5
export Transient, Steady
"""
struct Physics{T,F,SO,M,Tu,E,D,BI}
time::T
@@ -159,4 +160,4 @@ end
159
160
mutable struct ModelState{T1}
161
residuals::T1
162
converged::Bool
-end
163
src/ModelPhysics/Energy/Energy.jl
@@ -19,7 +19,6 @@ include("energy_types.jl")
19
20
# Energy models
21
include("Sensible_Enthalpy.jl")
22
-# include("Laplace_Energy.jl")
23
include("Conduction.jl")
24
25
# Property Models
src/ModelPhysics/Energy/Sensible_Enthalpy.jl
@@ -159,7 +159,7 @@ function energy!(
# Kbounded = ScalarField(mesh)
Pr = model.fluid.Pr
- dt = runtime.dt
+ dt = runtime.dt[1]
164
# Pre-allocate auxiliary variables
165
TF = _get_float(mesh)
src/ModelPhysics/ModelPhysics.jl
@@ -34,4 +34,5 @@ include("Turbulence/Turbulence.jl")
include("FluidProperties/FluidProperties.jl")
37
38
end # end module
src/ModelPhysics/Turbulence/RANS_laminar.jl
@@ -102,6 +102,19 @@ function save_output(model::Physics{T,F,SO,M,Tu,E,D,BI}, outputWriter, iteration
write_results(iteration, time, model.domain, outputWriter, config.boundaries, args...)
+# function save_output(model::Physics{T,F,SO,M,Tu,E,D,BI}, outputWriter, iteration, time, config
+# ) where {T,F<:Multiphase,SO,M,Tu<:Laminar,E<:Nothing,D,BI}
107
108
+# args = (
109
+# ("U", model.momentum.U),
110
+# ("p", model.momentum.p),
111
+# ("alpha", model.fluid.alpha),
112
+# ("rho", model.fluid.rho),
113
+# # ("p_rgh", model.fluid.p_rgh)
114
+# )
115
+# write_results(iteration, time, model.domain, outputWriter, config.boundaries, args...)
116
+# end
117
118
function save_output(model::Physics{T,F,SO,M,Tu,E,D,BI}, outputWriter, iteration, time, config
119
) where {T,F,SO,M,Tu<:Laminar,E<:Nothing,D,BI}
120
args = (
src/Simulate/Simulate_0_types.jl
@@ -2,12 +2,12 @@ export Configuration
2
export Hardware
3
- @kwdef struct Configuration{SC,SL,RT,HW,PP}
+ struct Configuration{SC,SL,RT,HW,PP}
schemes::SC
solvers::SL
runtime::RT
hardware::HW
- postprocess::PP = nothing
+ postprocess::PP
13
The `Configuration` type is passed to all flow solvers and provides all the relevant information to run a simulation.
@@ -29,16 +29,29 @@ config = Configuration(
29
solvers=solvers, schemes=schemes, runtime=runtime, hardware=hardware, boundaries=BCs)
```
-@kwdef struct Configuration{SC,SL,RT,HW,BC,PP}
+struct Configuration{SC,SL,RT,HW,BC,PP}
boundaries::BC
39
40
Adapt.@adapt_structure Configuration
41
42
+Configuration(; schemes, solvers, runtime, hardware, boundaries, postprocess=nothing) = begin
43
+Configuration(
44
+ schemes,
45
+ solvers,
46
+ adapt(hardware.backend, runtime),
47
+ hardware,
+ boundaries,
+ postprocess
+)
55
56
57
hardware = Hardware(backend, workgroup)
0 commit comments