Exemplo n.º 1
0
def ns2de_gnuplot_taylor_test ( ):

#*****************************************************************************80
#
## NS2DE_GNUPLOT_TAYLOR_TEST generates a velocity field on a regular grid and plots it.
#
#  Licensing:
#
#    This code is distributed under the GNU LGPL license.
#
#  Modified:
#
#    21 January 2015
#
#  Author:
#
#    John Burkardt
#
  from grid_2d import grid_2d
  from uvp_taylor import uvp_taylor

  print ''
  print 'NS2DE_GNUPLOT_TAYLOR_TEST:'
  print '  Generate a Taylor Vortex velocity field on a regular grid.'
  print '  Store in GNUPLOT data and command files.'

  x_lo = 0.5
  x_hi = 2.5
  x_num = 21

  y_lo = 0.5
  y_hi = 2.5
  y_num = 21

  [ x, y ] = grid_2d ( x_num, x_lo, x_hi, y_num, y_lo, y_hi )

  nu = 1.0
  rho = 1.0
  n = x_num * y_num
  t = 0.0

  [ u, v, p ] = uvp_taylor ( nu, rho, n, x, y, t )

  header = 'taylor'
  s = 0.10
  ns2de_gnuplot ( header, n, x, y, u, v, s )

  print ''
  print 'NS2DE_GNUPLOT_TAYLOR_TEST:'
  print '  Normal end of execution.'

  return
def ns2de_matplotlib_lucas_test ( ):

#*****************************************************************************80
#
## NS2DE_MATPLOTLIB_LUCAS_TEST plots a Lucas Bystricky velocity field.
#
#  Licensing:
#
#    This code is distributed under the GNU LGPL license.
#
#  Modified:
#
#    07 March 2015
#
#  Author:
#
#    John Burkardt
#
  from grid_2d import grid_2d
  from uvp_lucas import uvp_lucas

  print ''
  print 'NS2DE_MATPLOTLIB_LUCAS_TEST:'
  print '  Generate a Lucas Bystricky Flow field on a regular grid.'
  print '  Display it using MATPLOTLIB'

  x_lo = 0.0
  x_hi = 1.0
  x_num = 21

  y_lo = 0.0
  y_hi = 1.0
  y_num = 21

  [ x, y ] = grid_2d ( x_num, x_lo, x_hi, y_num, y_lo, y_hi )

  nu = 1.0
  rho = 1.0
  n = x_num * y_num
  t = 0.0

  [ u, v, p ] = uvp_lucas ( nu, rho, n, x, y, t )

  header = 'lucas'
  s = 0.25
  ns2de_matplotlib ( header, n, x, y, u, v, s )

  print ''
  print 'NS2DE_MATPLOTLIB_LUCAS_TEST:'
  print '  Normal end of execution.'

  return
def ns2de_matplotlib_taylor_test ( ):

#*****************************************************************************80
#
## NS2DE_MATPLOTLIB_TAYLOR_TEST plots a Taylor Vortex Flow field.
#
#  Licensing:
#
#    This code is distributed under the GNU LGPL license.
#
#  Modified:
#
#    23 January 2015
#
#  Author:
#
#    John Burkardt
#
  from grid_2d import grid_2d
  from uvp_taylor import uvp_taylor

  print ''
  print 'NS2DE_MATPLOTLIB_TAYLOR_TEST:'
  print '  Generate a velocity field on a regular grid.'
  print '  Display it using MATPLOTLIB'

  x_lo = 0.5
  x_hi = 2.5
  x_num = 21

  y_lo = 0.5
  y_hi = 2.5
  y_num = 21

  [ x, y ] = grid_2d ( x_num, x_lo, x_hi, y_num, y_lo, y_hi )

  nu = 1.0
  rho = 1.0
  n = x_num * y_num
  t = 0.0

  [ u, v, p ] = uvp_taylor ( nu, rho, n, x, y, t )

  header = 'taylor'
  s = 0.10
  ns2de_matplotlib ( header, n, x, y, u, v, s )

  print ''
  print 'NS2DE_MATPLOTLIB_TAYLOR_TEST:'
  print '  Normal end of execution.'

  return
def ns2de_matplotlib_spiral_test ( ):

#*****************************************************************************80
#
## NS2DE_MATPLOTLIB_SPIRAL_TEST plots a Spiral Flow velocity field.
#
#  Licensing:
#
#    This code is distributed under the GNU LGPL license.
#
#  Modified:
#
#    31 January 2015
#
#  Author:
#
#    John Burkardt
#
  from grid_2d import grid_2d
  from uvp_spiral import uvp_spiral

  print ''
  print 'NS2DE_MATPLOTLIB_SPIRAL_TEST:'
  print '  Generate a Spiral Flow velocity field on a regular grid.'
  print '  Display it using MATPLOTLIB'

  x_lo = 0.0
  x_hi = 1.0
  x_num = 21

  y_lo = 0.0
  y_hi = 1.0
  y_num = 21

  [ x, y ] = grid_2d ( x_num, x_lo, x_hi, y_num, y_lo, y_hi )

  nu = 1.0
  rho = 1.0
  n = x_num * y_num
  t = 0.0

  [ u, v, p ] = uvp_spiral ( nu, rho, n, x, y, t )

  header = 'spiral'
  s = 5.0
  ns2de_matplotlib ( header, n, x, y, u, v, s )

  print ''
  print 'NS2DE_MATPLOTLIB_SPIRAL_TEST:'
  print '  Normal end of execution.'

  return
Exemplo n.º 5
0
def ns2de_gnuplot_lucas_test ( ):

#*****************************************************************************80
#
## NS2DE_GNUPLOT_LUCAS_TEST plots the Lucas Bystricky flow field.
#
#  Licensing:
#
#    This code is distributed under the GNU LGPL license.
#
#  Modified:
#
#    07 March 2015
#
#  Author:
#
#    John Burkardt
#
  from grid_2d import grid_2d
  from uvp_lucas import uvp_lucas

  print ''
  print 'NS2DE_GNUPLOT_LUCAS_TEST:'
  print '  Generate the Lucas Bystricky velocity field on a regular grid.'
  print '  Store in GNUPLOT data and command files.'

  x_lo = 0.0
  x_hi = 1.0
  x_num = 21

  y_lo = 0.0
  y_hi = 1.0
  y_num = 21

  [ x, y ] = grid_2d ( x_num, x_lo, x_hi, y_num, y_lo, y_hi )

  nu = 1.0
  rho = 1.0
  n = x_num * y_num
  t = 0.0

  [ u, v, p ] = uvp_lucas ( nu, rho, n, x, y, t )

  header = 'lucas'
  s = 0.25
  ns2de_gnuplot ( header, n, x, y, u, v, s )

  print 'NS2DE_GNUPLOT_LUCAS_TEST:'
  print '  Normal end of execution.'

  return
Exemplo n.º 6
0
def ns2de_gnuplot_spiral_test ( ):

#*****************************************************************************80
#
## NS2DE_GNUPLOT_SPIRAL_TEST plots a Spiral Flow velocity field.
#
#  Licensing:
#
#    This code is distributed under the GNU LGPL license.
#
#  Modified:
#
#    31 January 2015
#
#  Author:
#
#    John Burkardt
#
  from grid_2d import grid_2d
  from uvp_spiral import uvp_spiral

  print ''
  print 'NS2DE_GNUPLOT_SPIRAL_TEST:'
  print '  Generate a Spiral Flow velocity field on a regular grid.'
  print '  Store in GNUPLOT data and command files.'

  x_lo = 0.0
  x_hi = 1.0
  x_num = 21

  y_lo = 0.0
  y_hi = 1.0
  y_num = 21

  [ x, y ] = grid_2d ( x_num, x_lo, x_hi, y_num, y_lo, y_hi )

  nu = 1.0
  rho = 1.0
  n = x_num * y_num
  t = 0.0

  [ u, v, p ] = uvp_spiral ( nu, rho, n, x, y, t )

  header = 'spiral'
  s = 5.0
  ns2de_gnuplot ( header, n, x, y, u, v, s )

  print 'NS2DE_GNUPLOT_SPIRAL_TEST:'
  print '  Normal end of execution.'

  return
def spiral_matplotlib_test ( ):

#*****************************************************************************80
#
## SPIRAL_MATPLOTLIB_TEST generates a field on a regular grid and plots it.
#
#  Licensing:
#
#    This code is distributed under the GNU LGPL license.
#
#  Modified:
#
#    20 January 2015
#
#  Author:
#
#    John Burkardt
#
  from grid_2d import grid_2d
  from uv_spiral import uv_spiral

  print ''
  print 'SPIRAL_MATPLOTLIB_TEST:'
  print '  Generate a spiral velocity field on a regular grid.'
  print '  Display it using MATPLOTLIB'

  x_lo = 0.0
  x_hi = 1.0
  x_num = 21

  y_lo = 0.0
  y_hi = 1.0
  y_num = 21

  [ x, y ] = grid_2d ( x_num, x_lo, x_hi, y_num, y_lo, y_hi )

  n = x_num * y_num
  c = 1.0

  [ u, v ] = uv_spiral ( n, x, y, c )

  header = 'spiral'
  s = 0.05
  spiral_matplotlib ( header, n, x, y, u, v, s )

  print ''
  print 'SPIRAL_GMATPLOTLIB_TEST:'
  print '  Normal end of execution.'

  return
Exemplo n.º 8
0
def spiral_gnuplot_test():

    #*****************************************************************************80
    #
    ## SPIRAL_GNUPLOT_TEST generates a field on a regular grid and plots it.
    #
    #  Licensing:
    #
    #    This code is distributed under the GNU LGPL license.
    #
    #  Modified:
    #
    #    20 January 2015
    #
    #  Author:
    #
    #    John Burkardt
    #
    from grid_2d import grid_2d
    from uv_spiral import uv_spiral

    print ''
    print 'SPIRAL_GNUPLOT_TEST:'
    print '  Generate a spiral velocity field on a regular grid.'
    print '  Store in GNUPLOT data and command files.'

    x_lo = 0.0
    x_hi = 1.0
    x_num = 21

    y_lo = 0.0
    y_hi = 1.0
    y_num = 21

    [x, y] = grid_2d(x_num, x_lo, x_hi, y_num, y_lo, y_hi)

    n = x_num * y_num
    c = 1.0

    [u, v] = uv_spiral(n, x, y, c)

    header = 'spiral'
    s = 0.05
    spiral_gnuplot(header, n, x, y, u, v, s)

    print ''
    print 'SPIRAL_GNUPLOT_TEST:'
    print '  Normal end of execution.'

    return
Exemplo n.º 9
0
def stokes1_gnuplot_test():

    #*****************************************************************************80
    #
    ## STOKES1_GNUPLOT_TEST generates a field on a regular grid and plots it.
    #
    #  Licensing:
    #
    #    This code is distributed under the GNU LGPL license.
    #
    #  Modified:
    #
    #    25 January 2015
    #
    #  Author:
    #
    #    John Burkardt
    #
    from grid_2d import grid_2d
    from uvp_stokes1 import uvp_stokes1

    print ''
    print 'STOKES1_GNUPLOT_TEST:'
    print '  Exact solution #1.'
    print '  Generate a Stokes velocity field on a regular grid.'
    print '  Store in GNUPLOT data and command files.'

    x_lo = 0.0
    x_hi = 1.0
    x_num = 21

    y_lo = 0.0
    y_hi = 1.0
    y_num = 21

    [x, y] = grid_2d(x_num, x_lo, x_hi, y_num, y_lo, y_hi)

    n = x_num * y_num

    [u, v, p] = uvp_stokes1(n, x, y)

    header = 'stokes1'
    s = 4.0
    stokes_gnuplot(header, n, x, y, u, v, s)

    print ''
    print 'STOKES1_GNUPLOT_TEST:'
    print '  Normal end of execution.'

    return
Exemplo n.º 10
0
def stokes1_matplotlib_test():

    #*****************************************************************************80
    #
    ## STOKES1_MATPLOTLIB_TEST generates a field on a regular grid and plots it.
    #
    #  Licensing:
    #
    #    This code is distributed under the GNU LGPL license.
    #
    #  Modified:
    #
    #    25 January 2015
    #
    #  Author:
    #
    #    John Burkardt
    #
    from grid_2d import grid_2d
    from uvp_stokes1 import uvp_stokes1

    print ''
    print 'STOKES1_MATPLOTLIB_TEST:'
    print '  Exact flow #1.'
    print '  Generate a Stokes velocity field on a regular grid.'
    print '  Display it using MATPLOTLIB'

    x_lo = 0.0
    x_hi = 1.0
    x_num = 21

    y_lo = 0.0
    y_hi = 1.0
    y_num = 21

    [x, y] = grid_2d(x_num, x_lo, x_hi, y_num, y_lo, y_hi)

    n = x_num * y_num

    [u, v, p] = uvp_stokes1(n, x, y)

    header = 'stokes1'
    s = 4.0
    stokes_matplotlib(header, n, x, y, u, v, s)

    print ''
    print 'STOKES1_MATPLOTLIB_TEST:'
    print '  Normal end of execution.'

    return
Exemplo n.º 11
0
def stokes1_gnuplot_test ( ):

#*****************************************************************************80
#
## STOKES1_GNUPLOT_TEST generates a field on a regular grid and plots it.
#
#  Licensing:
#
#    This code is distributed under the GNU LGPL license.
#
#  Modified:
#
#    25 January 2015
#
#  Author:
#
#    John Burkardt
#
  from grid_2d import grid_2d
  from uvp_stokes1 import uvp_stokes1

  print ''
  print 'STOKES1_GNUPLOT_TEST:'
  print '  Exact solution #1.'
  print '  Generate a Stokes velocity field on a regular grid.'
  print '  Store in GNUPLOT data and command files.'

  x_lo = 0.0
  x_hi = 1.0
  x_num = 21

  y_lo = 0.0
  y_hi = 1.0
  y_num = 21

  [ x, y ] = grid_2d ( x_num, x_lo, x_hi, y_num, y_lo, y_hi )

  n = x_num * y_num
 
  [ u, v, p ] = uvp_stokes1 ( n, x, y )

  header = 'stokes1'
  s = 4.0
  stokes_gnuplot ( header, n, x, y, u, v, s )

  print ''
  print 'STOKES1_GNUPLOT_TEST:'
  print '  Normal end of execution.'

  return
Exemplo n.º 12
0
def stokes1_matplotlib_test ( ):

#*****************************************************************************80
#
## STOKES1_MATPLOTLIB_TEST generates a field on a regular grid and plots it.
#
#  Licensing:
#
#    This code is distributed under the GNU LGPL license.
#
#  Modified:
#
#    25 January 2015
#
#  Author:
#
#    John Burkardt
#
  from grid_2d import grid_2d
  from uvp_stokes1 import uvp_stokes1

  print ''
  print 'STOKES1_MATPLOTLIB_TEST:'
  print '  Exact flow #1.'
  print '  Generate a Stokes velocity field on a regular grid.'
  print '  Display it using MATPLOTLIB'

  x_lo = 0.0
  x_hi = 1.0
  x_num = 21

  y_lo = 0.0
  y_hi = 1.0
  y_num = 21

  [ x, y ] = grid_2d ( x_num, x_lo, x_hi, y_num, y_lo, y_hi )

  n = x_num * y_num
 
  [ u, v, p ] = uvp_stokes1 ( n, x, y )

  header = 'stokes1'
  s = 4.0
  stokes_matplotlib ( header, n, x, y, u, v, s )

  print ''
  print 'STOKES1_MATPLOTLIB_TEST:'
  print '  Normal end of execution.'

  return