compas-dev / compas_fea

COMPAS interface to common Finite Element Analysis software.
https://compas.dev/compas_fea
MIT License
36 stars 18 forks source link

local axes #123

Open Beberger opened 2 years ago

Beberger commented 2 years ago

Hello everyone,

For further calculations I need the moments and forces in predefined directions. I want to predefine the local axes for example as follow 'ex': [0, 0, 1], 'ey': [1, 0, 0], 'ez': [0, 1, 0] in global [x,y,z] coordniates. But when I load tho inp file into abaqus the local axes seem to be different.

In the following I descripe how I want to achieve that so far and what the problem is:

When I take the plate from the examples... grafik

...and define the local axes with the following function right after creating the element... mdl.elements[1].axes.update({'ex': [0, 0, 1], 'ey': [1, 0, 0], 'ez': [0, 1, 0]}) the plot of the local axes looks good: grafik

the *.inp file for abaqus seems to be written right: grafik

Acording to this users-manual from abaqus, the points a,b for the orientation should be taken as: a = [ax = 0, ay = 0, az = 1 ] and b = [bx = 1, by = 0, bz = 0 ]. This should lead to a local coordinatesystem as defined {'ex': [0, 0, 1], 'ey': [1, 0, 0], 'ez': [0, 1, 0]}. https://abaqus-docs.mit.edu/2017/English/SIMACAEKEYRefMap/simakey-r-orientation.htm#simakey-r-orientation__simakey-r-orientation-s-datadesc1

When I create a new job in abaqus, load in the inp-file, and let show the local axes it looks like 'ex': [1, 0, 0], 'ey': [0, 0, 1], 'ez': [0, -1, 0] not like 'ex': [0, 0, 1], 'ey': [1, 0, 0], 'ez': [0, 1, 0]

grafik

I then also tried to swich the axes with: mdl.elements[1].axes.update({'ex': [1, 0, 0], 'ey': [0, 0, 1], 'ez': [0, -1, 0]}) the inp changes to: *ELEMENT, TYPE=S4, ELSET=element_0 1, 1,2,53,52 *ORIENTATION, NAME=ORI_element_0 1, 0, 0, 0, 0, 1

but the local axes in abaqus are then like this (with 2-axis even going in the negative x-direction): grafik

The code so far is:

from compas_fea.cad import rhino
from compas_fea.structure import ElasticIsotropic
from compas_fea.structure import ElementProperties as Properties
from compas_fea.structure import GeneralStep
from compas_fea.structure import PointLoad
from compas_fea.structure import PinnedDisplacement
from compas_fea.structure import RollerDisplacementX
from compas_fea.structure import ShellSection
from compas_fea.structure import Structure

import sandwichmodel_main as SMM

# Author(s): Andrew Liew (github.com/andrewliew), Benjamin Berger (github.com/Beberger)

#Allgemein
thickness = 300 #mm
name = 's_001100'
path = 'C:/Temp/'

# Structure

mdl = Structure(name=name, path=path)

# Elements

rhino.add_nodes_elements_from_layers(mdl, mesh_type='ShellElement', layers='elset_mesh')
mdl.elements[1].axes.update({'ex': [0, 0, 1], 'ey': [1, 0, 0], 'ez': [0, 1, 0]})
# Sets

rhino.add_sets_from_layers(mdl, layers=['nset_load', 'nset_left', 'nset_right'])

# Materials

mdl.add(ElasticIsotropic(name='mat_elastic', E=30*10**3, v=0.3, p=2500/10**9))

# Sections

mdl.add(ShellSection(name='sec_plate', t=thickness))

# Properties

mdl.add(Properties(name='ep_plate', material='mat_elastic', section='sec_plate', elset='elset_mesh'))

#data = {} #generiert ein leeres dictionary fuer zusaetzliche Materialkennwerte
#SMM.additionalproperty(data, prop_name = 'ep_plate', thickness = 300 , c_nom_bot = 40, c_nom_top = 40, fc_k = 30, theta_grad_kern = 45, fs_d=435, alpha_bot = 0, beta_bot = 90, alpha_top = 0, beta_top = 90) #zusaetzliche Materialkennwerte werden gefuellt...

# Displacements

mdl.add([
    PinnedDisplacement(name='disp_left', nodes='nset_left'),
    RollerDisplacementX(name='disp_right', nodes='nset_right'),
])

# Loads

mdl.add(PointLoad(name='load_point', nodes='nset_load', y=0, z=-10000, x = 0))

# Steps

mdl.add([
    GeneralStep(name='step_bc', displacements=['disp_left', 'disp_right'],nlgeom=False),
    GeneralStep(name='step_load', loads=['load_point'], tolerance=1, iterations=500, nlgeom=False),
])
mdl.steps_order = ['step_bc', 'step_load']

# Summary

mdl.summary()

# Run

mdl.analyse_and_extract(software='abaqus', fields=['u', 'sm', 'sf'])
franaudo commented 2 years ago

Hi @Beberger!

The elements' local axes can be used only to apply loads in the local coordinate system. An easy manual fix to get what you want is as follow:

This is before: image

and after: image

I will look into automatize this, but it will have to wait after the xmas break...

Hope this helps!

Ciao and happy holidays, F

Beberger commented 2 years ago

Hi @franaudo

Thank you for the answer and the easy manual. Happy holidays too!

best regards Ben