diff --git a/src/Applications/cavity.jl b/src/Applications/cavity.jl index 1dec97e..ad77de7 100644 --- a/src/Applications/cavity.jl +++ b/src/Applications/cavity.jl @@ -51,6 +51,7 @@ function _cavity(; order = 2, order_j = order, formulation = :mhd, + initial_value = :zero, rt_scaling = false, title="Cavity", path=datadir(), @@ -58,8 +59,11 @@ function _cavity(; ranks_per_level=nothing, verbose=true, vtk=true, + convection=false, closed_cavity=true ) + @assert formulation ∈ [:cfd,:mhd] + @assert initial_value ∈ [:zero,:solve] info = Dict{Symbol,Any}() params = Dict{Symbol,Any}( @@ -116,6 +120,7 @@ function _cavity(; :f => f̄, :B => B̄, :ζ => ζ, + :convection => convection, ) # FESpaces and Boundary conditions @@ -128,6 +133,8 @@ function _cavity(; :rt_scaling => rt_scaling ? 1.0/get_mesh_size(model) : nothing ) + params[:x0] = initial_value + if closed_cavity params[:bcs] = Dict{Symbol,Any}( :u => Dict(:tags => ["cavity", "lid"], :values => [uw, ul]), diff --git a/src/Applications/expansion.jl b/src/Applications/expansion.jl index c0d2759..b1bd6f3 100644 --- a/src/Applications/expansion.jl +++ b/src/Applications/expansion.jl @@ -69,6 +69,8 @@ function _expansion(; ) @assert solid_coupling ∈ [:none,:thin_wall,:solid] @assert inlet ∈ [:parabolic,:shercliff,:constant] + @assert initial_value ∈ [:zero,:inlet,:solve] + @assert formulation ∈ [:cfd,:mhd] info = Dict{Symbol,Any}() params = Dict{Symbol,Any}( @@ -179,6 +181,8 @@ function _expansion(; params[:x0] = Dict( :u=>u_in,:j=>j_zero,:p=>0.0,:φ=>0.0 ) + else + params[:x0] = initial_value end # Solver options diff --git a/src/Applications/hunt.jl b/src/Applications/hunt.jl index bee6374..5db41bf 100644 --- a/src/Applications/hunt.jl +++ b/src/Applications/hunt.jl @@ -67,6 +67,7 @@ function _hunt(; solve = true, solver = :julia, formulation = :mhd, + initial_value = :zero, rt_scaling = false, verbose = true, BL_adapted = true, @@ -74,6 +75,8 @@ function _hunt(; kmap_y = 1, ranks_per_level = nothing ) + @assert formulation ∈ [:cfd,:mhd] + @assert initial_value ∈ [:zero,:solve] info = Dict{Symbol,Any}() params = Dict{Symbol,Any}( @@ -163,6 +166,8 @@ function _hunt(; :j => Dict(:tags=>"insulating"), ) + params[:x0] = initial_value + if μ > 0 params[:bcs][:stabilization] = Dict(:μ=>μ) end @@ -209,7 +214,7 @@ function _hunt(; u_ref(x) = analytical_hunt_u(L,L,μ,grad_pz,Ha,2*nsums,x) j_ref(x) = analytical_hunt_j(L,L,σ,μ,grad_pz,Ha,2*nsums,x) - dΩ_phys = Measure(Ω_phys,order*(k+1)) + dΩ_phys = Measure(Ω_phys,2*(order+1)) eu = u - uh ej = j - jh eu_h1 = sqrt(sum(∫( ∇(eu)⊙∇(eu) + eu⋅eu )dΩ_phys))