OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
adiff3.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!|| adiff3 ../engine/source/ale/ale3d/adiff3.F
25!||--- called by ------------------------------------------------------
26!|| aeturb ../engine/source/ale/turbulence/aeturb.F
27!|| akturb ../engine/source/ale/turbulence/akturb.F
28!|| atherm ../engine/source/ale/atherm.f
29!||--- uses -----------------------------------------------------
30!|| ale_connectivity_mod ../common_source/modules/ale/ale_connectivity_mod.F
31!||====================================================================
32 SUBROUTINE adiff3(PHIN,PHI,GRAD,ALPHA,ALE_CONNECT,VOL,TEMP,RHOCP,NEL)
33C-----------------------------------------------
34C D e s c r i p t i o n
35C-----------------------------------------------
36C Solving Heat equation
37C alpha = k/rhocp is thermal diffusivity
38c coeff is k (factor simplification since originally only EINT/V was updated)
39c PHIN is EINT/V : updated at the end of the subroutine
40C TEMP : updated at the end of the subroutine.
41C Since temperature is calculated incrementally, both energy and temperature must be consistently updated.
42C-----------------------------------------------
43C M o d u l e s
44C-----------------------------------------------
46C-----------------------------------------------
47C I m p l i c i t T y p e s
48C-----------------------------------------------
49#include "implicit_f.inc"
50C-----------------------------------------------
51C G l o b a l P a r a m e t e r s
52C-----------------------------------------------
53#include "mvsiz_p.inc"
54C-----------------------------------------------
55C D u m m y A r g u m e n t s
56C-----------------------------------------------
57 INTEGER,INTENT(IN) :: NEL
58 my_real,INTENT(INOUT) :: temp(nel)
59 my_real,INTENT(INOUT) :: phin(nel) ! EINT/V
60 my_real,INTENT(IN) :: rhocp
61 my_real,INTENT(IN) :: phi(*), grad(6,nel), vol(nel)
62 my_real,INTENT(IN) :: alpha(*)
63 TYPE(t_ale_connectivity), INTENT(IN) :: ALE_CONNECT
64C-----------------------------------------------
65C C o m m o n B l o c k s
66C-----------------------------------------------
67#include "com08_c.inc"
68#include "vect01_c.inc"
69C-----------------------------------------------
70C L o c a l V a r i a b l e s
71C-----------------------------------------------
72 INTEGER I, IE, IV1, IV2, IV3, IV4, IV5, IV6, IAD2
73 my_real dphi(mvsiz)
74 my_real aa(0:6) !< thermal diffusivity (updated from ALPHA for ghost cells)
75 my_real aa_face(6) ! k = alpha * rhocp
76C-----------------------------------------------
77C S o u r c e L i n e s
78C-----------------------------------------------
79 DO i=1,nel
80 ie =nft+i
81 iad2 = ale_connect%ee_connect%iad_connect(ie)
82 iv1 = ale_connect%ee_connect%connected(iad2 + 1 - 1)
83 iv2 = ale_connect%ee_connect%connected(iad2 + 2 - 1)
84 iv3 = ale_connect%ee_connect%connected(iad2 + 3 - 1)
85 iv4 = ale_connect%ee_connect%connected(iad2 + 4 - 1)
86 iv5 = ale_connect%ee_connect%connected(iad2 + 5 - 1)
87 iv6 = ale_connect%ee_connect%connected(iad2 + 6 - 1)
88
89 ! adjacent cells (IV=0 => ghost cell with same value as IE)
90 IF(iv1 <= 0)iv1=ie
91 IF(iv2 <= 0)iv2=ie
92 IF(iv3 <= 0)iv3=ie
93 IF(iv4 <= 0)iv4=ie
94 IF(iv5 <= 0)iv5=ie
95 IF(iv6 <= 0)iv6=ie
96
97 !thermal diffusivity ( *rho0cp)
98 aa(0) = alpha(ie)
99 aa(1) = alpha(iv1)
100 aa(2) = alpha(iv2)
101 aa(3) = alpha(iv3)
102 aa(4) = alpha(iv4)
103 aa(5) = alpha(iv5)
104 aa(6) = alpha(iv6)
105 !ghost cells
106 IF(aa(1) == zero) aa(1)=aa(0)
107 IF(aa(2) == zero) aa(2)=aa(0)
108 IF(aa(3) == zero) aa(3)=aa(0)
109 IF(aa(4) == zero) aa(4)=aa(0)
110 IF(aa(5) == zero) aa(5)=aa(0)
111 IF(aa(6) == zero) aa(6)=aa(0)
112 !harmonic interpolation
113 aa_face(1) = (aa(0)*aa(1)) / max(em20,(aa(0)+aa(1)))
114 aa_face(2) = (aa(0)*aa(2)) / max(em20,(aa(0)+aa(2)))
115 aa_face(3) = (aa(0)*aa(3)) / max(em20,(aa(0)+aa(3)))
116 aa_face(4) = (aa(0)*aa(4)) / max(em20,(aa(0)+aa(4)))
117 aa_face(5) = (aa(0)*aa(5)) / max(em20,(aa(0)+aa(5)))
118 aa_face(6) = (aa(0)*aa(6)) / max(em20,(aa(0)+aa(6)))
119C-----------------------------------------------------------
120 ! time evolution
121 dphi(i) = aa_face(1) * (phi(iv1)-phi(ie))*grad(1,i)
122 2 + aa_face(2) * (phi(iv2)-phi(ie))*grad(2,i)
123 3 + aa_face(3) * (phi(iv3)-phi(ie))*grad(3,i)
124 4 + aa_face(4) * (phi(iv4)-phi(ie))*grad(4,i)
125 5 + aa_face(5) * (phi(iv5)-phi(ie))*grad(5,i)
126 6 + aa_face(6) * (phi(iv6)-phi(ie))*grad(6,i)
127 enddo!next I
128C-----------------------------------------------------------
129 ! time integration for Eint/V
130 ! %EINT is here Eint / V (J/m3)
131 ! => DPHI = is finally m.cp.dT = dT *rhoCp (ALPHA is k instead k/rhocp )
132 DO i=1,nel
133 dphi(i) = two*dphi(i)*dt1/max(vol(i),em20)
134 ENDDO
135C-----------------------------------------------------------
136 ! Eint/V updated
137 DO i=1,nel
138 phin(i) = phin(i)+dphi(i)
139 ENDDO
140C-----------------------------------------------------------
141 ! temperature updated
142 IF(rhocp > zero)THEN
143 DO i=1,nel
144 temp(i) = temp(i) + dphi(i)/rhocp
145 ENDDO
146 ENDIF
147C-----------------------------------------------------------
148 RETURN
149 END
subroutine adiff3(phin, phi, grad, alpha, ale_connect, vol, temp, rhocp, nel)
Definition adiff3.F:33
subroutine atherm(iparg, pm, elbuf_tab, flux, val2, t, ale_connect, ixs, ixq, fv, x, bufmat, tf, npf, nercvois, nesdvois, lercvois, lesdvois, lencom, ipm, matparam)
Definition atherm.F:51
#define my_real
Definition cppsort.cpp:32
#define alpha
Definition eval.h:35
#define max(a, b)
Definition macros.h:21