diff --git a/Solver/TESTCASES/Aorta.lua b/Solver/TESTCASES/Aorta.lua index 4f475146d66e380bcab7f0bef73c8a4ab84a50d7..cc7fb4fbffa34be65da12099b0042277e0aff581 100644 --- a/Solver/TESTCASES/Aorta.lua +++ b/Solver/TESTCASES/Aorta.lua @@ -3,6 +3,7 @@ --]] +x = os.clock() function initial_condition( xyz , f ) for i=0,xyz:size1()-1 do f:set (i, 0, 3.14) @@ -12,22 +13,35 @@ end PI = 3.14159 T= 0.05 +t=0 Amax = 3.15 function inlet( FCT ) - FCT:set(0,0,Amax*math.sin(2*PI*t/T)*math.step(T/2-t)) - FCT:set(0,1, 0) + FCT:set(0,0,Amax*math.sin(2*PI*t/T)) + FCT:set(0,1, 0) end +--[[ +function pressureLawShallowWater (solution, bathymetry, f) + for i=0,f:size1()-1 do + f:set (i, 0, bathymetry:get(i,0)) + end +end +--]] + xyz = functionCoordinates.get() --[[ Example of a lua program driving the DG code --]] +order=2 +options = gmshOptions() model = GModel() -model:load ('aorta.msh') -order=3 +model:load ('aorta.geo') +options:numberSet('Mesh',-1,'ElementOrder',order) +model:mesh(1) +model:save('aorta.msh') dimension=1 -- boundary condition @@ -35,7 +49,9 @@ inlet_bc = functionLua(2, 'inlet') law = dgConservationLawShallowWater1d() law:addBoundaryCondition('Inlet',law:newOutsideValueBoundary(inlet_bc)) law:addBoundaryCondition('Outlet',law:newBoundaryWall()) -law:setBathymetry(functionConstant({0})) +bathymetry = functionConstant({0}) +law:setBathymetry(bathymetry) +--law:setPressureLaw(functionLua(1,'pressureLaw',{functionSolution.get(), bathymetry})) law:setLinearDissipation(functionConstant({0})) groups = dgGroupCollection(model, dimension, order) @@ -44,6 +60,7 @@ groups:buildGroupsOfInterfaces() rk=dgRungeKutta() limiter = dgSlopeLimiter(law) +print'*** print projetion ***' -- build solution vector FS = functionLua(2, 'initial_condition', {xyz}) solution = dgDofContainer(groups, law:getNbFields()) @@ -57,6 +74,7 @@ print'*** solve ***' CFL = 0.2; for i=1,9000 do dt = CFL * rk:computeInvSpectralRadius(law,solution); + t = t+dt norm = rk:iterate44(law,dt,solution) if (i % 100 == 0) then print('|ITER|',i,'|NORM|',norm,'|DT|',dt,'|CPU|',os.clock() - x) diff --git a/Solver/TESTCASES/Stommel.lua b/Solver/TESTCASES/Stommel.lua index 26be9b8cf9ab24689b5f55bcb80ee44d350dc5c0..465fca544b38476cbd45781ff9e22eee590b9ac7 100644 --- a/Solver/TESTCASES/Stommel.lua +++ b/Solver/TESTCASES/Stommel.lua @@ -1,6 +1,6 @@ model = GModel() model:load ('stommel_square.msh') -order=1 +order = 2 dimension = 2 CFunctions =[[