Skip to content
Snippets Groups Projects
Commit 161cc034 authored by Florian Atteneder's avatar Florian Atteneder
Browse files

fix source term in dg and fv rhs computation

parent fcc1be15
No related branches found
No related tags found
1 merge request!101Refactor GRHD project
......@@ -26,7 +26,7 @@ function compute_rhs_weak_form!(rhs, f, nf, mesh::Mesh1d{SpectralElement})
end
function compute_rhs_weak_form!(rhs, f, s, nf, mesh::Mesh1d{SpectralElement})
compute_rhs_weak_form!(rhs, f, nf, mesh)
rhs .+= s
rhs .-= s
return
end
......@@ -229,6 +229,6 @@ function compute_rhs_weak_form!(rhs, _::Real, fy, nf, mesh::Mesh2d{SpectralEleme
end
function compute_rhs_weak_form!(rhs, fx, fy, s, nf, mesh::Mesh2d{SpectralElement})
compute_rhs_weak_form!(rhs, fx, fy, nf, mesh)
rhs .+= s
rhs .-= s
return
end
......@@ -27,20 +27,7 @@ function fv_update_step!(up1, u, f, bdry_u, bdry_f, dt, mesh::Mesh1d{FVElement})
end
function fv_update_step!(up1, u, f, s, bdry_u, bdry_f, bdry_s, dt, mesh::Mesh1d{FVElement})
TODO()
@unpack invjac = mesh
@unpack K = mesh
dl = widths(mesh)[1] / K
dtdl = dt/dl
@turbo for j = 2:K-1
up1[j] = (u[j+1] + 2*u[j] + u[j-1])/4 - dtdl/2 * (f[j+1] - f[j-1]) + s[j]
end
if mesh.tree.periodic[1]
up1[1] = (u[2] + 2*u[1] + u[end])/4 - dtdl/2 * (f[2] - f[end]) + s[1]
up1[end] = (u[1] + 2*u[end] + u[end-1])/4 - dtdl/2 * (f[1] - f[end-1]) + s[end]
else
TODO()
end
return
function fv_update_step!(up1, u, f, s, bdry_u, bdry_f, dt, mesh::Mesh1d{FVElement})
fv_update_step!(up1, u, f, bdry_u, bdry_f, dt, mesh)
up1 .-= s
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment