OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
relfram.F File Reference
#include "implicit_f.inc"
#include "com08_c.inc"
#include "param_c.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine relfram (xg, dg, vg, ag, vrg, arg, xframe, xo, do, vo, ao, xl, dl, vl, al, vrl, arl)

Function/Subroutine Documentation

◆ relfram()

subroutine relfram ( xg,
dg,
vg,
ag,
vrg,
arg,
xframe,
xo,
do,
vo,
ao,
xl,
dl,
vl,
al,
vrl,
arl )

Definition at line 28 of file relfram.F.

32C-----------------------------------------------
33C I m p l i c i t T y p e s
34C-----------------------------------------------
35#include "implicit_f.inc"
36C-----------------------------------------------
37C C o m m o n B l o c k s
38C-----------------------------------------------
39#include "com08_c.inc"
40#include "param_c.inc"
41C-----------------------------------------------
42C D u m m y A r g u m e n t s
43C-----------------------------------------------
44C REAL
46 . xg(3), vg(3), dg(3), ag(3), vrg(3), arg(3),
47 . xframe(nxframe), xo(3), vo(3), DO(3), ao(3), xl(3),
48 . dl(3), vl(3), al(3), vrl(3), arl(3)
49C-----------------------------------------------
50C L o c a l V a r i a b l e s
51C-----------------------------------------------
52 INTEGER N, K
53C REAL
55 . rot(9),rot0(9),rotdt05(9),rott05(9),
56 . omegax, omegay, omegaz, nn, cs, sn, ux, uy, uz,
57 . omegaxx, omegaxy, omegaxz, omegayy, omegayz, omegazz,
58 . o(3), om(3), w(3), dwdt(3), wom(3), ve(3), ae(3), ac(3), om2(3),
59 . dt05, drel(3), vrel(3), arel(3), vrrel(3), arrel(3)
60C-----------------------------------------------
61C S o u r c e L i n e s
62C-----------------------------------------------
63C ACTUAL FRAME POSITION & ORIENTATION WRT GLOBAL SYSTEM
64C-----------------
65C Frame position at time T (O == position of node N1).
66 o(1)=xframe(10)
67 o(2)=xframe(11)
68 o(3)=xframe(12)
69C Frame orientation at time T.
70 DO k=1,9
71 rot(k)=xframe(k)
72 ENDDO
73C-----------
74C LINEAR VELOCITY at time T-1/2 and acceleration at time T
75C are read from node N1.
76C-----------
77C-----------
78C ANGULAR VELOCITY at time T-1/2 and acceleration at time T.
79C-----------
80 w(1)=xframe(13)
81 w(2)=xframe(14)
82 w(3)=xframe(15)
83C-----------------
84C Frame orientation at time 0.
85 DO k=1,9
86 rot0(k)=xframe(18+k)
87 ENDDO
88C-----------
89C local coordinates.
90C-----------
91 om(1)=xg(1)-o(1)
92 om(2)=xg(2)-o(2)
93 om(3)=xg(3)-o(3)
94 xl(1)=rot(1)*om(1)+rot(2)*om(2)+rot(3)*om(3)
95 xl(2)=rot(4)*om(1)+rot(5)*om(2)+rot(6)*om(3)
96 xl(3)=rot(7)*om(1)+rot(8)*om(2)+rot(9)*om(3)
97C-----------
98C relative displacement at time T.
99C-----------
100C relative displacement in global frame at time T-1/2.
101 drel(1)=dg(1)-DO(1)+(rot0(1)-rot(1))*xl(1)
102 . +(rot0(4)-rot(4))*xl(2)
103 . +(rot0(7)-rot(7))*xl(3)
104 drel(2)=dg(2)-DO(2)+(rot0(2)-rot(2))*xl(1)
105 . +(rot0(5)-rot(5))*xl(2)
106 . +(rot0(8)-rot(8))*xl(3)
107 drel(3)=dg(3)-DO(3)+(rot0(3)-rot(3))*xl(1)
108 . +(rot0(6)-rot(6))*xl(2)
109 . +(rot0(9)-rot(9))*xl(3)
110C relative displacement in local frame at time T-1/2.
111 dl(1)=rot0(1)*drel(1)+rot0(2)*drel(2)+rot0(3)*drel(3)
112 dl(2)=rot0(4)*drel(1)+rot0(5)*drel(2)+rot0(6)*drel(3)
113 dl(3)=rot0(7)*drel(1)+rot0(8)*drel(2)+rot0(9)*drel(3)
114C-----------
115C vitesse d'entrainement (T-1/2).
116C-----------
117 dt05=0.5*dt1
118 om2(1)=om(1)-dt05*(vg(1)-vo(1))
119 om2(2)=om(2)-dt05*(vg(2)-vo(2))
120 om2(3)=om(3)-dt05*(vg(3)-vo(3))
121 wom(1)=w(2)*om2(3)-w(3)*om2(2)
122 wom(2)=w(3)*om2(1)-w(1)*om2(3)
123 wom(3)=w(1)*om2(2)-w(2)*om2(1)
124 ve(1)=vo(1)+wom(1)
125 ve(2)=vo(2)+wom(2)
126 ve(3)=vo(3)+wom(3)
127C-----------
128C relative velocity in global frame at time T-1/2.
129C-----------
130 vrel(1)=vg(1)-ve(1)
131 vrel(2)=vg(2)-ve(2)
132 vrel(3)=vg(3)-ve(3)
133C-----------
134C relative velocity in local frame at time T-1/2.
135C-----------
136C VL(1)=ROT(1)*VREL(1)+ROT(2)*VREL(2)+ROT(3)*VREL(3)
137C VL(2)=ROT(4)*VREL(1)+ROT(5)*VREL(2)+ROT(6)*VREL(3)
138C VL(3)=ROT(7)*VREL(1)+ROT(8)*VREL(2)+ROT(9)*VREL(3)
139C-------
140C fully consistent VL would use rotation at time T-1/2 :
141 omegax=w(1)*dt05
142 omegay=w(2)*dt05
143 omegaz=w(3)*dt05
144C
145 nn=sqrt(omegax*omegax+omegay*omegay+omegaz*omegaz)
146 cs=cos(nn)
147 sn=sin(nn)
148 nn=one/max(em20,nn)
149 omegax=omegax*nn
150 omegay=omegay*nn
151 omegaz=omegaz*nn
152C
153 omegaxx=omegax*omegax
154 omegaxy=omegax*omegay
155 omegaxz=omegax*omegaz
156 omegayy=omegay*omegay
157 omegayz=omegay*omegaz
158 omegazz=omegaz*omegaz
159C
160 ux=one - omegaxx
161 uy= -omegaxy
162 uz= -omegaxz
163 rotdt05(1)=omegaxx+cs*ux+sn*(omegay*uz-omegaz*uy)
164 rotdt05(4)=omegaxy+cs*uy+sn*(omegaz*ux-omegax*uz)
165 rotdt05(7)=omegaxz+cs*uz+sn*(omegax*uy-omegay*ux)
166C
167 ux= -omegaxy
168 uy=one - omegayy
169 uz= -omegayz
170 rotdt05(2)=omegaxy+cs*ux+sn*(omegay*uz-omegaz*uy)
171 rotdt05(5)=omegayy+cs*uy+sn*(omegaz*ux-omegax*uz)
172 rotdt05(8)=omegayz+cs*uz+sn*(omegax*uy-omegay*ux)
173C
174 ux= -omegaxz
175 uy= -omegayz
176 uz=one - omegazz
177 rotdt05(3)=omegaxz+cs*ux+sn*(omegay*uz-omegaz*uy)
178 rotdt05(6)=omegayz+cs*uy+sn*(omegaz*ux-omegax*uz)
179 rotdt05(9)=omegazz+cs*uz+sn*(omegax*uy-omegay*ux)
180C
181 nn=one/max(em20,
182 . sqrt( rotdt05(1)*rotdt05(1)
183 . +rotdt05(2)*rotdt05(2)
184 . +rotdt05(3)*rotdt05(3)))
185 rotdt05(1)=nn*rotdt05(1)
186 rotdt05(2)=nn*rotdt05(2)
187 rotdt05(3)=nn*rotdt05(3)
188 nn=one/max(em20,
189 . sqrt( rotdt05(4)*rotdt05(4)
190 . +rotdt05(5)*rotdt05(5)
191 . +rotdt05(6)*rotdt05(6)))
192 rotdt05(4)=nn*rotdt05(4)
193 rotdt05(5)=nn*rotdt05(5)
194 rotdt05(6)=nn*rotdt05(6)
195 nn=one/max(em20,
196 . sqrt( rotdt05(7)*rotdt05(7)
197 . +rotdt05(8)*rotdt05(8)
198 . +rotdt05(9)*rotdt05(9)))
199 rotdt05(7)=nn*rotdt05(7)
200 rotdt05(8)=nn*rotdt05(8)
201 rotdt05(9)=nn*rotdt05(9)
202C
203 rott05(1)=rotdt05(1)*rot(1)+rotdt05(4)*rot(2)+rotdt05(7)*rot(3)
204 rott05(2)=rotdt05(2)*rot(1)+rotdt05(5)*rot(2)+rotdt05(8)*rot(3)
205 rott05(3)=rotdt05(3)*rot(1)+rotdt05(6)*rot(2)+rotdt05(9)*rot(3)
206 rott05(4)=rotdt05(1)*rot(4)+rotdt05(4)*rot(5)+rotdt05(7)*rot(6)
207 rott05(5)=rotdt05(2)*rot(4)+rotdt05(5)*rot(5)+rotdt05(8)*rot(6)
208 rott05(6)=rotdt05(3)*rot(4)+rotdt05(6)*rot(5)+rotdt05(9)*rot(6)
209 rott05(7)=rotdt05(1)*rot(7)+rotdt05(4)*rot(8)+rotdt05(7)*rot(9)
210 rott05(8)=rotdt05(2)*rot(7)+rotdt05(5)*rot(8)+rotdt05(8)*rot(9)
211 rott05(9)=rotdt05(3)*rot(7)+rotdt05(6)*rot(8)+rotdt05(9)*rot(9)
212C
213 vl(1)=rott05(1)*vrel(1)+rott05(2)*vrel(2)+rott05(3)*vrel(3)
214 vl(2)=rott05(4)*vrel(1)+rott05(5)*vrel(2)+rott05(6)*vrel(3)
215 vl(3)=rott05(7)*vrel(1)+rott05(8)*vrel(2)+rott05(9)*vrel(3)
216C end fully consistent VL.
217C-----------
218C relative angular velocity at time T-1/2.
219C-----------
220C relative angular velocity in global frame at time T-1/2.
221 vrrel(1)=vrg(1)-w(1)
222 vrrel(2)=vrg(2)-w(2)
223 vrrel(3)=vrg(3)-w(3)
224C relative angular velocity in local frame at time T-1/2.
225 vrl(1)=rot(1)*vrrel(1)+rot(2)*vrrel(2)+rot(3)*vrrel(3)
226 vrl(2)=rot(4)*vrrel(1)+rot(5)*vrrel(2)+rot(6)*vrrel(3)
227 vrl(3)=rot(7)*vrrel(1)+rot(8)*vrrel(2)+rot(9)*vrrel(3)
228C
229C-----------
230C RELATIVE ACCELERATIONS.
231C-----------
232 dwdt(1)=xframe(16)
233 dwdt(2)=xframe(17)
234 dwdt(3)=xframe(18)
235C second order correction.
236C W(1)=W(1)+DWDT(1)*DT05
237C W(2)=W(2)+DWDT(2)*DT05
238C W(3)=W(3)+DWDT(3)*DT05
239C-----------
240C acceleration d'entrainement.
241C-----------
242 wom(1)=w(2)*om(3)-w(3)*om(2)
243 wom(2)=w(3)*om(1)-w(1)*om(3)
244 wom(3)=w(1)*om(2)-w(2)*om(1)
245 ae(1)=ao(1)+dwdt(2)*om(3)-dwdt(3)*om(2)
246 . +w(2)*wom(3)-w(3)*wom(2)
247 ae(2)=ao(2)+dwdt(3)*om(1)-dwdt(1)*om(3)
248 . +w(3)*wom(1)-w(1)*wom(3)
249 ae(3)=ao(3)+dwdt(1)*om(2)-dwdt(2)*om(1)
250 . +w(1)*wom(2)-w(2)*wom(1)
251C-----------
252C acceleration de Coriolis.
253C-----------
254C second order correction.
255C vitesse d'entrainement (T).
256C VE(1)=VO(1)+WOM(1)
257C VE(2)=VO(2)+WOM(2)
258C VE(3)=VO(3)+WOM(3)
259C relative velocity in global frame at time T.
260C VREL(1)=VG(1)-VE(1)
261C VREL(2)=VG(2)-VE(2)
262C VREL(3)=VG(3)-VE(3)
263 ac(1)=2.*(w(2)*vrel(3)-w(3)*vrel(2))
264 ac(2)=2.*(w(3)*vrel(1)-w(1)*vrel(3))
265 ac(3)=2.*(w(1)*vrel(2)-w(2)*vrel(1))
266C-----------
267C relative acceleration in global frame at time T.
268C-----------
269 arel(1)=ag(1)-ae(1)-ac(1)
270 arel(2)=ag(2)-ae(2)-ac(2)
271 arel(3)=ag(3)-ae(3)-ac(3)
272C relative acceleration in local frame at time T.
273 al(1)=rot(1)*arel(1)+rot(2)*arel(2)+rot(3)*arel(3)
274 al(2)=rot(4)*arel(1)+rot(5)*arel(2)+rot(6)*arel(3)
275 al(3)=rot(7)*arel(1)+rot(8)*arel(2)+rot(9)*arel(3)
276C
277C-----------
278C relative angular acceleration at time T.
279C-----------
280C relative angular acceleration in global frame at time T.
281 arrel(1)=arg(1)-dwdt(1)
282 arrel(2)=arg(2)-dwdt(2)
283 arrel(3)=arg(3)-dwdt(3)
284C relative angular acceleration in local frame at time T.
285 arl(1)=rot(1)*arrel(1)+rot(2)*arrel(2)+rot(3)*arrel(3)
286 arl(2)=rot(4)*arrel(1)+rot(5)*arrel(2)+rot(6)*arrel(3)
287 arl(3)=rot(7)*arrel(1)+rot(8)*arrel(2)+rot(9)*arrel(3)
288C-----------------------------------------------
289 999 CONTINUE
290 RETURN
#define my_real
Definition cppsort.cpp:32
#define max(a, b)
Definition macros.h:21