OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
ebcs6.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!|| ebcs6 ../engine/source/boundary_conditions/ebcs/ebcs6.F
25!||--- called by ------------------------------------------------------
26!|| ebcs_main ../engine/source/boundary_conditions/ebcs/ebcs_main.F
27!||--- uses -----------------------------------------------------
28!|| ebcs_mod ../common_source/modules/boundary_conditions/ebcs_mod.F90
29!|| segvar_mod ../engine/share/modules/segvar_mod.F
30!||====================================================================
31 SUBROUTINE ebcs6(NSEG,ISEG,SEGVAR,
32 . A,V,X,
33 . LISTE,NOD,IRECT,
34 . RO0,EN0,P0,
35 . VO,PO,LA,
36 . MS,STIFN,EBCS)
37 USE ebcs_mod
38 USE segvar_mod
39C-----------------------------------------------
40C Pression arret initiale imposee avec impedance
41C-----------------------------------------------
42C I m p l i c i t T y p e s
43C-----------------------------------------------
44#include "implicit_f.inc"
45C-----------------------------------------------
46C C o m m o n B l o c k s
47C-----------------------------------------------
48#include "param_c.inc"
49#include "com08_c.inc"
50#include "scr11_c.inc"
51C-----------------------------------------------
52C D u m m y A r g u m e n t s
53C-----------------------------------------------
54 INTEGER NSEG,NOD,ISEG(NSEG),LISTE(NOD),IRECT(4,NSEG)
55 my_real
56 . A(3,*),X(3,*),V(3,*),LA(3,NOD),
57 . RO0(NSEG),EN0(NSEG),P0(NOD),VO(NOD),PO(NOD),
58 . MS(*),STIFN(*)
59 TYPE(t_ebcs_inip), INTENT(IN) :: EBCS
60 TYPE(t_segvar) :: SEGVAR
61C-----------------------------------------------
62C L o c a l V a r i a b l e s
63C-----------------------------------------------
64 INTEGER I,IS,KSEG,N1,N2,N3,N4,NG1,NG2,NG3,NG4,N
65 my_real orient,rho,c,lcar,roc,alp,fac,
66 . x13,y13,z13,x24,y24,z24,nx,ny,nz,s,
67 . roou,enou,vmx,vmy,vmz,fluxi,fluxo,vn,pn,du,dp,p,dpdv
68C-----------------------------------------------
69 c=ebcs%c
70 rho=ebcs%rho
71 roc=rho*c
72 lcar=ebcs%lcar
73 alp=zero
74 IF (lcar > 0) alp=c*dt1/lcar
75C Sauve densite et energie initiale
76 IF(tt == 0)THEN
77 DO is=1,nseg
78 kseg=abs(iseg(is))
79 ro0(is) = segvar%RHO(kseg)
80 en0(is) = segvar%EINT(kseg)
81 ENDDO
82 ENDIF
83C SURFACE NORMALE NODALES
84 DO i=1,nod
85 la(1,i)=zero
86 la(2,i)=zero
87 la(3,i)=zero
88 ENDDO
89C
90 DO is=1,nseg
91 kseg=abs(iseg(is))
92 orient=float(iseg(is)/kseg)
93 n1=irect(1,is)
94 n2=irect(2,is)
95 n3=irect(3,is)
96 n4=irect(4,is)
97 IF(n4 == 0 .OR. n4 == n3) THEN
98 fac=one_over_6*orient
99 n4=n3
100 ELSE
101 fac=one_over_8*orient
102 ENDIF
103c
104 ng1=liste(n1)
105 ng2=liste(n2)
106 ng3=liste(n3)
107 ng4=liste(n4)
108 x13=x(1,ng3)-x(1,ng1)
109 y13=x(2,ng3)-x(2,ng1)
110 z13=x(3,ng3)-x(3,ng1)
111 x24=x(1,ng4)-x(1,ng2)
112 y24=x(2,ng4)-x(2,ng2)
113 z24=x(3,ng4)-x(3,ng2)
114c
115 nx=(y13*z24-z13*y24)*fac
116 ny=(z13*x24-x13*z24)*fac
117 nz=(x13*y24-y13*x24)*fac
118c
119 la(1,n1)=la(1,n1)+nx
120 la(2,n1)=la(2,n1)+ny
121 la(3,n1)=la(3,n1)+nz
122 la(1,n2)=la(1,n2)+nx
123 la(2,n2)=la(2,n2)+ny
124 la(3,n2)=la(3,n2)+nz
125 la(1,n3)=la(1,n3)+nx
126 la(2,n3)=la(2,n3)+ny
127 la(3,n3)=la(3,n3)+nz
128C
129 vmx=v(1,ng1)+v(1,ng2)+v(1,ng3)
130 vmy=v(2,ng1)+v(2,ng2)+v(2,ng3)
131 vmz=v(3,ng1)+v(3,ng2)+v(3,ng3)
132 IF(n4/=n3) THEN
133 la(1,n4)=la(1,n4)+nx
134 la(2,n4)=la(2,n4)+ny
135 la(3,n4)=la(3,n4)+nz
136 vmx=vmx+v(1,ng4)
137 vmy=vmy+v(2,ng4)
138 vmz=vmz+v(3,ng4)
139 ENDIF
140C
141c bilan masse et energie totale
142c
143 roou = segvar%RHO(kseg)
144 enou = segvar%EINT(kseg)
145C
146 fluxo=(vmx*nx+vmy*ny+vmz*nz)*dt1
147 fluxi=min(fluxo,zero)
148 fluxo=max(fluxo,zero)
149C
150 dmf=dmf-fluxo*roou-fluxi*ro0(is)
151 def=def-fluxo*enou-fluxi*en0(is)
152C
153C stockage densit et nergie entrante dans buffer facette
154C
155 segvar%RHO(kseg)=ro0(is)
156 segvar%EINT(kseg)=en0(is)
157
158 ENDDO
159C
160C calcul pression initiale nodale
161C
162 IF (tt == 0) THEN
163 DO i=1,nod
164 n=liste(i)
165 s=la(1,i)**2+la(2,i)**2+la(3,i)**2
166 vn=(v(1,n)*la(1,i)+v(2,n)*la(2,i)+v(3,n)*la(3,i))/sqrt(s)
167c on memorise la pression d'arret
168 p0(i)=p0(i)/s
169 IF(vn<zero)p0(i)=p0(i)+half*rho*vn**2
170c write(6,*)'P nodale', P0(I)
171 vo(i)=vn
172 po(i)=p0(i)
173 ENDDO
174 ENDIF
175C
176 DO i=1,nod
177 n=liste(i)
178 s=sqrt(la(1,i)**2+la(2,i)**2+la(3,i)**2)
179 vn=(v(1,n)*la(1,i)+v(2,n)*la(2,i)+v(3,n)*la(3,i))/s
180 dpdv=roc
181c condition darret
182 pn=p0(i)
183 IF(vn<0)THEN
184 pn=p0(i)-half*rho*vn**2
185 dpdv=dpdv-rho*vn
186 ENDIF
187c frontiere silencieuse
188 du=roc*(vn-vo(i))
189 dp=alp*(pn-po(i))
190 p=po(i)+dp+du
191c write(6,*)'calcul', P,P0(I)
192c
193 a(1,n)=a(1,n)-p*la(1,i)
194 a(2,n)=a(2,n)-p*la(2,i)
195 a(3,n)=a(3,n)-p*la(3,i)
196 stifn(n)=stifn(n)+(two*(s*dpdv)**2)/ms(n)
197C
198 def=def-half*(po(i)+p)*dt1*vn*s
199C
200 vo(i)=vn
201 po(i)=p
202 ENDDO
203c-----------
204 RETURN
205 END
subroutine ebcs6(nseg, iseg, segvar, a, v, x, liste, nod, irect, ro0, en0, p0, vo, po, la, ms, stifn, ebcs)
Definition ebcs6.F:37
#define min(a, b)
Definition macros.h:20
#define max(a, b)
Definition macros.h:21