Skip to content

Commit

Permalink
ref_level=2 for terminator test
Browse files Browse the repository at this point in the history
  • Loading branch information
ta440 committed Dec 7, 2023
1 parent b0b7750 commit 78a0c0f
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions integration-tests/physics/test_terminator_toy.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@ def run_terminator_toy(dirname):

# A much larger timestep than in proper simulations, as this
# tests moving towards a steady state with no flow.
dt = 100000.
dt = 50000.

# Make the mesh and domain
R = 6371220.
mesh = IcosahedralSphereMesh(radius=R,
refinement_level=3, degree=2)

domain = Domain(mesh, dt, 'BDM', 1)
refinement_level=2, degree=2)

# get lat lon coordinates
x = SpatialCoordinate(mesh)
Expand Down Expand Up @@ -64,12 +62,10 @@ def run_terminator_toy(dirname):

# Set up a non-divergent, time-varying, velocity field
def u_t(t):
return as_vector((Constant(0)*lamda, Constant(0)*lamda, Constant(0)*lamda))

transport_scheme = SSPRK3(domain)
transport_method = [DGUpwind(eqn, 'X'), DGUpwind(eqn, 'X2')]
return as_vector((Constant(0)*lamda, Constant(0)*lamda, Constant(0)*lamda))

Check failure on line 65 in integration-tests/physics/test_terminator_toy.py

View workflow job for this annotation

GitHub Actions / Run linter

E111

integration-tests/physics/test_terminator_toy.py:65:7: E111 indentation is not a multiple of 4

X_0 = 4e-6 + 0*lamda
X_T_0 = 4e-6
X_0 = X_T_0 + 0*lamda
X2_0 = 0*lamda

transport_scheme = SSPRK3(domain)
Expand All @@ -90,7 +86,6 @@ def u_t(t):
X_steady = Function(steady_space)
X2_steady = Function(steady_space)

X_T_0 = 4e-6
r = k1/(4*k2)
D_val = sqrt(r**2 + 2*X_T_0*r)

Expand All @@ -106,7 +101,10 @@ def test_terminator_toy_setup(tmpdir):
X_field = stepper.fields("X")
X2_field = stepper.fields("X2")

print(errornorm(X_field, X_steady)/norm(X_steady))
print(errornorm(X2_field, X2_steady)/norm(X2_steady))

# Assert that the physics scheme has sufficiently moved
# the species fields near their steady state solutions
assert errornorm(X_field, X_steady)/norm(X_steady) < 0.25, "The X field is not sufficiently close to the steady state profile"
assert errornorm(X2_field, X2_steady)/norm(X2_steady) < 0.25, "The X2 field is not sufficiently close to the steady state profile"
assert errornorm(X_field, X_steady)/norm(X_steady) < 0.4, "The X field is not sufficiently close to the steady state profile"
assert errornorm(X2_field, X2_steady)/norm(X2_steady) < 0.4, "The X2 field is not sufficiently close to the steady state profile"

0 comments on commit 78a0c0f

Please sign in to comment.