Commit f7b15783 authored by Pierre-Elouan Réthoré's avatar Pierre-Elouan Réthoré
Browse files

change in openmdao api + py3 print function

parent 90981f03
from openmdao.core import Component
from openmdao.api import Component
__author__ = 'rethore'
......
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false,
"scrolled": true
},
"outputs": [],
"source": [
"%run test_seamrotor.py"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"\n",
"2+2"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"top = Problem(root=Group())\n",
"\n",
"blade = top.root.add('blade', SEAMBladeStructure(), promotes=['*'])\n",
"top.setup()\n",
"\n",
"blade.params['Nsections'] = 21\n",
"blade.params['Neq'] = 1e7\n",
"blade.params['WohlerExpFlap'] = 10.0\n",
"blade.params['PMtarget'] = 1.0\n",
"\n",
"blade.params['rotor_diameter'] = 177. #[m]\n",
"# blade.params['RootChord'] = 2.0 #[m]\n",
"# blade.params['MaxChord'] = 2.5 #[m]\n",
"blade.params['MaxChordrR'] = 0.2 #[m]\n",
"\n",
"blade.params['overallMaxFlap'] = 47225.\n",
"blade.params['overallMaxEdge'] = 26712.\n",
"blade.params['TIF_FLext'] = 1. # Tech Impr Factor _ flap extreme\n",
"blade.params['TIF_EDext'] = 1.\n",
"\n",
"blade.params['FlapLEQ'] = 26975.\n",
"blade.params['EdgeLEQ'] = 24252.\n",
"blade.params['TIF_FLfat'] = 1.\n",
"\n",
"blade.params['sc_frac_flap'] = 0.3 # sparcap fraction of chord flap\n",
"blade.params['sc_frac_edge'] = 0.8 # sparcap fraction of thickness edge\n",
"\n",
"blade.params['SF_blade'] = 1.1 #[factor]\n",
"blade.params['Slim_ext_blade'] = 200.0\n",
"blade.params['Slim_fat_blade'] = 27\n",
"\n",
"blade.params['AddWeightFactorBlade'] = 1.2 # Additional weight factor for blade shell\n",
"blade.params['BladeDens'] = 2100. # [kg / m^3]\n",
"#blade.params['BladeCostPerMass'] = 15.0 #[e/kg]\n",
"#blade.params['HubCostPerMass'] = 3.5 #[e/kg]\n",
"#blade.params['SpinnerCostPerMass'] = 4.5 #[e/kg]\n",
"\n",
"\n",
"top.run()\n",
"\n",
"assert blade.unknowns['BladeWeight']\n",
"\n",
"\n",
"data = np.loadtxt('Rotor_outputfile.txt')\n",
"# Comparing found values for thickness with Kenneth's\n",
"datacompare_text_flap = (abs(data[:, 5]-blade.text_flap))\n",
"datacompare_text_edge = (abs(data[:, 7]-blade.text_edge))\n",
"datacompare_tfat_flap = (abs(data[:, 9]-blade.tfat_flap))\n",
"datacompare_tfat_edge = (abs(data[:,11]-blade.tfat_edge))\n",
"\n",
"import matplotlib.pylab as plt\n",
"\n",
"# Plot illustrating the absolute differences for the thicknesses as function of the radius\n",
"plt.figure(1)\n",
"plt.plot(blade.r, datacompare_text_flap, 'o-', label = 'text_flap')\n",
"plt.plot(blade.r, datacompare_text_edge, 'o-', label = 'text_edge')\n",
"plt.plot(blade.r, datacompare_tfat_flap, 'o-', label = 'tfat_flap')\n",
"plt.plot(blade.r, datacompare_tfat_edge, 'o-', label = 'tfat_edge')\n",
"\n",
"plt.legend()\n",
"plt.title(\"abs differences between thickness's as function of radius\")\n",
"plt.axis([0, 90, 0, 0.0003])\n",
"plt.xlabel('radius [m]')\n",
"plt.ylabel(\"abs difference between thickness's\")\n",
"plt.grid()\n",
"plt.show()\n",
"\n",
"# Plot illustrating the 4 thicknesess's as function of the radius\n",
"plt.figure(2)\n",
"plt.plot(blade.r, blade.text_flap, '>-', label = 'text_flap')\n",
"plt.plot(blade.r, blade.text_edge, '>-', label = 'text_edge')\n",
"plt.plot(blade.r, blade.tfat_flap, '>-', label = 'tfat_flap')\n",
"plt.plot(blade.r, blade.tfat_edge, '>-', label = 'tfat_edge')\n",
"\n",
"plt.legend()\n",
"plt.title('Thickness\\'s as function of radius')\n",
"plt.xlabel('radius [m]')\n",
"plt.ylabel('spar thickness [m]')\n",
"plt.grid()\n",
"\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.4.2"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment