Skip to content

Commit 4d6b271

Browse files
committed
add rectangular plate example
1 parent 32c0692 commit 4d6b271

File tree

4 files changed

+1830
-2
lines changed

4 files changed

+1830
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ONSAS-examples
22

3-
This repository contains examples/scripts of problems solved using ONSAS.
4-
3+
This repository contains an open collection examples/scripts of problems solved using ONSAS.
54

5+
These scripts are shared under a [public domain license](https://en.wikipedia.org/wiki/Unlicense).

rectangularPlate/rectangularPlate.geo

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
3+
// sizes for another case: rInt = 0.05 ; rExt = 0.15 ;
4+
Lx = 2 ; Ly = 1 ;
5+
6+
ms = .08 ; //
7+
8+
Point(1) = { 0, 0, 0, ms};
9+
Point(2) = { Lx, 0, 0, ms};
10+
Point(3) = { Lx, Ly, 0, ms};
11+
Point(4) = { 0, Ly, 0, ms};
12+
13+
Line(1) = {1, 2}; //
14+
Line(2) = {2, 3}; //
15+
Line(3) = {3, 4}; //
16+
Line(4) = {4, 1}; //
17+
18+
Line Loop(1) = {1, 2, 3, 4};
19+
20+
Plane Surface(1) = {1};
21+
22+
Physical Line("00_01_01_00") = {1,3};
23+
Physical Line("00_01_00_00") = {2,4};
24+
25+
Physical Surface("01_02_02_00") = {1};

rectangularPlate/rectangularPlate.m

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
%md# Rectangular Plate test
2+
%md
3+
close all, clear all
4+
addpath( genpath( getenv('ONSAS_PATH') ) );
5+
%md Scalar parameters
6+
E = 1e3 ;
7+
nu = 0.0 ;
8+
tz = .1 ;
9+
q = 1 ;
10+
11+
materials = struct() ;
12+
materials.modelName = 'elastic-linear' ;
13+
materials.modelParams = [ E nu ] ;
14+
15+
elements = struct() ;
16+
elements(1).elemType = 'edge' ;
17+
elements(1).elemCrossSecParams = tz ;
18+
elements(2).elemType = 'triangle-plate';
19+
elements(2).elemCrossSecParams = {'thickness', tz } ;
20+
21+
% -----------------------------------------------------
22+
boundaryConds = struct() ;
23+
24+
boundaryConds(1).imposDispDofs = [ 1 3 5 ] ; % fixed nodes: 1 2 4
25+
boundaryConds(1).imposDispVals = [ 0 0 0 ] ;
26+
27+
boundaryConds(2).loadsCoordSys = 'global' ;
28+
boundaryConds(2).loadsTimeFact = @(t) t ;
29+
boundaryConds(2).loadsBaseVals = [ 0 0 0 0 -q 0 ] ; % forces in node 1
30+
31+
% -----------------------------------------------------
32+
base_msh='';
33+
if strcmp( getenv('TESTS_RUN'),'yes') && isfolder('examples'),
34+
base_msh=['.' filesep 'examples' filesep 'rectangularPlate' filesep];
35+
end
36+
mesh = struct();
37+
[ mesh.nodesCoords, mesh.conecCell ] = meshFileReader( [ base_msh 'rectangularPlate.msh'] ) ;
38+
39+
% -----------------------------------------------------
40+
initialConds = struct();
41+
%md
42+
% -----------------------------------------------------
43+
%md#### Analysis parameters
44+
%md
45+
%md The Newton-Raphson method is employed to solve 2 load steps. The ratio between `finalTime` and `deltaT` sets the number of load steps used to evaluate `boundaryConds(3).loadsTimeFact` function:
46+
analysisSettings = struct() ;
47+
analysisSettings.methodName = 'newtonRaphson' ;
48+
analysisSettings.stopTolIts = 30 ;
49+
analysisSettings.stopTolDeltau = 1.0e-12 ;
50+
analysisSettings.stopTolForces = 1.0e-12 ;
51+
analysisSettings.finalTime = 1 ;
52+
analysisSettings.deltaT = 1 ;
53+
%md
54+
%md#### Output parameters
55+
%md
56+
otherParams = struct() ;
57+
otherParams.problemName = 'rectangularPlate' ;
58+
otherParams.plots_format = 'vtk' ;
59+
%md The ONSAS software is executed for the parameters defined above and the displacement solution of each load(time) step is saved in `matUs`matrix:
60+
%md
61+
[ modelCurrSol, modelProperties, BCsData ] = ONSAS_init( materials, elements, boundaryConds, initialConds, mesh, analysisSettings, otherParams ) ;
62+
%
63+
%mdAfter that the structs are used to perform the numerical time analysis
64+
[matUs, loadFactorsMat, modelSolutions ] = ONSAS_solve( modelCurrSol, modelProperties, BCsData ) ;
65+
66+
Lx = max( mesh.nodesCoords(:,1) ) ;
67+
Ly = max( mesh.nodesCoords(:,2) ) ;
68+
I = Lx*tz^3/12 ;
69+
70+
q1D = q * Lx ;
71+
72+
theta_max_analy = q1D*Ly^3/(24*E*I ) ;
73+
delta_max_analy = 5*q1D*Ly^4/(384*E*I) ;
74+
75+
theta_max_numer = abs( max(matUs(2:6:end,2)) ) ;
76+
delta_max_numer = abs( min(matUs(5:6:end,2)) ) ;
77+
78+
verifBoolean = ( ( theta_max_analy - theta_max_numer ) < 1e-2*theta_max_analy ) && ...
79+
( ( delta_max_analy - delta_max_numer ) < 1e-2*delta_max_analy ) ;
80+

0 commit comments

Comments
 (0)