diff --git a/test/hyperbolic/shallowwater.mini b/test/hyperbolic/shallowwater.mini index 374b2e89a41010a46817fee8ded947555e35354d..24f4942bd25f049d327f464da094799fd8e8737a 100644 --- a/test/hyperbolic/shallowwater.mini +++ b/test/hyperbolic/shallowwater.mini @@ -3,14 +3,13 @@ __exec_suffix = {diff_suffix} diff_suffix = numdiff, symdiff | expand diff -extension = 10.0 10.0 -upperright = 10.0 10.0 -cells = 20 20 -elementType = simplical -elements = 20 20 +extension = 50.0 50.0 +upperright = 50.0 50.0 +cells = 200 200 +elementType = hexahedral [instat] -T = 0.5 +T = 10.0 dt = 0.005 [wrapper.vtkcompare] diff --git a/test/hyperbolic/shallowwater.ufl b/test/hyperbolic/shallowwater.ufl index 076ab49fed1021c63061c2f0f1b9ac10511a559a..49edd94bfe6e4b191b26266c624904078ac60a13 100644 --- a/test/hyperbolic/shallowwater.ufl +++ b/test/hyperbolic/shallowwater.ufl @@ -1,7 +1,7 @@ cell = quadrilateral x = SpatialCoordinate(cell) -f = 0.2 * exp(-(pow((x[0] - 5), 2) / 2 + pow(x[1] - 5, 2) / 2)) + 1. +f = conditional(sqrt(pow(x[0] - 25., 2) + pow(x[1] - 25., 2)) <= 11, 2., 1.) V = FiniteElement("DG", cell, 1) MV = MixedElement(V, V, V) @@ -18,18 +18,19 @@ mass = inner(u, v)*dx h, q0, q1 = split(u) flux = as_matrix([[q0, q1], - [h*q0*q0 + 0.5*g*h*h, h*q0*q1], - [h*q0*q1, h*q1*q1 + 0.5*g*h*h]]) + [q0*q0/h + 0.5*g*h*h, q0*q1/h], + [q0*q1/h, q1*q1/h + 0.5*g*h*h]]) -bflux = as_matrix([[-q0, -q1], - [h*q0*q0 + 0.5*g*h*h, h*q0*q1], - [h*q0*q1, h*q1*q1 + 0.5*g*h*h]]) +bflux = as_matrix([[-q0, -q1], + [q0*q0/h + 0.5*g*h*h, q0*q1/h], + [q0*q1/h, q1*q1/h + 0.5*g*h*h]]) # Define numerical fluxes to choose from -alpha = Max(abs(n[0]*q0('+') + n[1]*q1('+')) + sqrt(g*h('+')), abs(n[0]*q0('-') + n[1]*q1('-')) + sqrt(g*h('-'))) +alpha = Max(abs(n[0]*q0('+') + n[1]*q1('+')) / h('+') + sqrt(g*h('+')), abs(n[0]*q0('-') + n[1]*q1('-')) / h('-') + sqrt(g*h('-'))) llf_flux = dot(avg(flux), n) - 0.5*alpha*jump(u) -boundary_flux = 0.5*dot(flux + bflux, n) + as_vector([0., q0, q1]) +alpha_b = abs(n[0]*q0 + n[1]*q1) / h + sqrt(g*h) +boundary_flux = 0.5*dot(flux + bflux, n) + alpha_b * as_vector([0., q0, q1]) numerical_flux = llf_flux r = -1. * inner(flux, grad(v))*dx \