Advertisement
Guest User

Untitled

a guest
Dec 17th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.46 KB | None | 0 0
  1.     """
  2.        Para X - A
  3.    """
  4.     for i in range(Ny):
  5.         for j in range(Nx):
  6.             a1x[i,j] = max( abs((uv[i,j]/fi)*df(u_plus1x[i,j],ex)) , abs((uv[i,j]/fi)*df(u_minus1x[i,j],ex)) )
  7.             a2x[i,j] = max( abs((uv[i,j]/fi)*df(u_plus2x[i,j],ex)) , abs((uv[i,j]/fi)*df(u_minus2x[i,j],ex)) )
  8.  
  9.     """
  10.        Para Y - A
  11.    """
  12.     for j in range(Nx):
  13.         for i in range(Ny):
  14.             a1y[i,j] = max( abs((vv[i,j]/fi)*df(u_plus1y[i,j],ex)) , abs((vv[i,j]/fi)*df(u_minus1y[i,j],ex)) )
  15.             a2y[i,j] = max( abs((vv[i,j]/fi)*df(u_plus2y[i,j],ex)) , abs((vv[i,j]/fi)*df(u_minus2y[i,j],ex)) )
  16.    
  17.    
  18.     """
  19.        Para X - H
  20.    """
  21.     for i in range(Ny):
  22.         for j in range(Nx):
  23.             H1x[i,j] = ( f(u_plus1x[i,j],ex) + f(u_minus1x[i,j],ex))/(2.0*fi) - a1x[i,j]*(u_plus1x[i,j]-u_minus1x[i,j])/2.0
  24.  
  25.     for i in range(Ny):
  26.         for j in range(Nx):
  27.             H2x[i,j] = (f(u_plus2x[i,j],ex)+f(u_minus2x[i,j],ex))/(2.0*fi) - a2x[i,j]*(u_plus2x[i,j] - u_minus2x[i,j])/2.0
  28.  
  29.     duX = (H2x - H1x)/h
  30.  
  31.  
  32.     """
  33.        Para Y - H
  34.    """
  35.     for j in range(Nx):
  36.         for i in range(Ny):
  37.             H1y[i,j] = ( f(u_plus1y[i,j],ex) + f(u_minus1y[i,j],ex))/(2.0*fi) - a1y[i,j]*(u_plus1y[i,j]-u_minus1y[i,j])/2.0
  38.  
  39.     for j in range(Nx):
  40.         for i in range(Ny):
  41.             H2y[i,j] = (f(u_plus2y[i,j],ex)+f(u_minus2y[i,j],ex))/(2.0*fi) - a2y[i,j]*(u_plus2y[i,j] - u_minus2y[i,j])/2.0
  42.    
  43.     duY = (H2y - H1y)/h
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement