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) archive(Swim.Body.AF.z_mid) graph.plot_n_go(Swimmers, i, P) DIO.write_data(P, i, DEL_T, SwiL, GeoL, MotL, Swimmers) else: if np.fmod(i, VERBOSITY) == 0: po().timestep_header(i,T[i]) 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) wake_rollup(Swimmers, DEL_T, i, P) for Swim in Swimmers: Swim.Body.force(P, 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) solve_phi(Swimmers, RHO, DEL_T, i, outerCorr) wake_rollup(Swimmers, DEL_T, i) archive(Swimmers[0].Body.AF.x_mid) archive(Swimmers[0].Body.AF.z_mid) SolidP[0].nodes[:, 0] = (SolidP[0].nodesNew[:, 0] - SolidP[0].nodesNew[0, 0]) * np.cos(P['THETA'][i]) SolidP[0].nodes[:, 1] = (SolidP[0].nodesNew[:, 0] - SolidP[0].nodesNew[0, 0]) * np.sin(P['THETA'][i]) graph.plot_n_go(Swimmers[0].Edge, Swimmers[0].Body, SolidP[0], P['V0'], P['T'][i], P['HEAVE'][i]) DIO.write_data(P, i, DEL_T, SwiP, GeoP, MotP, Swimmers, SolidP, FSIP, PyFEAP) else: if np.fmod(i, P['VERBOSITY']) == 0: po().timestep_header(i, T[i]) po().fsi_header() FSIP[0].readFsiControls(P['FIXED_PT_RELAX'], P['N_OUTERCORR_MAX']) FSIP[0].__init__(Swimmers[0].Body, SolidP[0]) outerCorr = 0 while True: outerCorr += 1 FSIP[0].setInterfaceDisplacemet(outerCorr, P['COUPLING_SCHEME']) for Swim in Swimmers:
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) SolidP[0].nodes[:,0] = (SolidP[0].nodesNew[:,0] - SolidP[0].nodesNew[0,0])*np.cos(P['THETA'][i]) SolidP[0].nodes[:,1] = (SolidP[0].nodesNew[:,0] - SolidP[0].nodesNew[0,0])*np.sin(P['THETA'][i]) graph.plot_n_go(Swimmers, P['V0'], P['T'][i], P['HEAVE'][i], i, P['SW_PLOT_FIG']) DIO.write_data(P, i, DEL_T, SwiP, GeoP, MotP, Swimmers, SolidP, FSIP, PyFEAP) else: if np.fmod(i,P['VERBOSITY']) == 0: po().timestep_header(i,T[i]) po().fsi_header() FSIP[0].readFsiControls(P['FIXED_PT_RELAX'], P['N_OUTERCORR_MAX']) FSIP[0].__init__(Swimmers[0].Body, SolidP[0]) outerCorr = 0 while True: outerCorr += 1 FSIP[0].setInterfaceDisplacemet(outerCorr, P['COUPLING_SCHEME']) for Swim in Swimmers: if (outerCorr == 1): Swim.Body.panel_positions(DSTEP, T[i], P['THETA'][i], P['HEAVE'][i])
if i == 0: for Swim in Swimmers: Swim.Body.free_swimming(P, i) 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) wake_rollup(Swimmers, DEL_T, i, P) archive(Swimmers[0].Body.AF.x_mid) archive(Swimmers[0].Body.AF.z_mid) SolidL[0].updateSolid(P['THETA'][i]) graph.plot_n_go(Swimmers, i, P) DIO.write_data(P, i, DEL_T, SwiL, GeoL, MotL, Swimmers, SolidL, FSIL, PyFEAL) else: if np.fmod(i, VERBOSITY) == 0: po().timestep_header(i, T[i]) po().fsi_header() FSIL[0].readFsiControls(P) FSIL[0].__init__(Swimmers[0].Body, SolidL[0]) outerCorr = 0 while True: outerCorr += 1 FSIL[0].setInterfaceDisplacemet(outerCorr, COUPLING_SCHEME) for Swim in Swimmers: if (outerCorr == 1):
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) solve_phi(Swimmers, RHO, DEL_T, i, outerCorr) wake_rollup(Swimmers, DEL_T, i) archive(Swimmers[0].Body.AF.x_mid) archive(Swimmers[0].Body.AF.z_mid) SolidP[0].nodes[:, 0] = (SolidP[0].nodesNew[:, 0] - SolidP[0].nodesNew[0, 0]) * np.cos(P["THETA"][i]) SolidP[0].nodes[:, 1] = (SolidP[0].nodesNew[:, 0] - SolidP[0].nodesNew[0, 0]) * np.sin(P["THETA"][i]) graph.plot_n_go(Swimmers[0].Edge, Swimmers[0].Body, SolidP[0], P["V0"], P["T"][i], P["HEAVE"][i]) DIO.write_data(P, i, DEL_T, SwiP, GeoP, MotP, Swimmers, SolidP, FSIP, PyFEAP) else: if np.fmod(i, P["VERBOSITY"]) == 0: po().timestep_header(i, T[i]) po().fsi_header() FSIP[0].readFsiControls(P["FIXED_PT_RELAX"], P["N_OUTERCORR_MAX"]) FSIP[0].__init__(Swimmers[0].Body, SolidP[0]) outerCorr = 0 while True: outerCorr += 1 FSIP[0].setInterfaceDisplacemet(outerCorr, P["COUPLING_SCHEME"]) for Swim in Swimmers: if outerCorr == 1:
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) for Swim in Swimmers: archive(Swim.Body.AF.x_mid) archive(Swim.Body.AF.z_mid) graph.plot_n_go(Swimmers, P['V0'], P['T'][i], P['HEAVE'][i], i, P['SW_PLOT_FIG']) DIO.write_data(P, i, DEL_T, SwiP, GeoP, MotP, Swimmers) 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], 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)