Commit 3d69f15a authored by ph's avatar ph

order 2 achieved everything work

parent babe9686
......@@ -312,7 +312,7 @@ __kernel void time_step(__global const real *fn, __global real *fnp1) {
// first order relaxation
w2f(wnow + 0, fnext + 0);
real om = 1.9;
real om = 2;
// second order relaxation
for (int iv = 0; iv < _M; iv++) {
for (int d = 0; d < 4; d++) {
......@@ -404,7 +404,8 @@ __kernel void kinetic(const real t, __global real *fn, __global real *kin) {
real xy[2] = {i * _DX + _DX / 2, j * _DY + _DY / 2};
real wnow[_M];
exact_smooth_vortex(xy, t, wnow);
real kinloc = (wn[eU]-wnow[eU]) * (wn[eU]-wnow[eU]);
//real kinloc = (wn[eU]-wnow[eU]) * (wn[eU]-wnow[eU]);
real kinloc = fabs(wn[eU]-wnow[eU]);
//kinloc += wn[eV] * wn[eV];
//kinloc *= 0.5 / wn[eRho];
kin[imemk] += kinloc * _DX * _DY;
......
......@@ -188,7 +188,8 @@ def solve_ocl(m=_m, n=_n, nx=_nx, ny=_ny, Lx=_Lx, Ly=_Ly, Tmax=_Tmax,
if np.isnan(np.sum(kinetic_cpu)):
exit(f"Nan in kinetic_cpu at ite {ite}")
else:
print("L2 norm =", np.sqrt(np.sum(kinetic_cpu)/Lx/Ly))
#print("t=",t," L2 norm =", np.sqrt(np.sum(kinetic_cpu)/Lx/Ly))
print("t=",t," L1 norm =", np.sum(kinetic_cpu)/Lx/Ly)
else:
print(ite_title, end='\r')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment