From 7c0f4739b82a7f00716ab09f06772478f376b640 Mon Sep 17 00:00:00 2001 From: Lucas Carmo Date: Mon, 15 Apr 2024 14:44:37 -0600 Subject: [PATCH] I had forgotten to remove an output that I am using locally I am going to leave it commented in case we want this output in the future --- raft/raft_model.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/raft/raft_model.py b/raft/raft_model.py index 875cef1..3705e41 100644 --- a/raft/raft_model.py +++ b/raft/raft_model.py @@ -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 @@ -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. @@ -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):