Skip to content

Commit

Permalink
Merge pull request #5 from andersone35/main
Browse files Browse the repository at this point in the history
Update, 9/26
  • Loading branch information
andersone35 authored Sep 26, 2024
2 parents 31c757a + 9394bec commit d3dbdd8
Show file tree
Hide file tree
Showing 19 changed files with 2,204 additions and 584 deletions.
Binary file modified .DS_Store
Binary file not shown.
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [windows-latest, macOS-13, ubuntu-latest]
python-version: ['3.8', '3.9', '3.10']
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand Down
Binary file modified docs/_static/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/cs_params_dict.csv
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Key,Description
``nel_per_layer``,"Type: Int. Number of intervals assigned to Cubit curves named ""layer_thickness"""
``element_ar``,Currently unused
``element_size``,"Type: Float or Int. Approximate element aspect ratio. Zero will generate maximally coarse mesh "
``element_shape``,"Type: str. Could be either ""quad"" or ""tri"""
``layer_transition_angle``,Type: float. Angle in degrees to connect adjacent componets with different thicknesses
``birds_mouth_amplitude_fraction``,Type: float. Total brid's mouth depth as a fraction web height.
Expand Down
41 changes: 28 additions & 13 deletions docs/user-guide/solid_models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,52 @@ Continuous meshes in Sierra

#. The first step is to make a Genesis mesh file and the associated files with
:py:func:`~pynumad.analysis.cubit.make_blade.cubit_make_solid_blade`. This
will create the following files
will create the following file

* euler. Binary file with euler angles for material orientations
* mat_ori.py
* {wt_name}.g. Genesis mesh file.

#. Make the Sierra input files with :py:func:`~pynumad.analysis.make_models.write_sierra_model`.
#. The next step is to Compute material orientation with
:py:func:`~pynumad.analysis.cubit.make_blade.compute_material_orientations`

This creates the following files:
#. Next, the orientation data needs to be assigned with
:py:func:`~pynumad.analysis.cubit.make_blade.assign_material_orientations`

#. Finally, the mesh needs to be exported in Genisis format
.. code-block:: python
cubit.cmd(f'export mesh "{wt_name}.g" overwrite')
#. Make the Sierra SM input files with :py:func:`~pynumad.analysis.make_models.write_sierra_sm_model`.

* sm.i and/or sd.i: Sierra SM or SD input file
This creates the following file:

* sm.i : Sierra SM input file

Be sure to have ran the following import statement

.. code-block:: python
from pynumad.analysis.make_models import write_sierra_model
from pynumad.analysis.make_models import write_sierra_sm_model
#. AND/OR Make the Sierra SD input files with :py:func:`~pynumad.analysis.make_models.write_sierra_sd_model`.

#. Apply the spatially varying material orientations to the Genisis mesh. This requires SEACAS
to be installed. One HPWS, you can issue `module load seacas`. Then run mat_ori.py from
a terminal.
This creates the following files:

* sd.i: Sierra SD input file

Be sure to have ran the following import statement

.. code-block:: python
from pynumad.analysis.make_models import write_sierra_sd_model
.. Note::
Reliance on SEACAS for placing the material orientations in the Genesis file is
a temporary solution until this capability is added to Cubit.
#. Finally run Sierra SM with: launch -n 10 adagio -i sm.i, where n is the
number of CPUs.

#. AND/OR run Sierra SD with: launch -n 10 salinas -i sd.i, where n is the
number of CPUs.

An example called `cubit_solid.py` exists in the examples folder.

Expand Down
10 changes: 5 additions & 5 deletions examples/cubit_beam.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def get_cs_params():
cs_params['nel_per_layer'] = 3
cs_params['element_ar'] = 5
cs_params['element_shape'] = 'quad'

cs_params['element_thickness_ar'] =5

cs_params['layer_transition_angle'] = 30
cs_params['birds_mouth_amplitude_fraction']=1.0
Expand Down Expand Up @@ -70,16 +70,16 @@ def get_cs_params():


wt_name=yamlName
dirName='.'
dir_name='.'


cs_params=get_cs_params()
settings={}
settings['make_input_for']='VABSbeamdyn' #SM, VABS, ANBA, or None
settings['export']='cubg' #cub, g, or None


cubit_make_cross_sections(blade,wt_name,settings,cs_params,'2D',stationList=[],directory=dirName) #Note an empty list for stationList will make all cross sections.
station_list = []
cubit_make_cross_sections(blade,wt_name,settings,cs_params,'2D',stationList=station_list,directory=dir_name) #Note an empty list for stationList will make all cross sections.

#Proportional damping values for BeamDyn file.
mu=[0.00257593, 0.0017469, 0.0017469, 0.0017469, 0.00257593, 0.0017469]
Expand All @@ -94,4 +94,4 @@ def get_cs_params():
#Read in a fresh new blade
blade=pynumad.Blade()
blade.read_yaml('example_data/'+yamlName+'.yaml')
file_names=write_beam_model(wt_name,settings,blade,mu,log,directory=dirName)
file_names=write_beam_model(wt_name,station_list,settings,blade,mu,log,directory=dir_name)
35 changes: 26 additions & 9 deletions examples/cubit_solid.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@
from pynumad.analysis.cubit.make_blade import *
import numpy as np

from pynumad.analysis.make_models import write_sierra_model

from pynumad.analysis.make_models import write_sierra_sm_model
from pynumad.analysis.make_models import write_sierra_sd_model


def get_cs_params():
cs_params = {}
cs_params['nel_per_layer'] = 3
cs_params['nel_per_layer'] = 1
cs_params['element_ar'] = 5
cs_params['element_shape'] = 'quad'
cs_params['element_shape'] = 'hex'
cs_params['element_thickness_ar'] =5


cs_params['layer_transition_angle'] = 30
Expand Down Expand Up @@ -67,8 +68,6 @@ def get_cs_params():
blade.read_yaml('example_data/'+yamlName+'.yaml')




wt_name=yamlName
dirName='.'

Expand All @@ -78,7 +77,25 @@ def get_cs_params():
settings['make_input_for']='SmSd' #SM, VABS, ANBA, or None
settings['export']='cubg' #cub, g, or None

materials_used=cubit_make_solid_blade(blade, wt_name, settings, cs_params, stationList=[2,3])


write_sierra_model(wt_name,settings,blade,materials_used,'.')
#Make Cubit Geometry
station_list = [2,3]
materials_used=cubit_make_solid_blade(blade, wt_name, settings, cs_params, stationList=station_list)

#Compute material orientation
orientation_data=compute_material_orientations(cs_params['element_shape'],ncpus = 1)

#assign material orientation in Cubit
assign_material_orientations(orientation_data)

#Export mesh in Genisis format
cubit.cmd(f'export mesh "{wt_name}.g" overwrite')


#Write Sierra input file
from pynumad.paths import SOFTWARE_PATHS
template_path=SOFTWARE_PATHS['pynumad']+'src/data/templates/'

write_sierra_sm_model(template_path+'sm.i.template',wt_name,station_list,blade,materials_used,'.')

write_sierra_sd_model(template_path+'sd.i.template',wt_name,station_list,blade,materials_used,'.')
4 changes: 0 additions & 4 deletions examples/write_abaqus_shell_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,3 @@

numModes = 3
write_shell_modal_input(abqFileName, blade, bladeMesh, adhesiveMat, numModes)

## Write analysis script for execution in Abaqus

write_damping_script(abqScriptName,abqFileName,dampFileName)
Binary file added src/.DS_Store
Binary file not shown.
Loading

0 comments on commit d3dbdd8

Please sign in to comment.