-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
323 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
.github/workflows/CI.yml | ||
docs/build/ | ||
plotnodes.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
function user_inputs() | ||
inputs = Dict( | ||
#--------------------------------------------------------------------------- | ||
# User define your inputs below: the order doesn't matter | ||
#--------------------------------------------------------------------------- | ||
:ode_solver => SSPRK54(), #ORK256(),#SSPRK33(), #SSPRK33(), #SSPRK54(), | ||
:Δt => 0.4, | ||
:tinit => 0.0, | ||
:tend => 1000.0, | ||
#:tinit => 100.0, | ||
#:tend => 1000.0, | ||
#:lrestart => true, | ||
:restart_input_file_path => "./output/CompEuler/theta/output-19Nov2023-115126", | ||
:ndiagnostics_outputs => 2, | ||
#:case => "rtb", | ||
:lsource => true, | ||
#--------------------------------------------------------------------------- | ||
#Integration and quadrature properties | ||
#--------------------------------------------------------------------------- | ||
:interpolation_nodes =>"lgl", | ||
:nop => 4, # Polynomial order | ||
#--------------------------------------------------------------------------- | ||
# Physical parameters/constants: | ||
#--------------------------------------------------------------------------- | ||
:lvisc => true, #false by default NOTICE: works only for Inexact | ||
:ivisc_equations => (1, 2, 3, 4), | ||
:μ => (0.0, 20.0, 20.0, 60.0), #horizontal viscosity constant for momentum | ||
#--------------------------------------------------------------------------- | ||
# Mesh paramters and files: | ||
#--------------------------------------------------------------------------- | ||
:lread_gmsh => true, #If false, a 1D problem will be enforced | ||
#:gmsh_filename => "./meshes/gmsh_grids/hexa_circle.msh", | ||
:gmsh_filename => "./meshes/gmsh_grids/hexa_TFI_RTB20x20.msh", #for nop=4 | ||
#--------------------------------------------------------------------------- | ||
# Filter parameters | ||
#--------------------------------------------------------------------------- | ||
#:lfilter => true, | ||
#:mu_x => 0.01, | ||
#:mu_y => 0.01, | ||
#:filter_type => "erf", | ||
#--------------------------------------------------------------------------- | ||
# Plotting parameters | ||
#--------------------------------------------------------------------------- | ||
:outformat => "vtk", | ||
:loverwrite_output => true, | ||
:output_dir => "./output/", | ||
:loutput_pert => true, #this is only implemented for VTK for now | ||
#--------------------------------------------------------------------------- | ||
) #Dict | ||
#--------------------------------------------------------------------------- | ||
# END User define your inputs below: the order doesn't matter | ||
#--------------------------------------------------------------------------- | ||
|
||
return inputs | ||
|
||
end |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
function user_inputs() | ||
inputs = Dict( | ||
#--------------------------------------------------------------------------- | ||
# | ||
# User define your inputs below: the order doesn't matter | ||
# IMPORTANT NOTICE: DO NOT FORGET the "," at the end of each entry!!! | ||
#--------------------------------------------------------------------------- | ||
:ode_solver => SSPRK33(), | ||
:tend => 9.0, | ||
:Δt => 1.0e-3, | ||
:ndiagnostics_outputs => 30, #these are steps, not seconds | ||
:output_dir => "./output/", | ||
#--------------------------------------------------------------------------- | ||
#Integration and quadrature properties | ||
#--------------------------------------------------------------------------- | ||
:interpolation_nodes => "lgl", # Choice: "lgl", "cg", "cgl" | ||
:nop => 6, # Polynomial order | ||
:nop_laguerre => 50, | ||
:lexact_integration => false, | ||
:lsource => true, | ||
:llaguerre_1d_right => true, | ||
:llaguerre_1d_left => true, | ||
:laguerre_beta => 1.0, | ||
:yfac_laguerre => 0.05, | ||
#--------------------------------------------------------------------------- | ||
# Physical parameters/constants: | ||
#--------------------------------------------------------------------------- | ||
:lvisc => false, | ||
:νx => 0.01, #kinematic viscosity constant | ||
:νy => 0.01, #kinematic viscosity constant | ||
#--------------------------------------------------------------------------- | ||
# Mesh paramters and files: | ||
#--------------------------------------------------------------------------- | ||
:lread_gmsh => false, #If false, a 1D problem will be enforced | ||
#--------------------------------------------------------------------------- | ||
# Output formats: "png" -> plots to png file. "ascii" -> data to npoin file | ||
#--------------------------------------------------------------------------- | ||
:outformat => "hdf5", #choice: "png", "ascii" (default is ascii) | ||
:loverwrite_output => true, | ||
:plot_vlines => [-2.5,2.5], | ||
:plot_axis => [-0.05,0.55, -0.35,0.35], | ||
#--------------------------------------------------------------------------- | ||
# 1D (lread_gmsh => faluse): the grid is built by jexpresso | ||
#--------------------------------------------------------------------------- | ||
:xmin => -2.5, | ||
:xmax => 2.5, | ||
:nelx => 50, | ||
) #Dict | ||
#--------------------------------------------------------------------------- | ||
# END User define your inputs below: the order doesn't matter | ||
#--------------------------------------------------------------------------- | ||
|
||
return inputs | ||
|
||
end |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module CompEulerthetaTests | ||
|
||
project_root = dirname(Base.current_project()) | ||
include(joinpath(project_root, "test", "solnCompare.jl")) | ||
|
||
using .solnCompare | ||
using Test | ||
|
||
@testset "JEXPRESSO Examples" begin run_example("CompEuler", "thetaTracers") end | ||
end # module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module CompEulerthetaTests | ||
|
||
project_root = dirname(Base.current_project()) | ||
include(joinpath(project_root, "test", "solnCompare.jl")) | ||
|
||
using .solnCompare | ||
using Test | ||
|
||
@testset "JEXPRESSO Examples" begin run_example("CompEuler", "wave1d_lag") end | ||
end # module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
function initialize(SD, PT, mesh::St_mesh, inputs::Dict, OUTPUT_DIR::String, TFloat) | ||
""" | ||
""" | ||
@info " Initialize fields for 1D adv diff ........................ " | ||
|
||
#--------------------------------------------------------------------------------- | ||
# Solution variables: | ||
# | ||
# NOTICE: while these names can be arbitrary, the length of this tuple | ||
# defines neqs, which is used to allocate all necessary equation-dependent arrays | ||
# | ||
#--------------------------------------------------------------------------------- | ||
qvars = ("u", "v") | ||
q = define_q(SD, mesh.nelem, mesh.npoin, mesh.ngl, qvars, TFloat; neqs=length(qvars)) | ||
#--------------------------------------------------------------------------------- | ||
|
||
σ = Float64(0.15) | ||
σ2= σ*σ | ||
for ip=1:mesh.npoin | ||
x = mesh.x[ip] | ||
|
||
ex = -(x - 0.0)^2/σ2 | ||
q.qn[ip,1] = 2^ex | ||
q.qn[ip,2] = 0.0 | ||
|
||
#Store initial background state for plotting and analysis of pertuebations | ||
q.qe[ip,1] = 0.0 | ||
q.qe[ip,2] = 0.0 | ||
|
||
end | ||
|
||
for ivar=1:length(qvars) | ||
plot_initial(SD, mesh.x, q.qn[:,ivar], ivar, OUTPUT_DIR) | ||
end | ||
|
||
@info " Initialize fields for 1D adv diff ........................ DONE " | ||
|
||
return q | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
""" | ||
qibdy is an Array{Floats} of size `nvars` | ||
src/equations/EQUATIONS_NAME/user_bc.jl contains a set of user-defined boundary conditions functions | ||
that can be modified as needed. | ||
The function defined in src/equations/EQUATIONS_NAME/user_bc.jl | ||
are called by the b.c. functions defined in src/kernel/custom_bcs.jl | ||
within a boundary-edge loop that detects the "tag" string defined in the user-generated *.msh file. | ||
For example: | ||
If some domain boundaries of gmsh file mymesh.msh are tagged as "inflow" and "no_slip", then the user | ||
creating the functions in user_bc.jl must define the behavior of the unknown or its derivatives | ||
on those boundaries. | ||
```math | ||
if (tag === "inflow") | ||
qibdy[1] = 3.0 | ||
elseif (tag === "fix_temperature") | ||
qibdy[2] = 300.0 | ||
end | ||
return qibdy | ||
``` | ||
where `qibdy[i=1:nvar]` is the value unknown `i` | ||
""" | ||
function user_bc_dirichlet!(q::SubArray{Float64}, x::AbstractFloat, t::AbstractFloat, tag::String,qbdy::AbstractArray,qe::SubArray{Float64},::TOTAL) | ||
|
||
nothing | ||
end | ||
|
||
function user_bc_dirichlet!(q::SubArray{Float64}, x::AbstractFloat, t::AbstractFloat, tag::String,qbdy::AbstractArray,qe::SubArray{Float64},::PERT) | ||
|
||
nothing | ||
end | ||
|
||
function user_bc_neumann(q::AbstractArray, gradq::AbstractArray, x::AbstractFloat, t::AbstractFloat, inputs::Dict) | ||
|
||
flux = zeros(size(q,2),1) | ||
return flux | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
function user_flux!(F::SubArray{Float64}, G::SubArray{Float64}, SD::NSD_1D, | ||
q::SubArray{Float64}, | ||
qe::SubArray{Float64}, | ||
mesh::St_mesh, | ||
::CL, ::TOTAL; neqs=4, ip=1) | ||
|
||
F[1] = q[2] | ||
F[2] = q[1] | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
function user_inputs() | ||
inputs = Dict( | ||
#--------------------------------------------------------------------------- | ||
# | ||
# User define your inputs below: the order doesn't matter | ||
# IMPORTANT NOTICE: DO NOT FORGET the "," at the end of each entry!!! | ||
#--------------------------------------------------------------------------- | ||
:ode_solver => SSPRK33(), | ||
:tend => 9.0, | ||
:Δt => 1.0e-3, | ||
:ndiagnostics_outputs => 30, #these are steps, not seconds | ||
:output_dir => "./output/", | ||
#--------------------------------------------------------------------------- | ||
#Integration and quadrature properties | ||
#--------------------------------------------------------------------------- | ||
:interpolation_nodes => "lgl", # Choice: "lgl", "cg", "cgl" | ||
:nop => 6, # Polynomial order | ||
:nop_laguerre => 50, | ||
:lexact_integration => false, | ||
:lsource => true, | ||
:llaguerre_1d_right => true, | ||
:llaguerre_1d_left => true, | ||
:laguerre_beta => 1.0, | ||
:yfac_laguerre => 0.05, | ||
#--------------------------------------------------------------------------- | ||
# Physical parameters/constants: | ||
#--------------------------------------------------------------------------- | ||
:lvisc => false, | ||
:νx => 0.01, #kinematic viscosity constant | ||
:νy => 0.01, #kinematic viscosity constant | ||
#--------------------------------------------------------------------------- | ||
# Mesh paramters and files: | ||
#--------------------------------------------------------------------------- | ||
:lread_gmsh => false, #If false, a 1D problem will be enforced | ||
#--------------------------------------------------------------------------- | ||
# Output formats: "png" -> plots to png file. "ascii" -> data to npoin file | ||
#--------------------------------------------------------------------------- | ||
:outformat => "hdf5", #choice: "png", "ascii" (default is ascii) | ||
:loverwrite_output => true, | ||
:output_dir => "./CI-runs", #this is in github | ||
:plot_vlines => [-2.5,2.5], | ||
:plot_axis => [-0.05,0.55, -0.35,0.35], | ||
#--------------------------------------------------------------------------- | ||
# 1D (lread_gmsh => faluse): the grid is built by jexpresso | ||
#--------------------------------------------------------------------------- | ||
:xmin => -2.5, | ||
:xmax => 2.5, | ||
:nelx => 50, | ||
) #Dict | ||
#--------------------------------------------------------------------------- | ||
# END User define your inputs below: the order doesn't matter | ||
#--------------------------------------------------------------------------- | ||
|
||
return inputs | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
function user_source!(S::SubArray{Float64}, q::SubArray{Float64}, qe::SubArray{Float64}, npoin, ::CL,::TOTAL; neqs=1,x=0.0, y=0.0, ymin=0.0, ymax=30000.0, ngl=5, nely=10,xmin = -120000, xmax =120000) | ||
|
||
PhysConst = PhysicalConst{Float64}() | ||
|
||
# | ||
# S(q(x)) = -ρg | ||
# | ||
|
||
if (x >= 2.49)#nsponge_points * dsy) #&& dbl >= 0.0) | ||
sponge_coe = 2.0/(1+exp((0.3*(xmax-2.5)-x+2.5)/((xmax)/18))) | ||
elseif (x <=-2.49) | ||
sponge_coe = 2.0/(1+exp(-(0.3*(xmin+2.5)-x-2.5)/((xmax)/18))) | ||
else | ||
sponge_coe = 0.0 | ||
end | ||
#@info xmin,xmax,x,sponge_coe | ||
zt = xmax | ||
zd = 5000.0 | ||
z = max(x-zd,0.0) | ||
dgamma =0.00005 | ||
alpha = 0.85 | ||
sigma = zt/18.0 | ||
fac1 = (alpha*zt-x)/sigma | ||
#=if (x >=60.0) | ||
cs = dgamma/(1+exp(fac1)) | ||
else | ||
cs = 0.0 | ||
end=# | ||
#cs = 1.0*sinpi(0.5*z/(zt-zd))^2 | ||
cs = min(sponge_coe,1) | ||
#@info "β x: " ctop,cxr,cxl,cs, zs, y, x, ymin, ymax, dsy, dbl | ||
S[1] = -(cs)*(q[1]) | ||
S[2] = -(cs)*(q[2]) | ||
return S | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters