Skip to content

Commit

Permalink
I had forgotten to remove an output that I am using locally
Browse files Browse the repository at this point in the history
I am going to leave it commented in case we want this output in the future
  • Loading branch information
lucas-carmo committed Apr 15, 2024
1 parent 9d4ef86 commit 7c0f473
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions raft/raft_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ def analyzeCases(self, display=0, meshDir=os.path.join(os.getcwd(),'BEM'), RAO_p

# form dictionary of case parameters
case = dict(zip( self.design['cases']['keys'], self.design['cases']['data'][iCase]))
case['iCase'] = iCase # We use iCase to name the output files

if np.isscalar(case['wave_heading']): # deal with the typical case of just one set of waves specified
nWaves = 1
Expand All @@ -315,8 +316,7 @@ def analyzeCases(self, display=0, meshDir=os.path.join(os.getcwd(),'BEM'), RAO_p

# >>> add a flag that stores what case has had solveStatics to ensure consistency <<<

# solve system dynamics
case['iCase'] = iCase # We use iCase in solveDynamics to name the output files
# solve system dynamics
self.solveDynamics(case, RAO_plot=RAO_plot)

# Solve system operating point / mean offsets again, but now including mean wave forces.
Expand Down Expand Up @@ -1406,11 +1406,11 @@ def saveResponses(self, outPath):
file.write(f'{np.squeeze(metrics[metric][iFreq]):.5f} \t')
file.write('\n')

# Save mean offsets
with open(f'{outPath}_Case{iCase+1}_WT{i}_meanOffsets.txt', 'w') as file:
file.write('Surge [m] \t Sway [m] \t Heave [m] \t Pitch [deg] \t Roll [deg] \t Yaw [deg] \n')
mean_offsets = self.results['mean_offsets'][iCase]
file.write(f'{mean_offsets[0]:.5f} \t {mean_offsets[1]:.5f} \t {mean_offsets[2]:.5f} \t {mean_offsets[3]:.5f} \t {mean_offsets[4]:.5f} \t {mean_offsets[5]:.5f} \n')
# if self.results['mean_offsets']:
# with open(f'{outPath}_Case{iCase+1}_WT{i}_meanOffsets.txt', 'w') as file:
# file.write('Surge [m] \t Sway [m] \t Heave [m] \t Pitch [deg] \t Roll [deg] \t Yaw [deg] \n')
# mean_offsets = self.results['mean_offsets'][iCase]
# file.write(f'{mean_offsets[0]:.5f} \t {mean_offsets[1]:.5f} \t {mean_offsets[2]:.5f} \t {mean_offsets[3]:.5f} \t {mean_offsets[4]:.5f} \t {mean_offsets[5]:.5f} \n')


def plotResponses_extended(self):
Expand Down

0 comments on commit 7c0f473

Please sign in to comment.