Skip to content

Commit d4cfbe2

Browse files
committed
add deployable ring example
1 parent 4d6b271 commit d4cfbe2

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22

33
This repository contains an open collection examples/scripts of problems solved using ONSAS.
44

5+
By the moment, each script requires that you have an environment variable named: `ONSAS_PATH` defined, including the path to your ONSAS folder, in order to run.
6+
57
These scripts are shared under a [public domain license](https://en.wikipedia.org/wiki/Unlicense).

deployableRing/deployableRing.m

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
%md# Deployable ring example
2+
%md---
3+
%md
4+
%mdIn this tutorial...
5+
%mdBefore defining the structs, the workspace is cleaned, the ONSAS directory is added to the path and scalar geometry and material parameters are defined.
6+
close all, clear all ;
7+
% add path
8+
addpath( genpath( [ pwd '/../../src'] ) );
9+
% material scalar parameters
10+
E = 200e3 ; nu = 0.3 ;
11+
% geometrical scalar parameters
12+
R = 120 ; ty = .6 ; tz = 6 ;
13+
% the number of elements of the mesh
14+
Nelem = 2*21 ;
15+
16+
materials.modelName = 'elastic-rotEngStr' ;
17+
materials.modelParams = [ E nu ] ;
18+
19+
elements(1).elemType = 'node' ;
20+
elements(2).elemType = 'frame' ;
21+
22+
elements(2).elemCrossSecParams{1,1} = 'rectangle' ;
23+
elements(2).elemCrossSecParams{2,1} = [ty tz] ;
24+
25+
boundaryConds(1).imposDispDofs = [ 1 2 3 4 5 6 ] ;
26+
boundaryConds(1).imposDispVals = [ 0 0 0 0 0 0 ] ;
27+
28+
boundaryConds(2).loadsCoordSys = 'global' ;
29+
boundaryConds(2).loadsTimeFact = @(t) 1e2*t ;
30+
boundaryConds(2).loadsBaseVals = [ 0 1 0 0 0 0 ] ;
31+
boundaryConds(2).imposDispDofs = [ 3 4 5 6 ] ;
32+
boundaryConds(2).imposDispVals = [ 0 0 0 0 ] ;
33+
34+
Np = Nelem +1;
35+
angles = linspace(0, 2*pi, Np )' -pi*.5 ; angles(end) = [] ;
36+
37+
mesh.nodesCoords = [ R*(1+sin( angles )) -R*cos(angles) zeros(Np-1,1) ] ;
38+
39+
mesh.conecCell = {};
40+
mesh.conecCell{ 1, 1 } = [ 0 1 1 1 ] ;
41+
mesh.conecCell{ 2, 1 } = [ 0 1 2 Nelem/2+1 ] ;
42+
for i=1:(Nelem-1),
43+
mesh.conecCell{ end+1, 1} = [ 1 2 0 i i+1 ] ;
44+
end
45+
mesh.conecCell{ end+1, 1} = [ 1 2 0 Nelem 1 ] ; % last element of the circle
46+
47+
initialConds = struct() ;
48+
49+
analysisSettings.methodName = 'arcLength' ;
50+
analysisSettings.incremArcLen = 1.5 ;
51+
analysisSettings.posVariableLoadBC = 2 ;
52+
analysisSettings.deltaT = 1 ;
53+
analysisSettings.finalTime = 1400 ;
54+
analysisSettings.stopTolDeltau = 1e-8 ;
55+
analysisSettings.stopTolForces = 1e-8 ;
56+
analysisSettings.stopTolIts = 20 ;
57+
analysisSettings.iniDeltaLamb = boundaryConds(2).loadsTimeFact(analysisSettings.deltaT)/100 ;
58+
59+
otherParams = struct();
60+
otherParams.problemName = 'deployableRing' ;
61+
otherParams.plots_format = 'vtk' ;
62+
otherParams.plots_deltaTs_separation = 5 ;
63+
64+
%md Execute ONSAS and save the results:
65+
[ modelCurrSol, modelProperties, BCsData ] = ONSAS_init( materials, elements, boundaryConds, initialConds, mesh, analysisSettings, otherParams ) ;
66+
%
67+
%mdAfter that the structs are used to perform the numerical time analysis
68+
[matUs, loadFactorsMat, modelSolutions ] = ONSAS_solve( modelCurrSol, modelProperties, BCsData ) ;
69+
%md
70+
%md the report is generated
71+
outputReport( modelProperties.outputDir, modelProperties.problemName )
72+
73+
figure
74+
plot(matUs((Nelem/2+1)*6-4,:), loadFactorsMat(:,2))

0 commit comments

Comments
 (0)