Ejemplo n.º 1
0
#po().prog_title('1.0.0')
DIO = DataIO(P)
start_time = time.time()

# Defining local variables to minimize dictionary lookups
DEL_T     = P['DEL_T']
DSTEP     = P['DSTEP']
TSTEP     = P['TSTEP']
T         = P['T']
RHO       = P['RHO']
RE        = P['RE']
VERBOSITY = P['VERBOSITY']

(START_COUNTER, COUNTER, SwiL, GeoL, MotL, Swimmers) = simulation_startup(P, DIO, PC, Swimmer)[0:6]

po().calc_input(MotL[0].THETA_MAX/np.pi*180.,RE,MotL[0].THETA_MAX/np.pi*180.,DEL_T)
po().initialize_output(T[START_COUNTER])
outerCorr = 1

for i in xrange(START_COUNTER, COUNTER):
    if i == 0:
        for Swim in Swimmers:
                Swim.Body.panel_positions(P, i)
                Swim.Body.surface_kinematics(P, i)
                Swim.edge_shed(DEL_T, i)
                Swim.wake_shed(DEL_T, i)
        solve_phi(Swimmers, P, i, outerCorr)
        for Swim in Swimmers:
            Swim.Body.force(P, i)
            Swim.Body.free_swimming(P, i)
            archive(Swim.Body.AF.x_mid)
Ejemplo n.º 2
0
np.seterr(all='raise')

DIO = DataIO(P)
start_time = time.time()

DEL_T = P['DEL_T']
DSTEP = P['DSTEP']
TSTEP = P['TSTEP']
T = P['T']
RHO = P['RHO']
RE = P['RE']

(START_COUNTER, COUNTER, SwiP, GeoP, MotP, Swimmers, SolidP, FSIP,
 PyFEAP) = simulation_startup(P, DIO, PC, Swimmer, solid, FSI, PyFEA)

po().calc_input(MotP[0].THETA_MAX / np.pi * 180., RE,
                MotP[0].THETA_MAX / np.pi * 180., DEL_T)
po().initialize_output((START_COUNTER - 1) * DEL_T)
outerCorr = 2

for i in xrange(START_COUNTER, COUNTER):
    if i == 0:
        for Swim in Swimmers:
            Swim.Body.panel_positions(DSTEP, T[i], P['THETA'][i],
                                      P['HEAVE'][i])
            Swim.Body.surface_kinematics(DSTEP, TSTEP, P['THETA_MINUS'][i],
                                         P['THETA_PLUS'][i],
                                         P['HEAVE_MINUS'][i],
                                         P['HEAVE_PLUS'][i], DEL_T, T[i], i)
            Swim.edge_shed(DEL_T, i)
            Swim.wake_shed(DEL_T, i)
            Swim.Body.force(P['THETA'][i], RHO, P['V0'], P['C'], 1.0, i)
Ejemplo n.º 3
0
def main():

    po().prog_title('1.0.0')
    start_time = time.time()

    COUNTER = P['COUNTER']
    DEL_T = P['DEL_T']
    DSTEP = P['DSTEP']
    TSTEP = P['TSTEP']
    T = [DEL_T*i for i in xrange(COUNTER)]
    RHO = P['RHO']
    RE = P['RE']

    SwiP = PC.SwimmerParameters(P['CE'], P['DELTA_CORE'], P['SW_KUTTA'])
    GeoP = PC.GeoVDVParameters(P['N_BODY'], P['S'], P['C'], P['K'], P['EPSILON'])
    MotP1 = PC.MotionParameters(0., 0., P['V0'], P['THETA_MAX'], P['F'], P['PHI'])

    S1 = Swimmer(SwiP, GeoP, MotP1, COUNTER)
    Swimmers = [S1]

    po().calc_input(MotP1.THETA_MAX/np.pi*180.,RE,MotP1.THETA_MAX/np.pi*180.,DEL_T)

    # Data points per cycle == 1/(F*DEL_T)
    for i in xrange(COUNTER):
        if i == 0:
            po().initialize_output(T[i])
        else:
            if np.fmod(i,P['VERBOSITY']) == 0:
                po().timestep_header(i,T[i])

        for Swim in Swimmers:
                Swim.Body.panel_positions(DSTEP, T[i])
                Swim.Body.surface_kinematics(DSTEP, TSTEP, DEL_T, T[i], i)
                Swim.edge_shed(DEL_T, i)
                Swim.wake_shed(DEL_T, i)
        quilt(Swimmers, RHO, DEL_T, i)
        wake_rollup(Swimmers, DEL_T, i)
        archive(S1.Body.AF.x_mid)
        archive(S1.Body.AF.z_mid)

        if np.fmod(i,P['VERBOSITY']) == 0:
            po().solution_output(0,0,0,0,0,0)
            po().solution_complete_output(i/float(COUNTER-1)*100.)

    total_time = time.time()-start_time
    print "Simulation time:", np.round(total_time, 3), "seconds"

    graph.body_wake_plot(Swimmers)
Ejemplo n.º 4
0
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
BEM-3D
A 3D boundary element method code

"""
from input_parameters import PARAMETERS as P
from terminal_output import print_output as po

po().prog_title('1.0.090315a')

if (P['SW_FSI'] == True):
    # Run the Fluid Structure Interaction Solver with the BEM Solver
    execfile("FSI_bem3d.py")
else:
    # Run the Boundary Element Solver
    execfile("rigid_bem3d.py")
Ejemplo n.º 5
0
np.seterr(all='raise')

#po().prog_title('1.0.0')
DIO = DataIO(P)
start_time = time.time()

DEL_T = P['DEL_T']
DSTEP = P['DSTEP']
TSTEP = P['TSTEP']
T = P['T']
RHO = P['RHO']
RE = P['RE']

(START_COUNTER, COUNTER, SwiP, GeoP, MotP, Swimmers, SolidP, FSIP, PyFEAP) = simulation_startup(P, DIO, PC, Swimmer, solid, FSI, PyFEA)

po().calc_input(MotP[0].THETA_MAX/np.pi*180.,RE,MotP[0].THETA_MAX/np.pi*180.,DEL_T)
po().initialize_output(P['T'][START_COUNTER])
outerCorr = 2

for i in xrange(START_COUNTER, COUNTER):
    if i == 0:
        for Swim in Swimmers:
            Swim.Body.panel_positions(DSTEP, T[i], P['THETA'][i], P['HEAVE'][i])
            Swim.Body.surface_kinematics(DSTEP, TSTEP, P['THETA_MINUS'][i], P['THETA_PLUS'][i], P['HEAVE_MINUS'][i], P['HEAVE_PLUS'][i], DEL_T, T[i], i)
            Swim.edge_shed(DEL_T, i)
            Swim.wake_shed(DEL_T, i)
            Swim.Body.force(P['THETA'][i], RHO, P['V0'], P['C'], 1.0, i, P['SW_SV_FORCES'])
        solve_phi(Swimmers, RHO, DEL_T, i, outerCorr)
        wake_rollup(Swimmers, DEL_T, i, P)
        archive(Swimmers[0].Body.AF.x_mid)
        archive(Swimmers[0].Body.AF.z_mid)
Ejemplo n.º 6
0
DIO = DataIO(P)
start_time = time.time()

# Defining local variables to minimize dictionary lookups
DEL_T = P['DEL_T']
DSTEP = P['DSTEP']
TSTEP = P['TSTEP']
T = P['T']
RHO = P['RHO']
RE = P['RE']
VERBOSITY = P['VERBOSITY']

(START_COUNTER, COUNTER, SwiL, GeoL, MotL,
 Swimmers) = simulation_startup(P, DIO, PC, Swimmer)[0:6]

po().calc_input(MotL[0].THETA_MAX / np.pi * 180., RE,
                MotL[0].THETA_MAX / np.pi * 180., DEL_T)
po().initialize_output(T[START_COUNTER])
outerCorr = 1

for i in xrange(START_COUNTER, COUNTER):
    if i == 0:
        for Swim in Swimmers:
            Swim.Body.panel_positions(P, i)
            Swim.Body.surface_kinematics(P, i)
            Swim.edge_shed(DEL_T, i)
            Swim.wake_shed(DEL_T, i)
        solve_phi(Swimmers, P, i, outerCorr)
        for Swim in Swimmers:
            Swim.Body.force(P, i)
            Swim.Body.free_swimming(P, i)
            archive(Swim.Body.AF.x_mid)
Ejemplo n.º 7
0
DIO = DataIO(P)
start_time = time.time()

DEL_T = P['DEL_T']
DSTEP1 = P['DSTEP']
DSTEP2 = P['DSTEP']
DSTEP3 = P['DSTEP']
TSTEP = P['TSTEP']
T = P['T']
RHO = P['RHO']
RE = P['RE']

(START_COUNTER, COUNTER, SwiP, GeoP, MotP, Swimmers) = simulation_startup(P, DIO, PC, Swimmer)[0:6]

po().calc_input(MotP[0].THETA_MAX/np.pi*180.,RE,MotP[0].THETA_MAX/np.pi*180.,DEL_T)
po().initialize_output(P['T'][START_COUNTER])

outerCorr = 1
for i in xrange(START_COUNTER, COUNTER):
    if i == 0:
        for Swim in Swimmers:

                Swim.Body.panel_positions(DSTEP1, DSTEP2, DSTEP3, T[i], P['THETA'][i], P['HEAVE'][i])
                Swim.Body.surface_kinematics(DSTEP1, DSTEP2, DSTEP3, TSTEP, P['THETA_MINUS'][i], P['THETA_PLUS'][i], P['HEAVE_MINUS'][i], P['HEAVE_PLUS'][i], DEL_T, T[i], i)
                Swim.edge_shed(DEL_T, i)
                Swim.wake_shed(DEL_T, i)
#                Swim.Body.force(P['THETA'][i], RHO, P['V0'], P['C'], 1.0, i, P['SW_SV_FORCES'])
#        solve_phi(Swimmers, RHO, DEL_T, i, outerCorr)
        for Swim in Swimmers:
            archive(Swim.Body.AF.x_mid)
Ejemplo n.º 8
0
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
BEM-2D
A 2D boundary element method code

"""
from input_parameters import PARAMETERS as P
from terminal_output import print_output as po

po().prog_title('1.0.02242016a')

if P['SW_FSI']:
    if P['SW_SPRING']:
        # Run the FSI solver with leading edge spring model
        execfile("spring_bem2d.py")
    else:
        # Run the Fluid Structure Interaction Solver with the BEM Solver
        execfile("FSI_bem2d.py")
else:
    # Run the Boundary Element Solver
    execfile("rigid_bem2d.py")