diff --git a/Solver/TESTCASES/Advection1D.lua b/Solver/TESTCASES/Advection1D.lua index 0caaa663be1564ab5767a42199d8968ef374bb53..f8994e7e8bde69ccb239cad44b668cf6e282bc11 100644 --- a/Solver/TESTCASES/Advection1D.lua +++ b/Solver/TESTCASES/Advection1D.lua @@ -4,7 +4,7 @@ model:load ('edge.geo') -- model:save ('edge.msh') model:load ('edge.msh') dg = dgSystemOfEquations (model) -dg:setOrder(0) +dg:setOrder(1) -- conservation law -- advection speed @@ -54,7 +54,7 @@ dg:exportSolution('output/Adv1D-00000') -- main loop n = 5 for i=1,100*n do - norm = dg:RK44(0.03) + norm = dg:RK44_limiter(0.03) if (i % n == 0) then print('iter',i,norm) dg:exportSolution(string.format("output/Adv1D-%05d", i)) diff --git a/Solver/TESTCASES/ForwardFacingStep.lua b/Solver/TESTCASES/ForwardFacingStep.lua index 2c4ccff29aeabd9c746d0f1ae3c98f4bf3901f5b..d1bbe4aeab5fee353e59554e65febac1b6a93c44 100644 --- a/Solver/TESTCASES/ForwardFacingStep.lua +++ b/Solver/TESTCASES/ForwardFacingStep.lua @@ -1,8 +1,14 @@ -MACH = 3; -RHO = 1.0; -PRES = 1./(MACH*RHO*RHO*1.4*1.4) -V = 1.0 -SOUND = V/MACH +MACH = 1.0; +GAMMA = 1.4; +U = 3.0 +V = 0.0 +RHO = 1.4; + +PRES = RHO*U*U/(GAMMA*MACH*MACH) +--PRES = 1; +--PRES = ./(MACH*RHO*RHO*GAMMA*GAMMA) + +SOUND = math.sqrt(U*U+V*V)/MACH --[[ Function for initial conditions @@ -10,9 +16,9 @@ SOUND = V/MACH function free_stream( XYZ, FCT ) for i=0,XYZ:size1()-1 do FCT:set(i,0,RHO) - FCT:set(i,1,RHO*V) - FCT:set(i,2,0.0) - FCT:set(i,3, 0.5*RHO*V*V+PRES/0.4) + FCT:set(i,1,RHO*U) + FCT:set(i,2,RHO*V) + FCT:set(i,3, 0.5*RHO*(U*U+V*V)+PRES/(RHO*GAMMA-1)) end end @@ -25,18 +31,19 @@ print'*** Loading the mesh and the model ***' myModel = GModel () myModel:load ('step.geo') myModel:load ('step.msh') + print'*** Create a dg solver ***' DG = dgSystemOfEquations (myModel) DG:setOrder(order) +FS = functionLua(4, 'free_stream', {'XYZ'}):getName() + law=dgPerfectGasLaw2d() DG:setConservationLaw(law) -law:addBoundaryCondition('Walls',law:newWallBoundary()) - -FS = functionLua(4, 'free_stream', {'XYZ'}):getName() +law:addBoundaryCondition('Walls',law:newWallBoundary()) law:addBoundaryCondition('LeftRight',law:newOutsideValueBoundary(FS)) -DG:setup() +DG:setup() print'*** setting the initial solution ***' @@ -53,10 +60,10 @@ LC = 0.1*.1 dt = .3*LC/(SOUND+V); print('DT=',dt) -for i=1,10000 do - norm = DG:RK44_limiter(dt) +for i=1,10 do + norm = DG:RK44_limiter(0.1*dt) print('*** ITER ***',i,norm) - if (i % 100 == 0) then + if (i % 1 == 0) then DG:exportSolution(string.format("output/solution-%06d", i)) end end diff --git a/Solver/TESTCASES/step.geo b/Solver/TESTCASES/step.geo index b101b8c6dd916b18924ec1e295f0ccac8d43cd91..560bc22e2b48cafec8a9bdb0e6038f2dc4f095be 100644 --- a/Solver/TESTCASES/step.geo +++ b/Solver/TESTCASES/step.geo @@ -1,8 +1,8 @@ Point(1) = {0, 0, 0, .1}; -Point(2) = {.5, 0, 0, .1}; -Point(3) = {.5, .25, 0, .1}; -Point(4) = {3, .25, 0, .1}; -Point(5) = {3, 1, 0, .1}; +Point(2) = {.6, 0, 0, .1}; +Point(3) = {.6, .2, 0, .1}; +Point(4) = {2.4, .2, 0, .1}; +Point(5) = {2.4, 1, 0, .1}; Point(6) = {0, 1, 0, .1}; Line(1) = {6, 5}; Line(2) = {5, 4}; @@ -14,5 +14,4 @@ Line Loop(7) = {2, 3, 4, 5, 6, 1}; Plane Surface(8) = {7}; Physical Line("Walls") = {1, 3, 4, 5}; Physical Line("LeftRight") = {2, 6}; -//Physical Line("LeftRight") = {1,2,3,4,5,6}; Physical Surface("Body") = {8};