OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
press_seg3.F
Go to the documentation of this file.
1Copyright> OpenRadioss
2Copyright> Copyright (C) 1986-2025 Altair Engineering Inc.
3Copyright>
4Copyright> This program is free software: you can redistribute it and/or modify
5Copyright> it under the terms of the GNU Affero General Public License as published by
6Copyright> the Free Software Foundation, either version 3 of the License, or
7Copyright> (at your option) any later version.
8Copyright>
9Copyright> This program is distributed in the hope that it will be useful,
10Copyright> but WITHOUT ANY WARRANTY; without even the implied warranty of
11Copyright> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12Copyright> GNU Affero General Public License for more details.
13Copyright>
14Copyright> You should have received a copy of the GNU Affero General Public License
15Copyright> along with this program. If not, see <https://www.gnu.org/licenses/>.
16Copyright>
17Copyright>
18Copyright> Commercial Alternative: Altair Radioss Software
19Copyright>
20Copyright> As an alternative to this open-source version, Altair also offers Altair Radioss
21Copyright> software under a commercial license. Contact Altair to discuss further if the
22Copyright> commercial version may interest you: https://www.altair.com/radioss/.
23!||====================================================================
24!|| press_seg3 ../engine/source/loads/general/load_pcyl/press_seg3.F
25!||--- called by ------------------------------------------------------
26!|| h3d_pre_skin_scalar ../engine/source/output/h3d/h3d_results/h3d_skin_scalar.F
27!|| h3d_skin_vector ../engine/source/output/h3d/h3d_results/h3d_skin_vector.F
28!|| pressure_cyl ../engine/source/loads/general/load_pcyl/pressure_cyl.F
29!||--- calls -----------------------------------------------------
30!|| table_interp_dydx ../engine/source/tools/curve/table_tools.F
31!||--- uses -----------------------------------------------------
32!|| pload_cyl_mod ../common_source/modules/loads/pload_cyl_mod.F
33!|| table_mod ../engine/share/modules/table_mod.F
34!||====================================================================
35 SUBROUTINE press_seg3(A ,B ,C ,N1 ,DIR ,
36 . IFUNC ,TABLE ,XFACR ,XFACT ,PRESS )
37C-----------------------------------------------
38C M o d u l e s
39C-----------------------------------------------
40 USE table_mod
42C-----------------------------------------------
43C I m p l i c i t T y p e s
44C-----------------------------------------------
45#include "implicit_f.inc"
46C-----------------------------------------------
47C C o m m o n B l o c k s
48C-----------------------------------------------
49#include "com04_c.inc"
50#include "com08_c.inc"
51C-----------------------------------------------
52C D u m m y A r g u m e n t s
53C-----------------------------------------------
54 INTEGER ,INTENT(IN) :: IFUNC
55 my_real ,INTENT(IN) :: xfacr !< radius scale factor
56 my_real ,INTENT(IN) :: xfact !< time scale factor
57 my_real ,DIMENSION(3) ,INTENT(IN) :: a,b,c,n1,dir
58 TYPE (TTABLE), DIMENSION(NTABLE) ,INTENT(IN) :: TABLE
59 my_real ,INTENT(OUT) :: press
60C-----------------------------------------------
61C L o c a l V a r i a b l e s
62C-----------------------------------------------
63 INTEGER :: NPT
64 my_real :: a11,a12,a21,a22,b1,b2,det,alpha,beta,gamma,f1,f2,r,s,
65 . r1,r2,r3,rmax,p1,p2,p3,dydx,nx,ny,nz,norm,cosp,sinp
66 my_real, DIMENSION(3) :: ab,ac,an,p,ap,bp,cp
67 my_real, DIMENSION(2) :: xx
68
69
70 INTEGER :: i
71c-----------------------------------------------
72c 1) find intersection point P between plane surface A-B-C and line N1-N2
73c 2) calculate radial coordinates of each segment node in cylindrical
74c coord system defined by direction axis
75c (distance between point P and each segment node projected
76c on plane perpendicular to axis)
77c=======================================================================
78 ab(1) = b(1) - a(1)
79 ab(2) = b(2) - a(2)
80 ab(3) = b(3) - a(3)
81 ac(1) = c(1) - a(1)
82 ac(2) = c(2) - a(2)
83 ac(3) = c(3) - a(3)
84 an(1) = n1(1) - a(1)
85 an(2) = n1(2) - a(2)
86 an(3) = n1(3) - a(3)
87 alpha = dir(1)
88 beta = dir(2)
89 gamma = dir(3)
90 npt = SIZE(table(ifunc)%X(1)%VALUES)
91 rmax = table(ifunc)%X(1)%VALUES(npt) * xfacr
92 p1 = zero
93 p2 = zero
94 p3 = zero
95c
96 IF (alpha /= zero) THEN
97 f1 = beta / alpha
98 f2 = gamma / alpha
99 b1 = an(2) - f1 * an(1)
100 b2 = an(3) - f2 * an(1)
101 a11 = ab(2) - f1 * ab(1)
102 a12 = ac(2) - f1 * ac(1)
103 a21 = ab(3) - f2 * ab(1)
104 a22 = ac(3) - f2 * ac(1)
105 ELSE IF (beta /= zero) THEN
106 f1 = alpha / beta
107 f2 = gamma / beta
108 b1 = an(1) - f1 * an(2)
109 b2 = an(3) - f2 * an(2)
110 a11 = ab(1) - f1 * ab(2)
111 a12 = ac(1) - f1 * ac(2)
112 a21 = ab(3) - f2 * ab(2)
113 a22 = ac(3) - f2 * ac(2)
114 ELSE IF (gamma /= zero) THEN
115 f1 = alpha / gamma
116 f2 = beta / gamma
117 b1 = an(1) - f1 * an(3)
118 b2 = an(2) - f2 * an(3)
119 a11 = ab(1) - f1 * ab(3)
120 a12 = ac(1) - f1 * ac(3)
121 a21 = ab(2) - f2 * ab(3)
122 a22 = ac(2) - f2 * ac(3)
123 ELSE
124 f1 = 0
125 f2 = 0
126 b1 = 0
127 b2 = 0
128 a11 = 0
129 a12 = 0
130 a21 = 0
131 a22 = 0
132 END IF
133c
134 det = a11*a22 - a12*a21
135 IF(det .NE. zero) THEN
136 r = (a22 * b1 - a12 * b2) / det
137 s = (a11 * b2 - a21 * b1) / det
138 ELSE
139 r = 0
140 s = 0
141 END IF
142 ! P = projection of axe origin N1 on ABC plane following direction DIR
143 p(1)= a(1) + r*ab(1) + s*ac(1)
144 p(2)= a(2) + r*ab(2) + s*ac(2)
145 p(3)= a(3) + r*ab(3) + s*ac(3)
146 ap(1) = p(1) - a(1)
147 ap(2) = p(2) - a(2)
148 ap(3) = p(3) - a(3)
149 bp(1) = p(1) - b(1)
150 bp(2) = p(2) - b(2)
151 bp(3) = p(3) - b(3)
152 cp(1) = p(1) - c(1)
153 cp(2) = p(2) - c(2)
154 cp(3) = p(3) - c(3)
155 r1 = sqrt(ap(1)**2 + ap(2)**2 + ap(3)**2)
156 r2 = sqrt(bp(1)**2 + bp(2)**2 + bp(3)**2)
157 r3 = sqrt(cp(1)**2 + cp(2)**2 + cp(3)**2)
158 cosp = (dir(1) * ap(1) + dir(2) * ap(2) + dir(3) * ap(3)) / max(r1,em20)
159 sinp = max(sqrt(one - cosp**2), em20)
160 p1 = zero
161 p2 = zero
162 p3 = zero
163 xx(2) = tt / xfact ! time
164c
165c pressure in 1st point of 3N sub-segment
166 cosp = (dir(1) * ap(1) + dir(2) * ap(2) + dir(3) * ap(3)) / max(r1,em20)
167 sinp = max(sqrt(one - cosp**2), em20)
168 r1 = r1 * sinp
169 IF (r1 <= rmax) THEN
170 xx(1) = r1/xfacr
171 CALL table_interp_dydx(table(ifunc),xx,2,p1,dydx)
172 END IF
173c pressure in 2nd point of 3N sub-segment
174 cosp = (dir(1) * bp(1) + dir(2) * bp(2) + dir(3) * bp(3)) / max(r2,em20)
175 sinp = max(sqrt(one - cosp**2), em20)
176 r2 = r2 * sinp
177 IF (r2 <= rmax) THEN
178 xx(1) = r2/xfacr
179 CALL table_interp_dydx(table(ifunc),xx,2,p2,dydx)
180 END IF
181c pressure in 3rd point of 3N sub-segment
182 cosp = (dir(1) * cp(1) + dir(2) * cp(2) + dir(3) * cp(3)) / max(r3,em20)
183 sinp = max(sqrt(one - cosp**2), em20)
184 r3 = r3 * sinp
185 IF (r3 <= rmax) THEN
186 xx(1) = r3/xfacr
187 CALL table_interp_dydx(table(ifunc),xx,2,p3,dydx)
188 END IF
189 press = (p1 + p2 + p3) * third
190 IF (press > zero) THEN
191c calculate cos(angle) between cylinder axis and segment normal to scale pressure
192 nx = ab(2) * ac(3) - ab(3) * ac(2)
193 ny = ab(3) * ac(1) - ab(1) * ac(3)
194 nz = ab(1) * ac(2) - ab(2) * ac(1)
195 norm = sqrt(nx**2 + ny**2 + nz**2)
196 cosp = abs(nx * alpha + ny * beta + nz * gamma) / norm
197 press = press * cosp
198 END IF
199c-----------
200 RETURN
201 END
202
#define my_real
Definition cppsort.cpp:32
norm(diag(diag(diag(inv(mat))) -id.SOL), 2) % destroy mumps instance id.JOB
subroutine table_interp_dydx(table, xx, xxdim, yy, dydx)
#define alpha
Definition eval.h:35
#define max(a, b)
Definition macros.h:21
subroutine press_seg3(a, b, c, n1, dir, ifunc, table, xfacr, xfact, press)
Definition press_seg3.F:37