Skip to content
Snippets Groups Projects
Commit 3c76437e authored by mads's avatar mads
Browse files

includes hydro dll input to input files

parent ffbb2770
No related branches found
No related tags found
2 merge requests!6Clustertools,!5Clustertools
...@@ -131,6 +131,7 @@ class HTCFile(HTCContents, HTCDefaults): ...@@ -131,6 +131,7 @@ class HTCFile(HTCContents, HTCDefaults):
if 'hydro' in self: if 'hydro' in self:
if 'water_properties' in self.hydro: if 'water_properties' in self.hydro:
files.append(self.hydro.water_properties.get('water_kinematics_dll', [None])[0]) files.append(self.hydro.water_properties.get('water_kinematics_dll', [None])[0])
files.append(self.hydro.water_properties.get('water_kinematics_dll', [None, None])[1])
if 'soil' in self: if 'soil' in self:
if 'soil_element' in self.soil: if 'soil_element' in self.soil:
files.append(self.soil.soil_element.get('datafile', [None])[0]) files.append(self.soil.soil_element.get('datafile', [None])[0])
...@@ -168,7 +169,12 @@ class HTCFile(HTCContents, HTCDefaults): ...@@ -168,7 +169,12 @@ class HTCFile(HTCContents, HTCDefaults):
return [f for f in files if f] return [f for f in files if f]
def turbulence_files(self): def turbulence_files(self):
files = [self.get('wind.%s.filename_%s' % (type, comp), [None])[0] for type in ['mann', 'flex'] for comp in ['u', 'v', 'w']] if self.wind.turb_format[0] == 0:
return []
elif self.wind.turb_format[0] == 1:
files = [self.get('wind.mann.filename_%s' % comp, [None])[0] for comp in ['u', 'v', 'w']]
elif self.wind.turb_format[0] == 2:
files = [self.get('wind.flex.filename_%s' % comp, [None])[0] for comp in ['u', 'v', 'w']]
return [f for f in files if f] return [f for f in files if f]
...@@ -195,7 +201,6 @@ class HTCFile(HTCContents, HTCDefaults): ...@@ -195,7 +201,6 @@ class HTCFile(HTCContents, HTCDefaults):
raise Exception (str(stdout) + str(stderr)) raise Exception (str(stdout) + str(stderr))
if "__main__" == __name__: if "__main__" == __name__:
f = HTCFile(r"C:\mmpe\HAWC2\Hawc2_model\htc\NREL_5MW_reference_wind_turbine_launcher_test.htc") f = HTCFile(r"C:\mmpe\HAWC2\models\PhaseIJacketv30\htc", "../../")
print ("\n".join(f.output_files()))
...@@ -286,7 +286,7 @@ begin wind ; ...@@ -286,7 +286,7 @@ begin wind ;
windfield_rotations 0.0 0.0 0.0 ; yaw, tilt, rotation windfield_rotations 0.0 0.0 0.0 ; yaw, tilt, rotation
center_pos0 0.0 0.0 -90 ; hub heigth center_pos0 0.0 0.0 -90 ; hub heigth
shear_format 3 0.2 ; shear_format 3 0.2 ;
turb_format 0.0 ; 0=none, 1=mann,2=flex turb_format 1 ; 0=none, 1=mann,2=flex
tower_shadow_method 3 ; 0=none, 1=potential flow, 2=jet tower_shadow_method 3 ; 0=none, 1=potential flow, 2=jet
scale_time_start 100.0 ; scale_time_start 100.0 ;
wind_ramp_factor 0.0 100.0 0.8 1.0 ; wind_ramp_factor 0.0 100.0 0.8 1.0 ;
......
...@@ -200,6 +200,12 @@ class TestHtcFile(unittest.TestCase): ...@@ -200,6 +200,12 @@ class TestHtcFile(unittest.TestCase):
raise ValueError(f + " is not in list") raise ValueError(f + " is not in list")
self.assertFalse(input_files) self.assertFalse(input_files)
def test_input_files2(self):
htcfile = HTCFile(self.testfilepath + "ansi.htc")
input_files = htcfile.input_files()
self.assertTrue('./htc_hydro/ireg_airy_h6_t10.inp' in input_files)
#
def test_continue_in_files(self): def test_continue_in_files(self):
htcfile = HTCFile(self.testfilepath + "continue_in_file.htc", ".") htcfile = HTCFile(self.testfilepath + "continue_in_file.htc", ".")
self.assertIn('main_body__31', htcfile.new_htc_structure.keys()) self.assertIn('main_body__31', htcfile.new_htc_structure.keys())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment