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): ...@@ -79,7 +79,7 @@ def constant(dim,gamma):
def sod(dim,gamma): def sod(dim,gamma):
space = Space(dim,dim+2) space = Space(dim,dim+2)
x = SpatialCoordinate(space.cell()) x = SpatialCoordinate(space.cell())
return CompressibleEulerNeuman(dim,gamma) ,\ return CompressibleEulerDirichlet(dim,gamma) ,\
riemanProblem( x[0], 0., riemanProblem( x[0], 0.,
CompressibleEuler(dim,gamma).toCons([1,0,0,1]), CompressibleEuler(dim,gamma).toCons([1,0,0,1]),
CompressibleEuler(dim,gamma).toCons([0.125,0,0,0.1])),\ CompressibleEuler(dim,gamma).toCons([0.125,0,0,0.1])),\
......
...@@ -75,18 +75,21 @@ def useODESolver(): ...@@ -75,18 +75,21 @@ def useODESolver():
space = create.space(spaceName, grid, order=polOrder, dimrange=dimR) space = create.space(spaceName, grid, order=polOrder, dimrange=dimR)
u_h = initialize(space) u_h = initialize(space)
rho, v, p = Model.toPrim(u_h) rho, v, p = Model.toPrim(u_h)
operator = createFemDGSolver( Model, space, limiter='default' ) operator = createFemDGSolver( Model, space, limiter='default' )
# operator.setTimeStepSize(dt) # operator.setTimeStepSize(dt)
start = time.time() start = time.time()
# operator.applyLimiter( u_h );
grid.writeVTK(name, grid.writeVTK(name,
pointdata=[u_h], pointdata=[u_h],
celldata={"density":rho, "pressure":p}, # celldata={"density":rho, "pressure":p}, # bug: density not shown correctly
celldata={"pressure":p},
cellvector={"velocity":v}, cellvector={"velocity":v},
number=count) number=count)
while t < endTime: while t < endTime:
# operator.applyLimiter( u_h );
operator.solve(target=u_h) operator.solve(target=u_h)
# operator.applyLimiter( u_h );
dt = operator.deltaT() dt = operator.deltaT()
t += dt t += dt
if t > saveTime: if t > saveTime:
...@@ -94,13 +97,13 @@ def useODESolver(): ...@@ -94,13 +97,13 @@ def useODESolver():
count += 1 count += 1
grid.writeVTK(name, grid.writeVTK(name,
pointdata=[u_h], pointdata=[u_h],
celldata={"density":rho, "pressure":p}, celldata={"pressure":p},
cellvector={"velocity":v}, cellvector={"velocity":v},
number=count) number=count)
saveTime += saveStep saveTime += saveStep
grid.writeVTK(name, grid.writeVTK(name,
pointdata=[u_h], pointdata=[u_h],
celldata={"density":rho, "pressure":p}, celldata={"pressure":p},
cellvector={"velocity":v}, cellvector={"velocity":v},
number=count) number=count)
print("time loop:",time.time()-start) 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