OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
multi_compute_dt.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!|| multi_compute_dt ../engine/source/multifluid/multi_compute_dt.F
25!||--- called by ------------------------------------------------------
26!|| alemain ../engine/source/ale/alemain.F
27!||--- uses -----------------------------------------------------
28!|| elbufdef_mod ../common_source/modules/mat_elem/elbufdef_mod.F90
29!|| initbuf_mod ../engine/share/resol/initbuf.F
30!|| multi_fvm_mod ../common_source/modules/ale/multi_fvm_mod.f90
31!||====================================================================
32 SUBROUTINE multi_compute_dt(DT2T, ELBUF_TAB, IPARG, ITASK, IXS, IXQ, IXTG,
33 . PM, IPM, MULTI_FVM, WGRID, XGRID,
34 . NELTST, ITYPTST)
35C-----------------------------------------------
36C M o d u l e s
37C-----------------------------------------------
38 USE initbuf_mod
39 USE elbufdef_mod
40 USE multi_fvm_mod
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 "com01_c.inc"
49#include "param_c.inc"
50#include "task_c.inc"
51#include "mvsiz_p.inc"
52#include "scr18_c.inc"
53#include "units_c.inc"
54#include "com08_c.inc"
55#include "comlock.inc"
56C-----------------------------------------------
57C D u m m y A r g u m e n t s
58C-----------------------------------------------
59 my_real, INTENT(OUT) :: dt2t
60 TYPE(elbuf_struct_), TARGET, DIMENSION(NGROUP) :: ELBUF_TAB
61 INTEGER, INTENT(IN) :: IPARG(NPARG, *)
62 INTEGER, INTENT(IN) :: ITASK ! SMP TASK
63 INTEGER, INTENT(IN) :: IXS(NIXS, *), IXQ(NIXQ, *), IXTG(NIXTG, *)
64 INTEGER, INTENT(IN) :: IPM(NPROPMI, *)
65 my_real, INTENT(IN) :: pm(npropm, *)
66 TYPE(multi_fvm_struct), INTENT(INOUT) :: MULTI_FVM
67 my_real, INTENT(IN) :: wgrid(*), xgrid(3, *)
68 INTEGER, INTENT(OUT) :: ITYPTST, NELTST
69C-----------------------------------------------
70C L o c a l V a r i a b l e s
71C-----------------------------------------------
72 TYPE(g_bufel_), POINTER :: GBUF
73 INTEGER :: NG, NEL, II, JJ, KFACE, I, J, NB_FACE, NFT, ITY
74 INTEGER :: IPLA
75 INTEGER :: NBMAT, IMAT
76 INTEGER :: NODE1, NODE2, NODE3, NODE4,
77 . node5, node6, node7, node8
78 my_real :: w1(3), w2(3), w3(3), w4(3),
79 . w5(3), w6(3), w7(3), w8(3)
80 my_real :: x1(3), x2(3), x3(3), x4(3),
81 . x5(3), x6(3), x7(3), x8(3)
82 my_real :: wfac(1:3), surf
83 my_real :: lambdaii, lambdaf, normuii, normujj
84 my_real :: fii(5), fjj(5), normal_vel, normal_vel2, vii(5), vjj(5), vel2
85 my_real :: dtel(mvsiz), nx, ny, nz
86 INTEGER :: ISOLNOD, MATLAW
87 LOGICAL :: l_FOUND_LOWER
88
89C Time step
90 dt2t = zero
91 ityptst = 0
92 neltst = 0
93
94 DO ng = itask + 1, ngroup, nthread
95 matlaw = iparg(1, ng)
96 IF (matlaw == 151) THEN
97 nel = iparg(2, ng)
98 nft = iparg(3, ng)
99 ity = iparg(5, ng)
100 isolnod = iparg(28, ng)
101 gbuf => elbuf_tab(ng)%GBUF
102C DELTAX is to be kept
103 gbuf%DELTAX(1:nel) = zero
104C Number of faces in an element
105 nb_face = 6
106 IF (ity == 2) THEN
107 nb_face = 4
108 ELSEIF (ity == 7) THEN
109 nb_face = 3
110 ENDIF
111
112C Flux computation
113 dtel(1:nel) = zero
114 DO ii = 1, nel
115 i = ii + nft
116C Face KFACE
117 DO kface = 1, nb_face
118 nx = multi_fvm%FACE_DATA%NORMAL(1, kface, i)
119 ny = multi_fvm%FACE_DATA%NORMAL(2, kface, i)
120 nz = multi_fvm%FACE_DATA%NORMAL(3, kface, i)
121 wfac(1:3) = multi_fvm%FACE_DATA%WFAC(1:3, kface, i)
122 surf = multi_fvm%FACE_DATA%SURF(kface, i)
123C Time step
124 normal_vel2 = (multi_fvm%VEL(1, i) - wfac(1)) * nx +
125 . (multi_fvm%VEL(2, i) - wfac(2)) * ny +
126 . (multi_fvm%VEL(3, i) - wfac(3)) * nz
127 dtel(ii) = max(dtel(ii),
128 . surf / gbuf%VOL(ii) * (multi_fvm%SOUND_SPEED(i) + abs(normal_vel2)) / dtfac1(102))
129 gbuf%DELTAX(ii) = max(gbuf%DELTAX(ii), surf / gbuf%VOL(ii))
130 ENDDO !KFACE
131 gbuf%DELTAX(ii) = one / gbuf%DELTAX(ii)
132 ENDDO ! ii = 1, nel
133C----------------------
134C Globalize time step for this group
135C----------------------
136 l_found_lower=.false.
137 DO ii = 1, nel
138 IF(dtel(ii)>zero)gbuf%DT(ii) = one/dtel(ii)
139 IF (dtel(ii) > dt2t) THEN
140 l_found_lower=.true.
141 dt2t = dtel(ii)
142 ityptst = ity
143 IF (multi_fvm%SYM == 0) THEN
144 neltst = ixs(nixs, ii + nft)
145 ELSE
146 IF (ity == 2) THEN
147C QUADS
148 neltst = ixq(nixq, ii + nft)
149 ELSEIF (ity == 7) THEN
150C TRIANGLES
151 neltst = ixtg(nixtg, ii + nft)
152 ENDIF
153 ENDIF
154 ENDIF
155 ENDDO
156
157 !CHECK IF LOWER THAN DTMIN
158 IF(l_found_lower .AND. dt2t/=zero)THEN
159 IF(one/dt2t<dtmin1(102))THEN
160 tstop = tt
161#include "lockon.inc"
162 WRITE(iout,*) ' **ERROR : TIME STEP LESS OR EQUAL DTMIN FOR ALE/EULER CELL',neltst
163 WRITE(istdo,*)' **ERROR : TIME STEP LESS OR EQUAL DTMIN FOR ALE/EULER CELL',neltst
164#include "lockoff.inc"
165 ENDIF
166 ENDIF
167
168 ENDIF
169 ENDDO ! NG = ITASK + 1, NGROUP, NTHREAD
170C----------------------
171C Global time step
172C----------------------
173 IF (dt2t > zero) THEN
174 dt2t = one / dt2t
175 ELSE
176 dt2t = ep30
177 ENDIF
178C----------------------
179C Boundary fluxes
180C----------------------
181 END SUBROUTINE multi_compute_dt
#define my_real
Definition cppsort.cpp:32
subroutine dtel(ssp, pm, geo, pid, mat, rho0, vis, deltax, aire, vol, dtx)
Definition dtel.F:46
#define max(a, b)
Definition macros.h:21
subroutine multi_compute_dt(dt2t, elbuf_tab, iparg, itask, ixs, ixq, ixtg, pm, ipm, multi_fvm, wgrid, xgrid, neltst, ityptst)