StructSystem system = StructSyste(id); // create a StructSystem to manage all struct objects // ... system setting Partice* p = newPartice(id, x, y, z); // create particle object system.addPartice(p); // add particle into system BaseMaterial mat = LinearElastic(id); // create Material // ... material setting BaseSection sect = Rectangle(id, width, height); // create section BaseElement* e = newBeam3D(id, p1, p2, mat, sect); // create element system.addElement(e); // add element into system system.addConstraint(pid, c); // add constraints
// time history solve for (int i = 0; i < nstep; i++) { if (i == 0) { // solve first time step system.addExternalForce(pid, force); // add external force system.solve(dt, zeta, true); system.setInternalForce(); } else { system.solve(h, zeta); system.clearParticleForce(); system.setExternalForce(pid, f); system.setInternalForce(); }
// save results system.saveParticleResult(path); system.saveElementResult(path); system.saveSupportReact(path); }
system.releaseContainers(); // relase system containers
As you can see in the above codes, using openVFIFE to conduct structure analysis is same as other FEM software. To illustrate the using of openVFIFE, several examples are list here. You can learn openVFIFE through these simple examples.
Now, let's ROCK!
Example 1
In the first example, I want to show you the moving trajectory calculation of a single paritcle, which is in horizontal projectile motion. The mass of the particle is \(10kg\), the initial speed is \(v_0 = 10m/s\), and the acceleration of gravity \(g = 9.8 m/s\). The governing equation of particle is \[
Horizontal: m\ddot{x} + c\dot{x} = 0\\\\
Vertical: m\ddot{y} + c\dot{y} = mg
\] where, \(c = m \zeta\), \(\zeta\) is the damping parameters in openVFIFE. The solution is
intmain() { // create system StructSystem system = StructSystem(1); system.setJobname("Example1");
double zeta = 0.0; cout << "Please enter a damping coefficient(>=0): " << endl; cin >> zeta;
// solve parameters double endTime = 10.0; // total time, s double h = 1.0e-3; // time step, s double v0 = 10; // initial velocity, m/s double mass = 10; // mass, kg double g = 9.8; // acceleration of gravity, m/s-2
// create particles Particle* p1 = newParticle(1, 0, 0); system.addParticle(p1); // set mass properties StdArray6d m = {mass, mass, 0, 0, 0, 0}; p1->setLumpedMass(m); // activate dof of particle p1->activateDof("Ux"); p1->activateDof("Uy");
#time ./xx.out time ./projectile.out # you will see the following information in terminal ########### StructSystem Established! ########## #Please enter a damping coefficient(>0): #0 #10000 #100 #./projectile.out 0.00s user 0.01s system 0% cpu 1.392 total
Finally the results of openVFIFE and theroy solution have been compared in the next figures.
when \(\zeta = \frac{c}{m}\) changes from 0.0 to 1.0, openVFIFE always get the right answer. All these examples are trying to tell you how to use openVFIFE, and illustrate as a verification as well. So there will be no detailed commnets on these examples. If you are interested in these examples, just email me.
Example 2
Consider a single bar structure(as shown in the following figure) , the length \(l = 10m\), the section area is \(1m^2\), Young's modulus \(E=10^6Pa\) , mass density \(\rho = 10 kg/m^3\). In this case, I want to show you how to use openVFIFE to solve static problems, and explain the influence of damping coefficient and time step.
// save model string path = system.workdir() + "/" + system.jobname() + "/model"; system.saveModel(path); system.info(); // print structsystem information
StdArray6d f1 = {100, 0, 0, 0, 0, 0}; //(x, y, z, mx, my, mz) int nStep = ceil(endTime/h); cout << nStep << endl; int interval = ceil(0.1/h); for (int i = 0; i <= nStep; i++) { if (i == 0) { system.addExternalForce(2, f1); // add external force system.solve(h, zeta, true); system.setInternalForce(); } else { system.solve(h, zeta); system.clearParticleForce(); system.setExternalForce(2, f1); system.setInternalForce(); }
// save results if (i % interval == 0) { string path = system.workdir() + "/" + system.jobname() + "/" + to_string(i*h); system.saveParticleResult(path); system.saveElementResult(path); system.saveSupportReact(path); } }
system.releaseContainers(); return0; }
when \(\Delta t = 0.01\), the axail force of the bar
\(\zeta\)
Target (N)
openVFIFE
0.0
100.0
--
0.5
100.0
100.0
1.0
100.0
100.0
Fig.3. Axial Force of The Bar
if \(\zeta= 0.0\), the axial force of the bar will not converge (umdamped free vibration); and when \(\zeta\) increased, the answer will finally converge to the static solution, and the larger \(\zeta\) is, the faster convergence is. Besides, \(\zeta\) won't affect the static solution. Hence, for static problems, large \(\zeta\) could be adopted to help converge.
The critical time step\[
\Delta t_{critical} = \frac{2l}{v_c} = \frac{2l}{\sqrt{E/\rho}}=0.0316s
\] when \(\zeta= 0.5\), the axail force of the bar
\(\Delta t\)
Target (N)
openVFIFE
0.001
100.0
100.0
0.01
100.0
100.0
0.1
100.0
nan
0.5
100.0
nan
Fig.4. Axial Force of The Bar, (a) \(\Delta t = 0.001, 0.01\), (b) \(\Delta t = 0.001, 0.01, 0.1, 0.5\),
If \(\Delta t > \Delta t_{critical}\), the solution will unconverge, hence it is important to assign time step. openVFIFE provides a autoTimeStep() function for setting proper time step automaticly.
Example 3
Ref: Ting, E.C., Y. F. Duan, T.Y. Wu. Vector Mechanics of Structure. BeiJing: Science Press, 2012. Chapter 5, example 1
Fig.5. copy from the reference textbook
Parameters \[
a = 10 m, b = 5 m;\\
P_{\alpha} = 20 N, P_{\beta} = 20N;\\
E_{\alpha} = 20000 Pa, E_{\beta} = 10000 Pa.
\] Codes: (see ./examples/example3/example3.cpp)
// save model string path = system.workdir() + "/" + system.jobname() + "/model"; system.saveModel(path); system.info(); // print structsystem information
// get the direction vector of bar1 const Eigen::Vector3d* ex = e1->ex(); StdArray6d P2 = {0, 0, 0, 0, 0, 0}; StdArray6d Pv = {0, -0.1, 0, 0, 0, 0};
int nStep = ceil(endTime/h); cout << nStep << endl; int interval = ceil(0.1/h); for (int i = 0; i <= nStep; i++) { // update P2 P2[0] = 10 * (*ex)(0); P2[1] = -10 * (*ex)(1); if (i == 0) { // add external force system.addExternalForce(2, P2); system.addExternalForce(4, Pv); system.addExternalForce(5, Pv); system.addExternalForce(6, Pv); system.solve(h, zeta, true); system.setInternalForce(); } else { system.solve(h, zeta); system.clearParticleForce(); // add external force system.addExternalForce(2, P2); system.addExternalForce(4, Pv); system.addExternalForce(5, Pv); system.addExternalForce(6, Pv); system.setInternalForce(); }
// save results if (i % interval == 0) { string path = system.workdir() + "/" + system.jobname() + "/" + to_string(i); system.saveModel(path); system.saveParticleResult(path); system.saveElementResult(path); system.saveSupportReact(path); } }
system.releaseContainers(); return0; }
Fig.8. movement of the structure
Example 5
In example 1, a planar three-bar truss subjected to a load \(P\) in the \(y\) is analyzed, as shown in Fig.9. The cross-sectional area (\(A\)) of bars is \(1m^2\); the length (\(L_{BD}\) is \(1m\); \(\ang ADB = \ang CDB = 45^ \circ\). different plastic material models are considered: an ideal elastic-plastic model and an elastic linear hardening model, as shown in Fig.11. The density (\(\rho\)) of the bars is \(7850kg\). Young's modulus \(E\) is \(206GPa\) in the elastic state; the tangent modulus $Et $ is \(20.6GPa\) in the plastic state; and the yield stress (\(\sigma _y\)) is \(235MPa\).
// create material double E = 2.06e11; double yield_stress = 2.35e8; double Et = 2.06e10; double m = 0; UniBilinear mat = UniBilinear(1, E, Et, yield_stress, m); mat.setDensity(7850); // LinearElastic mat = LinearElastic(1); // mat.setE(E); // mat.setDensity(7850);
To illustrate the capability of VFIFE in geometric nonlinear analysis, and to test the Link3DLD element, a 24-member shallow dome (as shown in Fig.13) is analyzed by openVFIFE. The topological relationship between elements and particles is depicted in Fig.11, as well as geometry information. The density \(\rho\) of the bars is \(20lb/in^3\); Young’s modulus \(E\) is \(10^6ksi\); and the cross-sectional area (A) of the bars is \(0.1in^2\). A concentrated force \(P\) is imposed on node 1 in the \(z\) direction.
// create elements for (int i = 0; i < elements.size(); i++) { int id = elements[i].id; int p1 = elements[i].p1; int p2 = elements[i].p2; Link3DLD* e = newLink3DLD(id, particles[p1], particles[p2], &mat, §); system.addElement(e); }