Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

OpenFEM - Beam element script 1

Status
Not open for further replies.

GregLocock

Automotive
Apr 10, 2001
23,791
Does anybody have a simple model with beam elements than runs to completion in a static analysis?

I'm a newbie with it and can't find a few necessary parameters in the 'help'.

Specifically I can get a solution but can't process the results into a displayable form.

clear;
fegui;
model = struct('Node',[],'Elt',[]);
% NodeID unused x y z
model.Node=[ 1 0 0 0 0 1 0;
2 0 0 0 0 0 0;
3 0 0 0 1 1 0;
4 0 0 0 1 0 0;
5 0 0 0 2 0 0;
6 0 0 0 2 1 0;
7 0 0 0 1 1 1];


model.Elt=[ Inf abs('beam1')
1 3 1 1 7 0
3 6 1 1 7 0
2 4 1 1 7 0
4 5 1 1 7 0
2 3 1 1 7 0
4 6 1 1 7 0
3 4 1 1 7 0
5 6 1 1 7 0 ];


%feplot(model);
model.pl=[ 1 fe_mat('m_elastic','SI',1) 7.2e+10 0.3 2700 ];
model.il = [ ...
1 fe_mat('p_beam','SI',1) 5e-9 5e-9 5e-9 2e-5 0 0
p_beam('dbval 2','circle 4e-3')
p_beam('dbval 3','rectangle 4e-3 3e-3')
]


model=fe_case(model,'SetCase1', ...
'FixDof','2-D motion',[.03 .04 .05]', ...
'FixDof','Clamp edge',[1 2]');


data = struct('DOF',6.02,'def',10000);


model = fe_case(model, 'AddToCase1', 'DofLoad','PointLoad',data)
model = fe_mk(model);
Load = fe_load(model,'Case1');
%from help
def = struct('def',[],'DOF',model.DOF)
kd = ofact(model.K{2}); % use the factor object for large matrices
def.def = kd\Load.def;
ofact('clear',kd); % Clear the factor when done
'ok to here'
Stress = fe_stres('stress mises',model,def);
% problem is that def.def is just the active DOFs, def.DOF is all of them, also stress mises is probably wrong for a beam element




Cheers

Greg Locock

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
 
Replies continue below

Recommended for you

Hy,

Your main problem is the def definition.
def.DOF is not equal to model.DOF but just equal to model.Stack{1,3}.DOF

The software compute the solution
>> def.def

ans =

(1,1) -1.3808e-002
(2,1) 3.3156e-002
(3,1) 3.9453e-002
(4,1) 6.9714e-003
(5,1) 4.0000e-002
(6,1) 4.0321e-002
(7,1) 7.0032e-003
(8,1) 8.7123e-002
(9,1) 3.5865e-002
(10,1) -2.0722e-002
(11,1) 8.7150e-002
(12,1) 4.0765e-002

You can animate the solution with :
feplot(model.Node,model.Elt,def.def,def.DOF)

For the stress computation, the command fe_stres generate an error :
Warning: stress computation not supported beam1

David
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor