OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
find_dt_target.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!|| find_dt_target ../common_source/tools/time_step/find_dt_target.F
25!||--- called by ------------------------------------------------------
26!|| add_mass_stat ../starter/source/tools/admas/add_mass_stat.F
27!|| find_dt_for_targeted_added_mass ../engine/source/time_step/find_dt_for_targeted_added_mass.F
28!||====================================================================
29 SUBROUTINE find_dt_target(MS,STIFN,TARGET_DT_TAB,PER_ADM_TAB,DT,TMP,DTSCA,TOTMAS,NVAL,NNOD)
30C-----------------------------------------------
31C I m p l i c i t T y p e s
32C-----------------------------------------------
33#include "implicit_f.inc"
34C-----------------------------------------------
35C A n a l y s e M o d u l e
36C-----------------------------------------------
37C-----------------------------------------------
38C D u m m y A r g u m e n t s
39C-----------------------------------------------
40 INTEGER NVAL,NNOD
42 . ms(*),stifn(*),totmas,target_dt_tab(*),per_adm_tab(*),dtsca,dt(*),tmp(*)
43C-----------------------------------------------
44C C o m m o n B l o c k s
45C-----------------------------------------------
46#include "com01_c.inc"
47#include "com04_c.inc"
48#include "com06_c.inc"
49#include "units_c.inc"
50C-----------------------------------------------
51C L o c a l V a r i a b l e s
52C-----------------------------------------------
53 INTEGER I,N,COMPT,K
54 my_real sumk,sumk_old,summ,summ_old,per_adm,threshold
55C=======================================================================
56C
57C--------------------------------------------------------------------------------------
58C EXTRACTED FROM ADD_MASS_STAT in starter - used in both starter and engine
59C--------------------------------------------------------------------------------------
60C
61 sumk = zero
62 summ = zero
63 sumk_old = zero
64 summ_old = zero
65 compt = 1
66 threshold = per_adm_tab(1)
67C
68 DO i=1,nnod
69 n=nint(tmp(i))
70 ENDDO
71C
72 DO i=1,nnod
73 IF (i > 1) THEN
74 IF (dt(i) > dt(i-1)) THEN
75 sumk_old = sumk
76 summ_old = summ
77 ENDIF
78 ENDIF
79 n=nint(tmp(i))
80 per_adm = (dt(i)*sumk_old - summ_old)/(max(em20,totmas))
81 IF (i>1) THEN
82 DO WHILE ((per_adm > threshold).AND.(compt<=nval))
83 target_dt_tab(compt) = dtsca*sqrt(two*(totmas*threshold+summ_old)/max(em20,sumk_old))
84 compt = compt+1
85 IF(compt<=nval) threshold = per_adm_tab(compt)
86 ENDDO
87 IF (compt > nval) EXIT
88 ENDIF
89 sumk = sumk + stifn(n)
90 summ = summ + ms(n)
91C-- If thresholds are not crossed target dt values must be computed for the last node
92 IF (i==nnod) THEN
93 DO k=compt,nval
94 target_dt_tab(k) = dtsca*sqrt(two*(totmas*threshold+summ)/max(em20,sumk))
95 IF(k+1 <= nval) threshold = per_adm_tab(k+1)
96 ENDDO
97 ENDIF
98 ENDDO
99C
100
101 RETURN
102 END
#define my_real
Definition cppsort.cpp:32
subroutine find_dt_target(ms, stifn, target_dt_tab, per_adm_tab, dt, tmp, dtsca, totmas, nval, nnod)
#define max(a, b)
Definition macros.h:21