From ceeedcc71923c69253ec1d54fd38a463cddd47be Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Keck <Jean-Baptiste.Keck@imag.fr>
Date: Thu, 15 Nov 2018 11:16:23 +0100
Subject: [PATCH] test 3d particles above salt

---
 .../particles_above_salt_bc.py                 | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/examples/particles_above_salt/particles_above_salt_bc.py b/examples/particles_above_salt/particles_above_salt_bc.py
index c8dd6e161..459c1a201 100644
--- a/examples/particles_above_salt/particles_above_salt_bc.py
+++ b/examples/particles_above_salt/particles_above_salt_bc.py
@@ -69,16 +69,20 @@ def compute(args):
 
     # Constants
     l0 = 1.5 #initial thickness of the profile
-    (Sc, tau, Vp, Rs, Xo, Xn, N) = (0.70,  25, 0.04, 2.0, (-600,0),   (600,750),    (1537, 487))
-    #(Sc, tau, Vp, Rs, Xo, Xn, N) = (7.00,  25, 0.04, 2.0, (-110,0,0), (65,100,100), (1537, 512, 512))
+    dim = args.ndim
+    if (dim==2):
+        (Sc, tau, Vp, Rs, Xo, Xn, N) = (0.70,  25, 0.04, 2.0, (-600,0),   (600,750), (1537, 487))
+    elif (dim==3):
+        (Sc, tau, Vp, Rs, Xo, Xn, N) = (7.00, 25, 0.04, 2.0, (-110,0,0), (65,100,100), (1537, 512, 512))
+        N = (1537,512,512)
+    else:
+        raise NotImplementedError
 
     nu_S = ScalarParameter(name='nu_S', dtype=args.dtype, const=True, initial_value=1.0/Sc)
     nu_C = ScalarParameter(name='nu_C', dtype=args.dtype, const=True, initial_value=1.0/(tau*Sc))
     nu_W = ScalarParameter(name='nu_W', dtype=args.dtype, cosnt=True, initial_value=1.0)
 
     # Define the domain
-    dim = args.ndim
-    N = (4096,512)
     npts=N[::-1]
     Xo=Xo[::-1]
     Xn=Xn[::-1]
@@ -211,8 +215,8 @@ def compute(args):
     
     #> Reset scalar boundaries
     Z = space_symbols[0]
-    expr1 = Assignment(Cs, Select(Cs, 1, LogicalGE(Z, Xn[-1]-50)))
-    expr0 = Assignment(Ss, Select(Ss, 1, LogicalLE(Z, Xo[-1]+50)))
+    expr1 = Assignment(Cs, Select(Cs, 1, LogicalGE(Z, Xn[-1]-10)))
+    expr0 = Assignment(Ss, Select(Ss, 1, LogicalLE(Z, Xo[-1]+10)))
     exprs = (expr0, expr1)
     reset_boundaries = CustomSymbolicOperator(name='reset_boundaries',
                                     implementation=impl,
@@ -364,7 +368,7 @@ if __name__=='__main__':
     parser.set_defaults(impl='cl', ndim=2, npts=(64,),
                         box_origin=(0.0,), box_length=(1.0,), 
                         tstart=0.0, tend=500.0, 
-                        dt=1e-6, cfl=4.00, lcfl=0.95,
+                        dt=1e-6, cfl=4.00, lcfl=0.80,
                         dump_times=tuple(float(x) for x in range(0,500,10)),
                         dump_freq=0)
 
-- 
GitLab