@@ -272,22 +272,22 @@ where
272272
273273and we add -∂ⱼ(τᵃᵢⱼ) to the RHS as a body force (the isotropic part of the tensor is automatically modelled by the pressure gradient term).
274274Users need to define the turbulent viscosity function `νₜ` and pass it as a keyword argument to this function together with rate-of-strain
275- tensor array buffer `S`, Smagorinsky constant `C `, and filter width `Δ`.
275+ tensor array buffer `S`, Smagorinsky constant `Cs `, and filter width `Δ`.
276276For example, the standard Smagorinsky–Lilly model for the sub-grid scale stresses is
277277
278- νₜ = (CΔ )²|S̅ᵢⱼ|=(CΔ )²√(2S̅ᵢⱼS̅ᵢⱼ)
278+ νₜ = (CₛΔ )²|S̅ᵢⱼ|=(CₛΔ )²√(2S̅ᵢⱼS̅ᵢⱼ)
279279
280280It can be implemented as
281- `smagorinsky(I::CartesianIndex{m} where m; S, C , Δ) = @views (C *Δ)^2*sqrt(dot(S[I,:,:],S[I,:,:]))`
282- and passed into `sim_step!` as a keyword argument together with the varibles than the function needs (`S`, `C `, and `Δ`):
283- `sim_step!(sim, ...; udf=sgs, νₜ=smagorinsky, S, C , Δ)`
281+ `smagorinsky(I::CartesianIndex{m} where m; S, Cs , Δ) = @views (Cs *Δ)^2*sqrt(dot(S[I,:,:],S[I,:,:]))`
282+ and passed into `sim_step!` as a keyword argument together with the varibles than the function needs (`S`, `Cs `, and `Δ`):
283+ `sim_step!(sim, ...; udf=sgs, νₜ=smagorinsky, S, Cs , Δ)`
284284"""
285- function sgs! (flow, t; νₜ, S, C , Δ)
285+ function sgs! (flow, t; νₜ, S, Cs , Δ)
286286 N,n = size_u (flow. u)
287287 @loop S[I,:,:] .= WaterLily. S (I,flow. u) over I ∈ inside (flow. σ)
288288 for i ∈ 1 : n, j ∈ 1 : n
289289 WaterLily. @loop (
290- flow. σ[I] = - νₜ (I;S,C ,Δ)* ∂ (j,CI (I,i),flow. u);
290+ flow. σ[I] = - νₜ (I;S,Cs ,Δ)* ∂ (j,CI (I,i),flow. u);
291291 flow. f[I,i] += flow. σ[I];
292292 ) over I ∈ inside_u (N,j)
293293 WaterLily. @loop flow. f[I- δ (j,I),i] -= flow. σ[I] over I ∈ WaterLily. inside_u (N,j)
0 commit comments