Skip to content
Snippets Groups Projects
Commit 65482cdc authored by David Verelst's avatar David Verelst
Browse files

Merge branch 'master' of gitlab.windenergy.dtu.dk:toolbox/WindEnergyToolbox

parents a76b2eee 98881519
No related branches found
No related tags found
No related merge requests found
Pipeline #
Showing
with 1123 additions and 36 deletions
......@@ -40,10 +40,14 @@ class HTCFile(HTCContents, HTCDefaults):
initial_comments = None
_contents = None
def __init__(self, filename=None, modelpath="../"):
self.modelpath = modelpath
if filename is not None:
self.modelpath = os.path.realpath(os.path.join(os.path.dirname(filename), modelpath))
self.filename = filename
else:
self.modelpath = modelpath
self.filename = filename
#assert 'simulation' in self.contents, "%s could not be loaded. 'simulation' section missing" % filename
......@@ -53,10 +57,8 @@ class HTCFile(HTCContents, HTCDefaults):
self.htc_inputfiles = []
self.contents = OrderedDict()
if self.filename is None:
self.filename = 'empty.htc'
lines = self.empty_htc.split("\n")
else:
self.modelpath = os.path.realpath(os.path.join(os.path.dirname(self.filename), self.modelpath))
lines = self.readlines(self.filename)
lines = [l.strip() for l in lines]
......
'''
Created on 01/08/2016
@author: MMPE
'''
from wetb.hawc2.pc_file import PCFile
from wetb.hawc2.ae_file import AEFile
from wetb.hawc2.htc_file import HTCFile
import os
import numpy as np
from wetb.hawc2.st_file import StFile
class MainBody():
def __init__(self, htc_filename, modelpath, body_name):
self.htcfile = htcfile = HTCFile(htc_filename, modelpath)
s = htcfile.new_htc_structure
main_bodies = {s[k].name[0]:s[k] for k in s.keys() if s[k].name_ == "main_body"}
self.main_body = main_bodies[body_name]
self.stFile = StFile(os.path.join(htcfile.modelpath, self.main_body.timoschenko_input.filename[0]))
self.c2def = np.array([v.values[1:5] for v in self.main_body.c2_def if v.name_ == "sec"])
self.concentrated_mass = [cm.values for cm in self.main_body if cm.name_.startswith('concentrated_mass')]
def plot_xz_geometry(self, plt=None):
if plt is None:
import matplotlib.pyplot as plt
plt.figure()
plt.xlabel("z")
plt.ylabel("x")
z = np.linspace(self.c2def[0, 2], self.c2def[-1, 2], 100)
plt.plot(self.c2def[:, 2], self.c2def[:, 0],'.-', label='Center line')
plt.plot(z, np.interp(z, self.c2def[:, 2], self.c2def[:, 0]) + self.stFile.x_e(z), label='Elastic center')
plt.plot(z, np.interp(z, self.c2def[:, 2], self.c2def[:, 0]) + self.stFile.x_cg(z), label='Mass center')
plt.plot(z, np.interp(z, self.c2def[:, 2], self.c2def[:, 0]) + self.stFile.x_sh(z), label='Shear center')
for cm in self.concentrated_mass:
plt.plot(self.c2def[cm[0]-1,2]+cm[3],self.c2def[cm[0]-1,0]+cm[1],'x', label='Concentrated mass')
plt.legend()
def plot_yz_geometry(self, plt=None):
if plt is None:
import matplotlib.pyplot as plt
plt.figure()
plt.xlabel("z")
plt.ylabel("y")
z = np.linspace(self.c2def[0, 2], self.c2def[-1, 2], 100)
plt.plot(self.c2def[:, 2], self.c2def[:, 1], label='Center line')
plt.plot(z, np.interp(z, self.c2def[:, 2], self.c2def[:, 1]) + self.stFile.y_e(z), label='Elastic center')
plt.plot(z, np.interp(z, self.c2def[:, 2], self.c2def[:, 1]) + self.stFile.y_cg(z), label='Mass center')
plt.plot(z, np.interp(z, self.c2def[:, 2], self.c2def[:, 1]) + self.stFile.y_sh(z), label='Shear center')
for cm in self.concentrated_mass:
plt.plot(self.c2def[cm[0]-1,2]+cm[3],self.c2def[cm[0]-1,1]+cm[2],'x', label='Concentrated mass')
plt.legend()
class BladeData(object):
def plot_xz_geometry(self, plt):
z = np.linspace(self.c2def[0, 2], self.c2def[-1, 2], 100)
plt.plot(z, np.interp(z, self.c2def[:, 2], self.c2def[:, 0]), label='Center line')
plt.plot(z, np.interp(z, self.c2def[:, 2], self.c2def[:, 0]) + self.pcFile.chord(z) / 2, label='Leading edge')
plt.plot(z, np.interp(z, self.c2def[:, 2], self.c2def[:, 0]) - self.pcFile.chord(z) / 2, label="Trailing edge")
x, y, z = self.hawc2_splines()
#plt.plot(z, x, label='Hawc2spline')
def plot_yz_geometry(self, plt):
z = np.linspace(self.c2def[0, 2], self.c2def[-1, 2], 100)
plt.plot(z, np.interp(z, self.c2def[:, 2], self.c2def[:, 1]), label='Center line')
plt.plot(z, np.interp(z, self.c2def[:, 2], self.c2def[:, 1]) + self.pcFile.thickness(z) / 100 * self.pcFile.chord(z) / 2, label='Suction side')
plt.plot(z, np.interp(z, self.c2def[:, 2], self.c2def[:, 1]) - self.pcFile.thickness(z) / 100 * self.pcFile.chord(z) / 2, label="Pressure side")
x, y, z = self.hawc2_splines()
#plt.plot(z, y, label='Hawc2spline')
def hawc2_splines(self):
curve_z = np.r_[0, np.cumsum(np.sqrt(np.sum(np.diff(self.c2def[:, :3], 1, 0) ** 2, 1)))]
curve_z_nd = curve_z / curve_z[-1]
def akima(x, y):
n = len(x)
var = np.zeros((n + 3))
z = np.zeros((n))
co = np.zeros((n, 4))
for i in range(n - 1):
var[i + 2] = (y[i + 1] - y[i]) / (x[i + 1] - x[i])
var[n + 1] = 2 * var[n] - var[n - 1]
var[n + 2] = 2 * var[n + 1] - var[n]
var[1] = 2 * var[2] - var[3]
var[0] = 2 * var[1] - var[2]
for i in range(n):
wi1 = abs(var[i + 3] - var[i + 2])
wi = abs(var[i + 1] - var[i])
if (wi1 + wi) == 0:
z[i] = (var[i + 2] + var[i + 1]) / 2
else:
z[i] = (wi1 * var[i + 1] + wi * var[i + 2]) / (wi1 + wi)
for i in range(n - 1):
dx = x[i + 1] - x[i]
a = (z[i + 1] - z[i]) * dx
b = y[i + 1] - y[i] - z[i] * dx
co[i, 0] = y[i]
co[i, 1] = z[i]
co[i, 2] = (3 * var[i + 2] - 2 * z[i] - z[i + 1]) / dx
co[i, 3] = (z[i] + z[i + 1] - 2 * var[i + 2]) / dx ** 2
co[n - 1, 0] = y[n - 1]
co[n - 1, 1] = z[n - 1]
co[n - 1, 2] = 0
co[n - 1, 3] = 0
return co
def coef2spline(s, co):
x, y = [], []
for i, c in enumerate(co.tolist()[:-1]):
p = np.poly1d(c[::-1])
z = np.linspace(0, s[i + 1] - s[i ], 10)
x.extend(s[i] + z)
y.extend(p(z))
return y
x, y, z = [coef2spline(curve_z_nd, akima(curve_z_nd, self.c2def[:, i])) for i in range(3)]
return x, y, z
class Blade(MainBody, BladeData):
def __init__(self, htc_filename, modelpath, blade_number=1):
self.htcfile = htcfile = HTCFile(htc_filename, modelpath)
blade_name = [link[2] for link in htcfile.aero if link.name_.startswith('link') and link[0]==blade_number][0]
MainBody.__init__(self, htc_filename, modelpath, blade_name)
self.pcFile = PCFile(os.path.join(htcfile.modelpath, htcfile.aero.pc_filename[0]),
os.path.join(htcfile.modelpath, htcfile.aero.ae_filename[0]))
def plot_xz_geometry(self, plt=None):
if plt is None:
import matplotlib.pyplot as plt
plt.figure()
MainBody.plot_xz_geometry(self, plt)
BladeData.plot_xz_geometry(self, plt=plt)
plt.legend()
def plot_geometry_yz(self, plt=None):
if plt is None:
import matplotlib.pyplot as plt
plt.figure()
BladeData.plot_yz_geometry(self, plt=plt)
MainBody.plot_yz_geometry(self, plt)
......@@ -235,12 +235,18 @@ class Simulation(object):
return dst
output_patterns = [fmt(dst) for dst in self.htcFile.output_files() + ([], self.htcFile.turbulence_files())[self.copy_turbulence] + [self.stdout_filename]]
output_files = set([f for pattern in output_patterns for f in self.host.glob(unix_path(os.path.join(self.tmp_modelpath, pattern)))])
self.host._finish_simulation(output_files)
self.set_id(self.filename)
if self.status != ERROR:
self.status = CLEANED
self.logFile.reset()
self.htcFile.reset()
try:
self.host._finish_simulation(output_files)
if self.status != ERROR:
self.status = CLEANED
except Exception as e:
self.errors.append(str(e))
raise
finally:
self.set_id(self.filename)
self.logFile.reset()
self.htcFile.reset()
......@@ -418,20 +424,26 @@ class LocalSimulationHost(SimulationResource):
def _finish_simulation(self, output_files):
missing_result_files = []
for src_file in output_files:
dst_file = os.path.join(self.modelpath, os.path.relpath(src_file, self.tmp_modelpath))
# exist_ok does not exist in Python27
if not os.path.isdir(os.path.dirname(dst_file)):
os.makedirs(os.path.dirname(dst_file)) #, exist_ok=True)
if not os.path.isfile(dst_file) or os.path.getmtime(dst_file) != os.path.getmtime(src_file):
shutil.copy(src_file, dst_file)
try:
if not os.path.isdir(os.path.dirname(dst_file)):
os.makedirs(os.path.dirname(dst_file)) #, exist_ok=True)
if not os.path.isfile(dst_file) or os.path.getmtime(dst_file) != os.path.getmtime(src_file):
shutil.copy(src_file, dst_file)
except:
missing_result_files.append(dst_file)
self.logFile.filename = os.path.join(self.modelpath, self.log_filename)
if missing_result_files:
raise Warning("Failed to copy %s from %s"%(",".join(missing_result_files), self.host))
try:
shutil.rmtree(self.tmp_modelpath)
except (PermissionError, OSError) as e:
raise Warning(str(e))
raise Warning("Fail to remove temporary files and folders on %s\n%s"%(self.host, str(e)))
def update_logFile_status(self):
self.logFile.update_status()
......@@ -535,19 +547,24 @@ class PBSClusterSimulationHost(SimulationResource, SSHClient):
def _finish_simulation(self, output_files):
with self:
download_failed = []
for src_file in output_files:
try:
dst_file = os.path.join(self.modelpath, os.path.relpath(src_file, self.tmp_modelpath))
os.makedirs(os.path.dirname(dst_file), exist_ok=True)
self.download(src_file, dst_file, retry=3)
self.download(src_file, dst_file, retry=10)
except Exception as e:
print (self.modelpath, src_file, self.tmp_modelpath)
raise e
try:
self.execute('rm -r .hawc2launcher/%s' % self.simulation_id)
self.execute('rm .hawc2launcher/status_%s' % self.simulation_id)
except:
pass
download_failed.append(dst_file)
if download_failed:
raise Warning("Failed to download %s from %s"%(",".join(download_failed), self.host))
else:
try:
self.execute('rm -r .hawc2launcher/%s' % self.simulation_id)
finally:
try:
self.execute('rm .hawc2launcher/status_%s' % self.simulation_id)
except:
raise Warning("Fail to remove temporary files and folders on %s"%self.host)
def _simulate(self):
......@@ -668,6 +685,3 @@ cd /scratch/
### rm -r $PBS_JOBID
exit""" % (self.simulation_id, self.stdout_filename, self.modelpath, self.htcFile.filename, self.resource.python_cmd, rel_htcfilename, self.resource.wine_cmd, self.hawc2exe, cp_back)
......@@ -68,7 +68,7 @@ class StFile(object):
def __init__(self, filename):
with open (filename) as fid:
txt = fid.read()
no_maindata_sets = int(txt.strip()[0])
no_maindata_sets = int(txt.replace("#","").strip()[0])
assert no_maindata_sets == txt.count("#")
self.main_data_sets = {}
for mset in txt.split("#")[1:]:
......
This diff is collapsed.
#1 Hub Changed 5.11.2012 by MHHA: Mass per unit-length should not be too low
r m x_cg y_cg ri_x ri_y x_sh y_sh E G I_x I_y I_p k_x k_y A pitch x_e y_e
$1 2 hub. flexible
0 1.0 0 0 1.50E+00 1.50E+00 0 0 2.10E+11 8.08E+10 5.52E-00 5.52E-00 1.10E+00 0.5 0.5 2.98E-01 0 0 0
2.8 1.0 0 0 1.50E+00 1.50E+00 0 0 2.10E+11 8.08E+10 5.52E-00 5.52E-00 1.10E+00 0.5 0.5 2.98E-01 0 0 0
r m x_cg y_cg ri_x ri_y x_sh y_sh E G I_x I_y I_p k_x k_y A pitch x_e y_e
$2 2 hub. stiff
0 1.0 0 0 1.50E+00 1.50E+00 0 0 2.10E+16 8.08E+15 5.52E-00 5.52E-00 1.10E+00 0.5 0.5 2.98E-01 0 0 0
2.8 1.0 0 0 1.50E+00 1.50E+00 0 0 2.10E+16 8.08E+15 5.52E-00 5.52E-00 1.10E+00 0.5 0.5 2.98E-01 0 0 0
#1 Shaft
r m x_cg y_cg ri_x ri_y x_sh y_sh E G I_x I_y I_p k_x k_y A pitch x_e y_e
$1 2 shaft with hub mass on last element. flexible
0.0 1.00E+00 0 0 0.2 0.2 0 0 2.10E+11 8.08E+10 1.00E+00 1.00E+00 0.2036 0.5 0.5 10 0 0 0
7.1 1.00E+00 0 0 0.2 0.2 0 0 2.10E+11 8.08E+10 1.00E+00 1.00E+00 0.2036 0.5 0.5 10 0 0 0
r m x_cg y_cg ri_x ri_y x_sh y_sh E G I_x I_y I_p k_x k_y A pitch x_e y_e
$2 2 shaft with hub mass on last element. stiff
0.0 1.00E+00 0 0 0.2 0.2 0 0 2.10E+16 8.08E+17 1.00E+00 1.00E+00 0.2036 0.5 0.5 10 0 0 0
7.1 1.00E+00 0 0 0.2 0.2 0 0 2.10E+16 8.08E+17 1.00E+00 1.00E+00 0.2036 0.5 0.5 10 0 0 0
#1 Tower made by anyd 25.02.2013
r m x_cg y_cg ri_x ri_y x_sh y_sh E G I_x I_y I_p k_x k_y A pitch x_e y_e
$1 20
0.000 8.3837E+03 0.0000E+00 0.0000E+00 2.9211E+00 2.9211E+00 0.0000E+00 0.0000E+00 2.1000E+11 8.0769E+10 8.4160E+00 8.4160E+00 1.6832E+01 5.0000E-01 5.0000E-01 9.8632E-01 0.0000E+00 0.0000E+00 0.0000E+00
11.500 8.1012E+03 0.0000E+00 0.0000E+00 2.8226E+00 2.8226E+00 0.0000E+00 0.0000E+00 2.1000E+11 8.0769E+10 7.5934E+00 7.5934E+00 1.5187E+01 5.0000E-01 5.0000E-01 9.5308E-01 0.0000E+00 0.0000E+00 0.0000E+00
11.501 7.6767E+03 0.0000E+00 0.0000E+00 2.8233E+00 2.8233E+00 0.0000E+00 0.0000E+00 2.1000E+11 8.0769E+10 7.1991E+00 7.1991E+00 1.4398E+01 5.0000E-01 5.0000E-01 9.0314E-01 0.0000E+00 0.0000E+00 0.0000E+00
23.000 7.4090E+03 0.0000E+00 0.0000E+00 2.7249E+00 2.7249E+00 0.0000E+00 0.0000E+00 2.1000E+11 8.0769E+10 6.4720E+00 6.4720E+00 1.2944E+01 5.0000E-01 5.0000E-01 8.7165E-01 0.0000E+00 0.0000E+00 0.0000E+00
23.001 6.9992E+03 0.0000E+00 0.0000E+00 2.7256E+00 2.7256E+00 0.0000E+00 0.0000E+00 2.1000E+11 8.0769E+10 6.1171E+00 6.1171E+00 1.2234E+01 5.0000E-01 5.0000E-01 8.2343E-01 0.0000E+00 0.0000E+00 0.0000E+00
34.500 6.7464E+03 0.0000E+00 0.0000E+00 2.6271E+00 2.6271E+00 0.0000E+00 0.0000E+00 2.1000E+11 8.0769E+10 5.4779E+00 5.4779E+00 1.0956E+01 5.0000E-01 5.0000E-01 7.9369E-01 0.0000E+00 0.0000E+00 0.0000E+00
34.501 6.3512E+03 0.0000E+00 0.0000E+00 2.6278E+00 2.6278E+00 0.0000E+00 0.0000E+00 2.1000E+11 8.0769E+10 5.1598E+00 5.1598E+00 1.0320E+01 5.0000E-01 5.0000E-01 7.4720E-01 0.0000E+00 0.0000E+00 0.0000E+00
46.000 6.1133E+03 0.0000E+00 0.0000E+00 2.5294E+00 2.5294E+00 0.0000E+00 0.0000E+00 2.1000E+11 8.0769E+10 4.6013E+00 4.6013E+00 9.2027E+00 5.0000E-01 5.0000E-01 7.1921E-01 0.0000E+00 0.0000E+00 0.0000E+00
46.001 5.7328E+03 0.0000E+00 0.0000E+00 2.5301E+00 2.5301E+00 0.0000E+00 0.0000E+00 2.1000E+11 8.0769E+10 4.3173E+00 4.3173E+00 8.6346E+00 5.0000E-01 5.0000E-01 6.7444E-01 0.0000E+00 0.0000E+00 0.0000E+00
57.500 5.5097E+03 0.0000E+00 0.0000E+00 2.4316E+00 2.4316E+00 0.0000E+00 0.0000E+00 2.1000E+11 8.0769E+10 3.8327E+00 3.8327E+00 7.6654E+00 5.0000E-01 5.0000E-01 6.4820E-01 0.0000E+00 0.0000E+00 0.0000E+00
57.501 5.1439E+03 0.0000E+00 0.0000E+00 2.4323E+00 2.4323E+00 0.0000E+00 0.0000E+00 2.1000E+11 8.0769E+10 3.5803E+00 3.5803E+00 7.1605E+00 5.0000E-01 5.0000E-01 6.0516E-01 0.0000E+00 0.0000E+00 0.0000E+00
69.000 4.9357E+03 0.0000E+00 0.0000E+00 2.3339E+00 2.3339E+00 0.0000E+00 0.0000E+00 2.1000E+11 8.0769E+10 3.1629E+00 3.1629E+00 6.3258E+00 5.0000E-01 5.0000E-01 5.8067E-01 0.0000E+00 0.0000E+00 0.0000E+00
69.001 4.5845E+03 0.0000E+00 0.0000E+00 2.3346E+00 2.3346E+00 0.0000E+00 0.0000E+00 2.1000E+11 8.0769E+10 2.9396E+00 2.9396E+00 5.8792E+00 5.0000E-01 5.0000E-01 5.3935E-01 0.0000E+00 0.0000E+00 0.0000E+00
80.500 4.3912E+03 0.0000E+00 0.0000E+00 2.2361E+00 2.2361E+00 0.0000E+00 0.0000E+00 2.1000E+11 8.0769E+10 2.5832E+00 2.5832E+00 5.1664E+00 5.0000E-01 5.0000E-01 5.1661E-01 0.0000E+00 0.0000E+00 0.0000E+00
80.501 4.0547E+03 0.0000E+00 0.0000E+00 2.2368E+00 2.2368E+00 0.0000E+00 0.0000E+00 2.1000E+11 8.0769E+10 2.3867E+00 2.3867E+00 4.7734E+00 5.0000E-01 5.0000E-01 4.7702E-01 0.0000E+00 0.0000E+00 0.0000E+00
92.000 3.8762E+03 0.0000E+00 0.0000E+00 2.1384E+00 2.1384E+00 0.0000E+00 0.0000E+00 2.1000E+11 8.0769E+10 2.0852E+00 2.0852E+00 4.1705E+00 5.0000E-01 5.0000E-01 4.5602E-01 0.0000E+00 0.0000E+00 0.0000E+00
92.001 3.5543E+03 0.0000E+00 0.0000E+00 2.1391E+00 2.1391E+00 0.0000E+00 0.0000E+00 2.1000E+11 8.0769E+10 1.9133E+00 1.9133E+00 3.8267E+00 5.0000E-01 5.0000E-01 4.1816E-01 0.0000E+00 0.0000E+00 0.0000E+00
103.500 3.3908E+03 0.0000E+00 0.0000E+00 2.0406E+00 2.0406E+00 0.0000E+00 0.0000E+00 2.1000E+11 8.0769E+10 1.6611E+00 1.6611E+00 3.3223E+00 5.0000E-01 5.0000E-01 3.9891E-01 0.0000E+00 0.0000E+00 0.0000E+00
103.501 3.0836E+03 0.0000E+00 0.0000E+00 2.0413E+00 2.0413E+00 0.0000E+00 0.0000E+00 2.1000E+11 8.0769E+10 1.5117E+00 1.5117E+00 3.0234E+00 5.0000E-01 5.0000E-01 3.6277E-01 0.0000E+00 0.0000E+00 0.0000E+00
115.630 2.9267E+03 0.0000E+00 0.0000E+00 1.9375E+00 1.9375E+00 0.0000E+00 0.0000E+00 2.1000E+11 8.0769E+10 1.2925E+00 1.2925E+00 2.5850E+00 5.0000E-01 5.0000E-01 3.4432E-01 0.0000E+00 0.0000E+00 0.0000E+00
$2 20
0.000 8.3837E+03 0.0000E+00 0.0000E+00 2.9211E+00 2.9211E+00 0.0000E+00 0.0000E+00 2.1000E+17 8.0769E+17 8.4160E+00 8.4160E+00 1.6832E+01 5.0000E-01 5.0000E-01 9.8632E-01 0.0000E+00 0.0000E+00 0.0000E+00
11.500 8.1012E+03 0.0000E+00 0.0000E+00 2.8226E+00 2.8226E+00 0.0000E+00 0.0000E+00 2.1000E+17 8.0769E+17 7.5934E+00 7.5934E+00 1.5187E+01 5.0000E-01 5.0000E-01 9.5308E-01 0.0000E+00 0.0000E+00 0.0000E+00
11.501 7.6767E+03 0.0000E+00 0.0000E+00 2.8233E+00 2.8233E+00 0.0000E+00 0.0000E+00 2.1000E+17 8.0769E+17 7.1991E+00 7.1991E+00 1.4398E+01 5.0000E-01 5.0000E-01 9.0314E-01 0.0000E+00 0.0000E+00 0.0000E+00
23.000 7.4090E+03 0.0000E+00 0.0000E+00 2.7249E+00 2.7249E+00 0.0000E+00 0.0000E+00 2.1000E+17 8.0769E+17 6.4720E+00 6.4720E+00 1.2944E+01 5.0000E-01 5.0000E-01 8.7165E-01 0.0000E+00 0.0000E+00 0.0000E+00
23.001 6.9992E+03 0.0000E+00 0.0000E+00 2.7256E+00 2.7256E+00 0.0000E+00 0.0000E+00 2.1000E+17 8.0769E+17 6.1171E+00 6.1171E+00 1.2234E+01 5.0000E-01 5.0000E-01 8.2343E-01 0.0000E+00 0.0000E+00 0.0000E+00
34.500 6.7464E+03 0.0000E+00 0.0000E+00 2.6271E+00 2.6271E+00 0.0000E+00 0.0000E+00 2.1000E+17 8.0769E+17 5.4779E+00 5.4779E+00 1.0956E+01 5.0000E-01 5.0000E-01 7.9369E-01 0.0000E+00 0.0000E+00 0.0000E+00
34.501 6.3512E+03 0.0000E+00 0.0000E+00 2.6278E+00 2.6278E+00 0.0000E+00 0.0000E+00 2.1000E+17 8.0769E+17 5.1598E+00 5.1598E+00 1.0320E+01 5.0000E-01 5.0000E-01 7.4720E-01 0.0000E+00 0.0000E+00 0.0000E+00
46.000 6.1133E+03 0.0000E+00 0.0000E+00 2.5294E+00 2.5294E+00 0.0000E+00 0.0000E+00 2.1000E+17 8.0769E+17 4.6013E+00 4.6013E+00 9.2027E+00 5.0000E-01 5.0000E-01 7.1921E-01 0.0000E+00 0.0000E+00 0.0000E+00
46.001 5.7328E+03 0.0000E+00 0.0000E+00 2.5301E+00 2.5301E+00 0.0000E+00 0.0000E+00 2.1000E+17 8.0769E+17 4.3173E+00 4.3173E+00 8.6346E+00 5.0000E-01 5.0000E-01 6.7444E-01 0.0000E+00 0.0000E+00 0.0000E+00
57.500 5.5097E+03 0.0000E+00 0.0000E+00 2.4316E+00 2.4316E+00 0.0000E+00 0.0000E+00 2.1000E+17 8.0769E+17 3.8327E+00 3.8327E+00 7.6654E+00 5.0000E-01 5.0000E-01 6.4820E-01 0.0000E+00 0.0000E+00 0.0000E+00
57.501 5.1439E+03 0.0000E+00 0.0000E+00 2.4323E+00 2.4323E+00 0.0000E+00 0.0000E+00 2.1000E+17 8.0769E+17 3.5803E+00 3.5803E+00 7.1605E+00 5.0000E-01 5.0000E-01 6.0516E-01 0.0000E+00 0.0000E+00 0.0000E+00
69.000 4.9357E+03 0.0000E+00 0.0000E+00 2.3339E+00 2.3339E+00 0.0000E+00 0.0000E+00 2.1000E+17 8.0769E+17 3.1629E+00 3.1629E+00 6.3258E+00 5.0000E-01 5.0000E-01 5.8067E-01 0.0000E+00 0.0000E+00 0.0000E+00
69.001 4.5845E+03 0.0000E+00 0.0000E+00 2.3346E+00 2.3346E+00 0.0000E+00 0.0000E+00 2.1000E+17 8.0769E+17 2.9396E+00 2.9396E+00 5.8792E+00 5.0000E-01 5.0000E-01 5.3935E-01 0.0000E+00 0.0000E+00 0.0000E+00
80.500 4.3912E+03 0.0000E+00 0.0000E+00 2.2361E+00 2.2361E+00 0.0000E+00 0.0000E+00 2.1000E+17 8.0769E+17 2.5832E+00 2.5832E+00 5.1664E+00 5.0000E-01 5.0000E-01 5.1661E-01 0.0000E+00 0.0000E+00 0.0000E+00
80.501 4.0547E+03 0.0000E+00 0.0000E+00 2.2368E+00 2.2368E+00 0.0000E+00 0.0000E+00 2.1000E+17 8.0769E+17 2.3867E+00 2.3867E+00 4.7734E+00 5.0000E-01 5.0000E-01 4.7702E-01 0.0000E+00 0.0000E+00 0.0000E+00
92.000 3.8762E+03 0.0000E+00 0.0000E+00 2.1384E+00 2.1384E+00 0.0000E+00 0.0000E+00 2.1000E+17 8.0769E+17 2.0852E+00 2.0852E+00 4.1705E+00 5.0000E-01 5.0000E-01 4.5602E-01 0.0000E+00 0.0000E+00 0.0000E+00
92.001 3.5543E+03 0.0000E+00 0.0000E+00 2.1391E+00 2.1391E+00 0.0000E+00 0.0000E+00 2.1000E+17 8.0769E+17 1.9133E+00 1.9133E+00 3.8267E+00 5.0000E-01 5.0000E-01 4.1816E-01 0.0000E+00 0.0000E+00 0.0000E+00
103.500 3.3908E+03 0.0000E+00 0.0000E+00 2.0406E+00 2.0406E+00 0.0000E+00 0.0000E+00 2.1000E+17 8.0769E+17 1.6611E+00 1.6611E+00 3.3223E+00 5.0000E-01 5.0000E-01 3.9891E-01 0.0000E+00 0.0000E+00 0.0000E+00
103.501 3.0836E+03 0.0000E+00 0.0000E+00 2.0413E+00 2.0413E+00 0.0000E+00 0.0000E+00 2.1000E+17 8.0769E+17 1.5117E+00 1.5117E+00 3.0234E+00 5.0000E-01 5.0000E-01 3.6277E-01 0.0000E+00 0.0000E+00 0.0000E+00
115.630 2.9267E+03 0.0000E+00 0.0000E+00 1.9375E+00 1.9375E+00 0.0000E+00 0.0000E+00 2.1000E+17 8.0769E+17 1.2925E+00 1.2925E+00 2.5850E+00 5.0000E-01 5.0000E-01 3.4432E-01 0.0000E+00 0.0000E+00 0.0000E+00
\ No newline at end of file
#1 Tower top
r m x_cg y_cg ri_x ri_y x_sh y_sh E G I_x I_y I_p k_x k_y A pitch x_e y_e
$1 2 towertop with nacelle mass on bottom element. flexible
0.0 1.00E-04 0 0 1.36E+00 1.36E+00 0 0 2.10E+11 8.08E+10 5.52E-01 5.52E-01 1.10E+00 0.5 0.5 2.98E-01 0 0 0
2.75 1.00E-04 0 0 1.36E+00 1.36E+00 0 0 2.10E+11 8.08E+10 5.52E-01 5.52E-01 1.10E+00 0.5 0.5 2.98E-01 0 0 0
r m x_cg y_cg ri_x ri_y x_sh y_sh E G I_x I_y I_p k_x k_y A pitch x_e y_e
$2 2 towertop with nacelle mass on bottom element. Stiff
0.0 1.00E-04 0 0 1.36E+00 1.36E+00 0 0 2.10E+17 8.08E+17 5.52E-01 5.52E-01 1.10E+00 0.5 0.5 2.98E-01 0 0 0
2.75 1.00E-04 0 0 1.36E+00 1.36E+00 0 0 2.10E+17 8.08E+17 5.52E-01 5.52E-01 1.10E+00 0.5 0.5 2.98E-01 0 0 0
\ No newline at end of file
1
1 40
0.0000E+00 5.3800E+00 1.0000E+02 1 ;
2.0000E+00 5.3800E+00 1.0000E+02 1 ;
4.7120E+00 5.3800E+00 9.6915E+01 1 ;
5.3960E+00 5.3800E+00 9.5291E+01 1 ;
6.3190E+00 5.3886E+00 9.2664E+01 1 ;
7.4750E+00 5.4212E+00 8.8775E+01 1 ;
8.8580E+00 5.4865E+00 8.3448E+01 1 ;
1.0458E+01 5.5887E+00 7.6689E+01 1 ;
1.2268E+01 5.7247E+00 6.8754E+01 1 ;
1.4275E+01 5.8817E+00 6.0273E+01 1 ;
1.6467E+01 6.0346E+00 5.2291E+01 1 ;
1.8833E+01 6.1478E+00 4.5826E+01 1 ;
2.1356E+01 6.2020E+00 4.0950E+01 1 ;
2.4023E+01 6.1950E+00 3.7343E+01 1 ;
2.6817E+01 6.1292E+00 3.4518E+01 1 ;
2.9721E+01 6.0096E+00 3.2270E+01 1 ;
3.2719E+01 5.8432E+00 3.0488E+01 1 ;
3.5791E+01 5.6400E+00 2.9020E+01 1 ;
3.8920E+01 5.4107E+00 2.7756E+01 1 ;
4.2086E+01 5.1613E+00 2.6693E+01 1 ;
4.5272E+01 4.8974E+00 2.5829E+01 1 ;
4.8457E+01 4.6255E+00 2.5157E+01 1 ;
5.1623E+01 4.3519E+00 2.4665E+01 1 ;
5.4750E+01 4.0827E+00 2.4338E+01 1 ;
5.7820E+01 3.8220E+00 2.4156E+01 1 ;
6.0815E+01 3.5724E+00 2.4100E+01 1 ;
6.3716E+01 3.3364E+00 2.4100E+01 1 ;
6.6506E+01 3.1161E+00 2.4100E+01 1 ;
6.9168E+01 2.9130E+00 2.4100E+01 1 ;
7.1687E+01 2.7275E+00 2.4100E+01 1 ;
7.4047E+01 2.5595E+00 2.4100E+01 1 ;
7.6234E+01 2.4087E+00 2.4100E+01 1 ;
7.8234E+01 2.2660E+00 2.4100E+01 1 ;
8.0037E+01 2.1175E+00 2.4100E+01 1 ;
8.1631E+01 1.9588E+00 2.4100E+01 1 ;
8.3006E+01 1.7913E+00 2.4100E+01 1 ;
8.4155E+01 1.6013E+00 2.4100E+01 1 ;
8.5070E+01 1.3858E+00 2.4100E+01 1 ;
8.5746E+01 1.1384E+00 2.4100E+01 1 ;
8.6366E+01 8.3354E-01 2.4100E+01 1 ;
This diff is collapsed.
......@@ -118,8 +118,8 @@ begin main_body;
node_distribution c2_def;
damping_posdef 0.0 0.0 0.0 0.00153 0.00255 0.00033;
begin timoschenko_input;
filename data/2Bdown-rR1.08_blade_st.dat;
set 1 1;
filename ./data/DTU_10MW_RWT_Blade_st.dat;
set 1 1; set subset
end timoschenko_input;
begin c2_def;
nsec 20;
......@@ -326,9 +326,9 @@ begin aero;
hub_vec shaft -3; rotor rotation vector (normally shaft composant directed from pressure to sustion side)
link 1 mbdy_c2_def blade1;
link 2 mbdy_c2_def blade2;
; link 3 mbdy_c2_def blade3;
ae_filename ./data/2Bdown-rR1.08_ae.dat;
pc_filename ./data/2Bup_AEP095_pc.dat;
link 3 mbdy_c2_def blade3;
ae_filename ./data/DTU_10MW_RWT_ae.dat;
pc_filename ./data/DTU_10MW_RWT_pc.dat;
induction_method 1; 0=none, 1=normal
aerocalc_method 1; 0=ingen aerodynamic, 1=med aerodynamic
aerosections 50; def. 50
......
......@@ -205,9 +205,9 @@ class TestHtcFile(unittest.TestCase):
'./data/DTU_10MW_RWT_Towertop_st.dat',
'./data/DTU_10MW_RWT_Shaft_st.dat',
'./data/DTU_10MW_RWT_Hub_st.dat',
'data/2Bdown-rR1.08_blade_st.dat',
'./data/2Bdown-rR1.08_ae.dat',
'./data/2Bup_AEP095_pc.dat',
'./data/DTU_10MW_RWT_Blade_st.dat',
'./data/DTU_10MW_RWT_ae.dat',
'./data/DTU_10MW_RWT_pc.dat',
'./control/risoe_controller.dll',
'./control/generator_servo.dll',
'./control/mech_brake.dll',
......
'''
Created on 01/08/2016
@author: MMPE
'''
import unittest
import os
from wetb.hawc2.mainbody import MainBody, Blade
tfp = os.path.join(os.path.dirname(__file__), 'test_files/') # test file path
class TestMainBody(unittest.TestCase):
def test_MainBody(self):
mainbody = MainBody(tfp+"htcfiles/test.htc", "../", "towertop")
if 0:
import matplotlib.pyplot as plt
plt.figure()
mainbody.plot_xz_geometry(plt)
plt.figure()
mainbody.plot_yz_geometry(plt)
plt.show()
def test_Blade(self):
blade = Blade(tfp+"htcfiles/test.htc", "../")
if 0:
import matplotlib.pyplot as plt
plt.figure()
blade.plot_xz_geometry(plt)
plt.figure()
blade.plot_yz_geometry(plt)
plt.show()
# def testBladedata(self):
# #bd = H2AeroBladeData(tfp + "h2aero_tb/htc/h2aero.htc", '../')
# #bd = H2AeroBladeData(r'C:\mmpe\programming\python\Phd\pitot_tube\tests\test_files\swt36_107\h2a\htc\templates/swt3.6_107.htc', "../../")
# #print (bd.pcFile.chord(36))
# #bd = H2BladeData(r"C:\mmpe\HAWC2\models\SWT3.6-107\original_data\SWT4.0-130\dlc12_wsp06_wdir010_s18002.htc", ".")
# bd = H2BladeData(r"C:\mmpe\HAWC2\models\SWT3.6-107\htc/stat6/stat6_10.0_0.htc", "../../")
# #bd = H2BladeData(r"C:\mmpe\HAWC2\models\NREL 5MW reference wind turbine_play/htc/NREL_5MW_reference_wind_turbine_heli_step.htc", "../")
# if 1:
# bd.plot_geometry()
#
#
if __name__ == "__main__":
#import sys;sys.argv = ['', 'Test.testBladedata']
unittest.main()
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