Skip to content
Snippets Groups Projects
Commit cc796492 authored by Andreas Dedner's avatar Andreas Dedner
Browse files

use outflow dirichlet values for sod problem since that works better for

limiter (has boundary value to work with in limiter).
parent e7dd6dd6
No related branches found
No related tags found
1 merge request!4Latest features added to dune-fem-dg.
Pipeline #11317 failed
......@@ -79,7 +79,7 @@ def constant(dim,gamma):
def sod(dim,gamma):
space = Space(dim,dim+2)
x = SpatialCoordinate(space.cell())
return CompressibleEulerNeuman(dim,gamma) ,\
return CompressibleEulerDirichlet(dim,gamma) ,\
riemanProblem( x[0], 0.,
CompressibleEuler(dim,gamma).toCons([1,0,0,1]),
CompressibleEuler(dim,gamma).toCons([0.125,0,0,0.1])),\
......
......@@ -75,18 +75,21 @@ def useODESolver():
space = create.space(spaceName, grid, order=polOrder, dimrange=dimR)
u_h = initialize(space)
rho, v, p = Model.toPrim(u_h)
operator = createFemDGSolver( Model, space, limiter='default' )
# operator.setTimeStepSize(dt)
start = time.time()
# operator.applyLimiter( u_h );
grid.writeVTK(name,
pointdata=[u_h],
celldata={"density":rho, "pressure":p},
# celldata={"density":rho, "pressure":p}, # bug: density not shown correctly
celldata={"pressure":p},
cellvector={"velocity":v},
number=count)
while t < endTime:
# operator.applyLimiter( u_h );
operator.solve(target=u_h)
# operator.applyLimiter( u_h );
dt = operator.deltaT()
t += dt
if t > saveTime:
......@@ -94,13 +97,13 @@ def useODESolver():
count += 1
grid.writeVTK(name,
pointdata=[u_h],
celldata={"density":rho, "pressure":p},
celldata={"pressure":p},
cellvector={"velocity":v},
number=count)
saveTime += saveStep
grid.writeVTK(name,
pointdata=[u_h],
celldata={"density":rho, "pressure":p},
celldata={"pressure":p},
cellvector={"velocity":v},
number=count)
print("time loop:",time.time()-start)
......
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