From b41f555ecd813115cb8efeabdf18854c530f00ef Mon Sep 17 00:00:00 2001 From: ptrbortolotti Date: Thu, 8 Jan 2026 14:08:36 -0700 Subject: [PATCH 1/2] work on example 8, where anba4 fails --- SONATA/anbax/anbax_utl.py | 6 +- SONATA/utl/converter_WT.py | 2 +- examples/8_fiber_orient/8_box_beam.yaml | 81 ++++++++++--------------- 3 files changed, 37 insertions(+), 52 deletions(-) diff --git a/SONATA/anbax/anbax_utl.py b/SONATA/anbax/anbax_utl.py index af8e712d..e5ed0edc 100644 --- a/SONATA/anbax/anbax_utl.py +++ b/SONATA/anbax/anbax_utl.py @@ -100,9 +100,9 @@ def build_dolfin_mesh(cbm_mesh, cbm_nodes, cbm_materials): fiber_orientations.set_all(0.0) for c in cbm_mesh: - materials[c.id-1] = matdict[c.MatID] - plane_orientations[c.id-1] = c.theta_1[0] # rotation around x1-axis (equiv. to beam axis) in SONATA/VABS coordinates; Theta_11 - fiber_orientations[c.id-1] = c.theta_3 # rotation around x3-axis in SONATA/VABS coordinates; Theta_3 + materials[c.id] = matdict[c.MatID-1] + plane_orientations[c.id] = c.theta_1[0] # rotation around x1-axis (equiv. to beam axis) in SONATA/VABS coordinates; Theta_11 + fiber_orientations[c.id] = c.theta_3 # rotation around x3-axis in SONATA/VABS coordinates; Theta_3 return mesh, matLibrary, materials, plane_orientations, fiber_orientations, maxE diff --git a/SONATA/utl/converter_WT.py b/SONATA/utl/converter_WT.py index 2a3eee2c..393f3ad1 100644 --- a/SONATA/utl/converter_WT.py +++ b/SONATA/utl/converter_WT.py @@ -270,7 +270,7 @@ def converter_WT(blade, cs_pos, byml, materials, mesh_resolution): if 'fiber_orientation' in sec.keys(): set_interp = PchipInterpolator(sec['fiber_orientation']['grid'], sec['fiber_orientation']['values']) - tmp2[i]['segments'][0]['layup'][id_layer]['orientation'] = float(set_interp(x[i]) * 180 / np.pi) # added float + tmp2[i]['segments'][0]['layup'][id_layer]['orientation'] = float(set_interp(x[i])) # added float else: tmp2[i]['segments'][0]['layup'][id_layer]['orientation'] = 0. diff --git a/examples/8_fiber_orient/8_box_beam.yaml b/examples/8_fiber_orient/8_box_beam.yaml index cca07729..a01c1ec5 100644 --- a/examples/8_fiber_orient/8_box_beam.yaml +++ b/examples/8_fiber_orient/8_box_beam.yaml @@ -1,5 +1,7 @@ name: Box_Beam -description: Simple rectangular beam +windIO_version: '2.0.1' +assembly: + number_of_blades: 1 components: blade: reference_axis: @@ -15,7 +17,7 @@ components: outer_shape: chord: grid: [0.0, 1.0] - values: [1., 1.] + values: [2., 2.] twist: grid: [0.0, 1.0] values: [0.0, 0.0] @@ -23,7 +25,10 @@ components: # values: [0.17453292519943295, 0.17453292519943295] section_offset_y: grid: [0.0, 1.0] - values: [0., 0.] + values: [1., 1.] + rthick: + grid: [0.0, 1.0] + values: [0.5, 0.5] airfoils: - name: rectangular spanwise_position: 0.0 @@ -41,10 +46,10 @@ components: material: CarbonUD fiber_orientation: grid: [0.0, 1.0] - values: [0.2618, 0.2618] + values: [15.0, 15.0] thickness: grid: [0.0, 1.0] - values: [0.01, 0.01] + values: [0.001, 0.001] start_nd_arc: anchor: name: TE @@ -57,10 +62,10 @@ components: material: CarbonUD fiber_orientation: grid: [0.0, 1.0] - values: [0.2618, 0.2618] + values: [15.0, 15.0] thickness: grid: [0.0, 1.0] - values: [0.01, 0.01] + values: [0.001, 0.001] start_nd_arc: anchor: name: TE @@ -73,10 +78,10 @@ components: material: CarbonUD fiber_orientation: grid: [0.0, 1.0] - values: [0.2618, 0.2618] + values: [15.0, 15.0] thickness: grid: [0.0, 1.0] - values: [0.01, 0.01] + values: [0.001, 0.001] start_nd_arc: anchor: name: TE @@ -89,10 +94,10 @@ components: material: CarbonUD fiber_orientation: grid: [0.0, 1.0] - values: [0.2618, 0.2618] + values: [15.0, 15.0] thickness: grid: [0.0, 1.0] - values: [0.01, 0.01] + values: [0.001, 0.001] start_nd_arc: anchor: name: TE @@ -105,10 +110,10 @@ components: material: CarbonUD fiber_orientation: grid: [0.0, 1.0] - values: [0.2618, 0.2618] + values: [15.0, 15.0] thickness: grid: [0.0, 1.0] - values: [0.01, 0.01] + values: [0.001, 0.001] start_nd_arc: anchor: name: TE @@ -121,10 +126,10 @@ components: material: CarbonUD fiber_orientation: grid: [0.0, 1.0] - values: [0.2618, 0.2618] + values: [15.0, 15.0] thickness: grid: [0.0, 1.0] - values: [0.01, 0.01] + values: [0.001, 0.001] start_nd_arc: anchor: name: TE @@ -137,10 +142,10 @@ components: material: CarbonUD fiber_orientation: grid: [0.0, 1.0] - values: [0.2618, 0.2618] + values: [15.0, 15.0] thickness: grid: [0.0, 1.0] - values: [0.01, 0.01] + values: [0.001, 0.001] start_nd_arc: anchor: name: TE @@ -153,10 +158,10 @@ components: material: CarbonUD fiber_orientation: grid: [0.0, 1.0] - values: [0.2618, 0.2618] + values: [15.0, 15.0] thickness: grid: [0.0, 1.0] - values: [0.01, 0.01] + values: [0.001, 0.001] start_nd_arc: anchor: name: TE @@ -169,10 +174,10 @@ components: material: CarbonUD fiber_orientation: grid: [0.0, 1.0] - values: [0.2618, 0.2618] + values: [15.0, 15.0] thickness: grid: [0.0, 1.0] - values: [0.01, 0.01] + values: [0.001, 0.001] start_nd_arc: anchor: name: TE @@ -185,10 +190,10 @@ components: material: CarbonUD fiber_orientation: grid: [0.0, 1.0] - values: [0.2618, 0.2618] + values: [15.0, 15.0] thickness: grid: [0.0, 1.0] - values: [0.01, 0.01] + values: [0.001, 0.001] start_nd_arc: anchor: name: TE @@ -208,43 +213,24 @@ components: airfoils: - name: rectangular coordinates: # follow s-coordinate along the outer profile of the structure - x: [1.0, 1.0, -1.0, -1.0, 1.0, 1.0] # in SI units - mm - box beam analogous to Popescu/Hodges 2000 paper p. 551/552 & Hodges 1992 paper - y: [0.0, 0.5, 0.5, -0.5, -0.5, 0.0] + x: [1.0, 1.0, 0.0, 0.0, 1.0, 1.0] # in SI units - mm - box beam analogous to Popescu/Hodges 2000 paper p. 551/552 & Hodges 1992 paper + y: [0.0, 0.25, 0.25, -0.25, -0.25, 0.0] rthick: 0.5000 aerodynamic_center: 0.5000 polars: # dummy 2pi polars (not used in example) - configuration: Default re_sets: - re: 3.00E+06 - c_m: + cm: grid: [-3.141592653589793, 3.141592653589793] values: [0.0, 0.0] - c_l: + cl: grid: [-3.141592653589793, 3.141592653589793] values: [0.0, 0.0] - c_d: + cd: grid: [-3.141592653589793, 3.141592653589793] values: [0.5, 0.5] materials: - - name: steel - description: Steel of the tower and monopile ASTM A572 Grade 50 - source: http://www.matweb.com/search/DataSheet.aspx?MatGUID=9ced5dc901c54bd1aef19403d0385d7f - orth: 0 - rho: 7800 - alpha: 0.0 - E: 200000000000.0 - nu: 0.3 - G: 79300000000.0 - GIc: 0 - GIIc: 0 - alp0: 0 - Xt: 450000000.0 - Xc: 450000000.0 - S: 0 - Xy: 345000000.0 - m: 3 - A: 35534648443.719765 - unit_cost: 0.7 - name: CarbonUD E: [114500000000.0, 8390000000.0, 8390000000.0] G: [5990000000.0, 5990000000.0, 5990000000.0] @@ -265,4 +251,3 @@ materials: waste: 0.05 fiber_density: 1800. area_density_dry: 1.000 - component_id: 4 From 690d40f3a3fb108d8060694d6edd46a59bf3ca6e Mon Sep 17 00:00:00 2001 From: Justin Porter <55218207+JustinPorter88@users.noreply.github.com> Date: Thu, 8 Jan 2026 15:12:47 -0700 Subject: [PATCH 2/2] Changing the custom mesh material number in the example since a material was deleted from the yaml (index changed). --- SONATA/anbax/anbax_utl.py | 6 +++--- examples/8_fiber_orient/8_sonata_orientation.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/SONATA/anbax/anbax_utl.py b/SONATA/anbax/anbax_utl.py index e5ed0edc..af8e712d 100644 --- a/SONATA/anbax/anbax_utl.py +++ b/SONATA/anbax/anbax_utl.py @@ -100,9 +100,9 @@ def build_dolfin_mesh(cbm_mesh, cbm_nodes, cbm_materials): fiber_orientations.set_all(0.0) for c in cbm_mesh: - materials[c.id] = matdict[c.MatID-1] - plane_orientations[c.id] = c.theta_1[0] # rotation around x1-axis (equiv. to beam axis) in SONATA/VABS coordinates; Theta_11 - fiber_orientations[c.id] = c.theta_3 # rotation around x3-axis in SONATA/VABS coordinates; Theta_3 + materials[c.id-1] = matdict[c.MatID] + plane_orientations[c.id-1] = c.theta_1[0] # rotation around x1-axis (equiv. to beam axis) in SONATA/VABS coordinates; Theta_11 + fiber_orientations[c.id-1] = c.theta_3 # rotation around x3-axis in SONATA/VABS coordinates; Theta_3 return mesh, matLibrary, materials, plane_orientations, fiber_orientations, maxE diff --git a/examples/8_fiber_orient/8_sonata_orientation.py b/examples/8_fiber_orient/8_sonata_orientation.py index 942d326e..6f01bdbb 100644 --- a/examples/8_fiber_orient/8_sonata_orientation.py +++ b/examples/8_fiber_orient/8_sonata_orientation.py @@ -84,7 +84,7 @@ cells = np.array([[1, 2, 3, 0]]) # check job.materials - MatID = 2*np.ones(1) + MatID = np.ones(1) job.blade_custom_mesh(nodes, cells, MatID, theta_3=15)