Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EnforceThermalBC.f90
Go to the documentation of this file.
1 
2 !!****
3 !!
4 !! NAME
5 !! EnforceThermalBC
6 !!
7 !! FUNCTION
8 !! Enforces imposed temperature boundary conditions.
9 !! Code may be added for time-dependant boundary conditions.
10 !!
11 !! INPUTS
12 !! NumNp -- Total number of nodes that this proc knows about
13 !! LocNumNp -- Total number of nodes assigned to this processor
14 !! disp -- Local temperature vector
15 !! node_flag -- Flags for each dof at each node as to what kind of BC is imposed
16 !! boundary_value -- The magnitudes of the imposed boundary conditions
17 !! t -- Simulation time. Used for time-dependant boundary conditions.
18 !! myid -- The rank of this processor. Mainly used for debugging purposes.
19 !!
20 !! OUTPUTS
21 !! none
22 !!
23 !! USES
24 !! none
25 !!
26 !!****
27 
28 
29 SUBROUTINE enforcethermalbc(NumNp,LocNumNp,Temp,node_flag,boundary_value,t,myid)
30 
31 USE precision
33 
34 ! Input variables
35 INTEGER :: numnp
36 REAL(kind=wp) :: t
37 REAL(kind=wp),DIMENSION(1:LocNumNp) :: temp
38 INTEGER,DIMENSION(1:NumNp,1:3) :: node_flag
39 REAL(kind=wp),DIMENSION(1:NumNp,1:3) :: boundary_value
40 INTEGER :: myid
41 
42 ! Internal variables
43 INTEGER :: i,j,counter,m
44 
45 ! Impose displacement boundary conditions
46 counter = 0
47 DO m = 1, gnumnp
48  DO i = 1, numnp
49  IF (local2global(i) == m) THEN
50  IF (nodeproc(i)==myid) THEN
51  counter = counter + 1
52  IF(node_flag(i,1) == 8) THEN ! Imposed constant nodal temperature
53  temp(counter) = boundary_value(i,1)
54  ENDIF
55  ENDIF
56  ENDIF
57  ENDDO
58 ENDDO
59 
60 
61 !
62 ! Add code here for special conditions such as time dependant BC's
63 !
64 
65 !!$print*,'NOTE: APPLYING TIME-DEPENDANT BOUNDARY CONDITIONS'
66 
67 !!$IF (t < 5) THEN
68 !!$ DO i = 1, 4
69 !!$ disp(3*(i-1)+3) = 0.0
70 !!$ v(3*(i-1)+3) = 0.0
71 !!$ a(3*(i-1)+3) = 0.0
72 !!$ ENDDO
73 !!$ELSEIF (t < 10) THEN
74 !!$ DO i = 1, 4
75 !!$ disp(3*(i-1)+3) = 0.1 * (t-5)
76 !!$ v(3*(i-1)+3) = 0.1
77 !!$ a(3*(i-1)+3) = 0.0
78 !!$ ENDDO
79 !!$ELSE
80 !!$ DO i = 1, 4
81 !!$ disp(3*(i-1)+3) = 0.5
82 !!$ v(3*(i-1)+3) = 0.0
83 !!$ a(3*(i-1)+3) = 0.0
84 !!$ ENDDO
85 !!$ENDIF
86 
87 !!$IF (t < 5) THEN
88 !!$ DO i = 1, 4
89 !!$ disp(3*(i-1)+3) = 0.0
90 !!$ v(3*(i-1)+3) = 0.0
91 !!$ a(3*(i-1)+3) = 0.0
92 !!$ ENDDO
93 !!$ELSEIF (t < 10) THEN
94 !!$ DO i = 1, 4
95 !!$ disp(3*(i-1)+3) = 0.1 * (t-5) * (t-5)
96 !!$ v(3*(i-1)+3) = 0.1 * (t-5)
97 !!$ a(3*(i-1)+3) = 0.1
98 !!$ ENDDO
99 !!$ELSE
100 !!$ DO i = 1, 4
101 !!$ disp(3*(i-1)+3) = 0.5 * (t-5)
102 !!$ v(3*(i-1)+3) = 0.5
103 !!$ a(3*(i-1)+3) = 0.0
104 !!$ ENDDO
105 !!$ENDIF
106 
107 
108 END SUBROUTINE enforcethermalbc
FT m(int i, int j) const
subroutine enforcethermalbc(NumNp, LocNumNp, Temp, node_flag, boundary_value, t, myid)
blockLoc i
Definition: read.cpp:79
j indices j
Definition: Indexing.h:6