Exemplo n.º 1
0
sphere_cg = ((0, 0, -2.0), )  # center of gravity
sphere_name = ('sphere_cpt', )  # body name

sphere_w = np.linspace(0.02, 8.4, 3)  # wave frequencies. 420 for full run
sphere_headings = np.linspace(0, 0, 1)  # wave heading
sphere_depth = 50.0  # water depth

sphere_ncFile = os.getcwd(
) + os.path.sep + 'test.nc'  # path for output .nc file
# ----------------------------------------------------------------------------#

# check that old output is not being overwritten (runs take awhile)
if os.path.isfile(sphere_ncFile):
    print(
        f'Output ({sphere_ncFile}) file already exists and will be overwritten. '
        'Do you wish to proceed? (y/n)')
    ans = input()
    if ans.lower() != 'y':
        print('\nEnding simulation. file not overwritten')
        sys.exit(0)

# Run Capytaine
cd, p = cc.call_capy(meshFName=sphere_file,
                     wCapy=sphere_w,
                     CoG=sphere_cg,
                     headings=sphere_headings,
                     ncFName=sphere_ncFile,
                     body_name=sphere_name,
                     depth=sphere_depth,
                     density=1000.0)
Exemplo n.º 2
0
            )  # mesh files, .dat nemoh, .gdf wamit
rm3_cg = ((0, 0, -0.72), (0, 0, -21.29))  # centers of gravity
rm3_name = ('rm3_float', 'rm3_spar')  # body names

rm3_w = np.linspace(0.02, 5.2, 3)  # wave frequencies. 260 for full run
rm3_headings = np.linspace(0, 0, 1)  # wave headings
rm3_depth = np.infty  # water depth

rm3_ncFile = os.getcwd() + os.path.sep + 'test.nc'  # path for output .nc file
# ----------------------------------------------------------------------------#

# check that old output is not being overwritten (runs take awhile)
if os.path.isfile(rm3_ncFile):
    print(
        f'Output ({rm3_ncFile}) file already exists and will be overwritten. '
        'Do you wish to proceed? (y/n)')
    ans = input()
    if ans.lower() != 'y':
        print('\nEnding simulation. file not overwritten')
        sys.exit(0)

# Run Capytaine
cd, p = cc.call_capy(meshFName=rm3_file,
                     wCapy=rm3_w,
                     CoG=rm3_cg,
                     headings=rm3_headings,
                     ncFName=rm3_ncFile,
                     body_name=rm3_name,
                     depth=rm3_depth,
                     density=1000.0)
Exemplo n.º 3
0
            )  # mesh file, .dat nemoh, .gdf wamit
bem_cg = ((0, 0, -2.0), )  # center of gravity
bem_name = ('sphere_cpt', )  # body name

bem_w = np.linspace(0.02, 8.4, 3)  # wave frequencies. 420 for full run
bem_headings = np.linspace(0, 0, 1)  # wave heading
bem_depth = 50.0  # water depth

bem_ncFile = os.getcwd() + os.path.sep + 'test.nc'  # path for output .nc file
# ----------------------------------------------------------------------------#

# check that old output is not being overwritten (runs take awhile)
if os.path.isfile(bem_ncFile):
    print(
        f'Output ({bem_ncFile}) file already exists and will be overwritten. '
        'Do you wish to proceed? (y/n)')
    ans = input()
    if ans.lower() != 'y':
        print('\nEnding simulation. file not overwritten')
        sys.exit(0)

# Run Capytaine
cc.call_capy(meshFName=bem_file,
             wCapy=bem_w,
             CoG=bem_cg,
             headings=bem_headings,
             ncFName=bem_ncFile,
             body_name=bem_name,
             depth=bem_depth,
             density=1000.0)
Exemplo n.º 4
0
cubes_cg = ((0, 0, -2.5), (100, 0, -2.5))  # centers of gravity
cubes_name = ('r_cube_capytaine', 't_cube_capytaine')  # body names

cubes_w = np.linspace(0.03, 15.0, 3)  # wave frequencies. 500 for full run
cubes_headings = np.linspace(0, 90, 10)  # wave headings
cubes_depth = 20.0  # water depth

cubes_ncFile = os.getcwd(
) + os.path.sep + 'test.nc'  # path for output .nc file
# ----------------------------------------------------------------------------#

# check that old output is not being overwritten (runs take awhile)
if os.path.isfile(cubes_ncFile):
    print(
        f'Output ({cubes_ncFile}) file already exists and will be overwritten. '
        'Do you wish to proceed? (y/n)')
    ans = input()
    if ans.lower() != 'y':
        print('\nEnding simulation. file not overwritten')
        sys.exit(0)

# Run Capytaine
cd = cc.call_capy(meshFName=cubes_file,
                  wCapy=cubes_w,
                  CoG=cubes_cg,
                  headings=cubes_headings,
                  ncFName=cubes_ncFile,
                  body_name=cubes_name,
                  depth=cubes_depth,
                  density=1000.0)
Exemplo n.º 5
0
cylinder_cg = ((0, 0, 0), )  # center of gravity
cylinder_name = ('cylinder_cpt', )  # body name

cylinder_w = np.linspace(0.04, 21.0, 3)  # wave frequencies. 525 for full run
cylinder_headings = np.linspace(0, 0, 1)  # wave heading
cylinder_depth = 3.0  # water depth

cylinder_ncFile = os.getcwd(
) + os.path.sep + 'test.nc'  # path for output .nc file
# ----------------------------------------------------------------------------#

# check that old output is not being overwritten (runs take awhile)
if os.path.isfile(cylinder_ncFile):
    print(
        f'Output ({cylinder_ncFile}) file already exists and will be overwritten. '
        'Do you wish to proceed? (y/n)')
    ans = input()
    if ans.lower() != 'y':
        print('\nEnding simulation. file not overwritten')
        sys.exit(0)

# Run Capytaine
cc.call_capy(meshFName=cylinder_file,
             wCapy=cylinder_w,
             CoG=cylinder_cg,
             headings=cylinder_headings,
             ncFName=cylinder_ncFile,
             body_name=cylinder_name,
             depth=cylinder_depth,
             density=1000.0)
Exemplo n.º 6
0
ellipsoid_cg = ((0, 0, 0), )  # center of gravity
ellipsoid_name = ('ellipsoid_cpt', )  # body name

ellipsoid_w = np.linspace(0.03, 9.24, 3)  # wave frequencies. 308 for full run
ellipsoid_headings = np.linspace(0, 0, 1)  # wave heading
ellipsoid_depth = np.infty  # water depth

ellipsoid_ncFile = os.getcwd(
) + os.path.sep + 'test.nc'  # path for output .nc file
# ----------------------------------------------------------------------------#

# check that old output is not being overwritten (runs take awhile)
if os.path.isfile(ellipsoid_ncFile):
    print(
        f'Output ({ellipsoid_ncFile}) file already exists and will be overwritten. '
        'Do you wish to proceed? (y/n)')
    ans = input()
    if ans.lower() != 'y':
        print('\nEnding simulation. file not overwritten')
        sys.exit(0)

# Run Capytaine
cc.call_capy(meshFName=ellipsoid_file,
             wCapy=ellipsoid_w,
             CoG=ellipsoid_cg,
             headings=ellipsoid_headings,
             ncFName=ellipsoid_ncFile,
             body_name=ellipsoid_name,
             depth=ellipsoid_depth,
             density=1000.0)
Exemplo n.º 7
0
coercomp_cg = ((0, 0, -0.2), )  # center of gravity
coercomp_name = ('coercomp_cpt', )  # body name

coercomp_w = np.linspace(0.1, 80, 3)  # wave frequencies. 800 for full run
coercomp_headings = np.linspace(0, 90, 10)  # wave headings
coercomp_depth = 2.20  # water depth

coercomp_ncFile = os.getcwd(
) + os.path.sep + 'test.nc'  # path for output .nc file
# ----------------------------------------------------------------------------#

# check that old output is not being overwritten (runs take awhile)
if os.path.isfile(coercomp_ncFile):
    print(
        f'Output ({coercomp_ncFile}) file already exists and will be overwritten. '
        'Do you wish to proceed? (y/n)')
    ans = input()
    if ans.lower() != 'y':
        print('\nEnding simulation. file not overwritten')
        sys.exit(0)

# Run Capytaine
cc.call_capy(meshFName=coercomp_file,
             wCapy=coercomp_w,
             CoG=coercomp_cg,
             headings=coercomp_headings,
             ncFName=coercomp_ncFile,
             body_name=coercomp_name,
             depth=coercomp_depth,
             density=1000.0)
Exemplo n.º 8
0
oswec_cg = ((0, 0, -3.90), (0, 0, -10.90))  # centers of gravity
oswec_name = ('oswec_flap', 'oswec_base')  # body names

oswec_w = np.linspace(0.04, 20.0, 3)  # wave frequencies. 500 for full run
oswec_headings = np.linspace(0, 90, 10)  # wave headings
oswec_depth = 10.90  # water depth

oswec_ncFile = os.getcwd(
) + os.path.sep + 'test.nc'  # path for output .nc file
# ----------------------------------------------------------------------------#

# check that old output is not being overwritten (runs take awhile)
if os.path.isfile(oswec_ncFile):
    print(
        f'Output ({oswec_ncFile}) file already exists and will be overwritten. '
        'Do you wish to proceed? (y/n)')
    ans = input()
    if ans.lower() != 'y':
        print('\nEnding simulation. file not overwritten')
        sys.exit(0)

# Run Capytaine
cc.call_capy(meshFName=oswec_file,
             wCapy=oswec_w,
             CoG=oswec_cg,
             headings=oswec_headings,
             ncFName=oswec_ncFile,
             body_name=oswec_name,
             depth=oswec_depth,
             density=1000.0)