Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HeatFluxLoad.f90
Go to the documentation of this file.
1 !*********************************************************************
2 !* Illinois Open Source License *
3 !* *
4 !* University of Illinois/NCSA *
5 !* Open Source License *
6 !* *
7 !* Copyright@2008, University of Illinois. All rights reserved. *
8 !* *
9 !* Developed by: *
10 !* *
11 !* Center for Simulation of Advanced Rockets *
12 !* *
13 !* University of Illinois *
14 !* *
15 !* www.csar.uiuc.edu *
16 !* *
17 !* Permission is hereby granted, free of charge, to any person *
18 !* obtaining a copy of this software and associated documentation *
19 !* files (the "Software"), to deal with the Software without *
20 !* restriction, including without limitation the rights to use, *
21 !* copy, modify, merge, publish, distribute, sublicense, and/or *
22 !* sell copies of the Software, and to permit persons to whom the *
23 !* Software is furnished to do so, subject to the following *
24 !* conditions: *
25 !* *
26 !* *
27 !* @ Redistributions of source code must retain the above copyright *
28 !* notice, this list of conditions and the following disclaimers. *
29 !* *
30 !* @ Redistributions in binary form must reproduce the above *
31 !* copyright notice, this list of conditions and the following *
32 !* disclaimers in the documentation and/or other materials *
33 !* provided with the distribution. *
34 !* *
35 !* @ Neither the names of the Center for Simulation of Advanced *
36 !* Rockets, the University of Illinois, nor the names of its *
37 !* contributors may be used to endorse or promote products derived *
38 !* from this Software without specific prior written permission. *
39 !* *
40 !* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
41 !* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
42 !* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
43 !* NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR *
44 !* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
45 !* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
46 !* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
47 !* USE OR OTHER DEALINGS WITH THE SOFTWARE. *
48 !*********************************************************************
49 !* Please acknowledge The University of Illinois Center for *
50 !* Simulation of Advanced Rockets in works and publications *
51 !* resulting from this software or its derivatives. *
52 !*********************************************************************
53 SUBROUTINE heatfluxload(Rnet,NumNP, &
54  interfacenumelems, interfacenumnodes, &
55  interfaceelemconn, &
56  mapnode,lwrbnd,uppbnd, coor, mapsfelvolel,&
57  elconnvol,ieltype,numelvol,bcqflux)
58 
59  IMPLICIT NONE
60 
61 ! 1-3 for 4 node tet (i.e. 3 node triangles)
62 ! 4-6 for 10 node tet (i.e. 6 node triangles, mid-side nodes get traction)
63 
64 ! Computes the traction due to a dummy implied traction
65 
66 ! Applied to the deformed Configuration
67 
68  INTEGER :: lwrbnd,uppbnd
69 
70  INTEGER :: ieltype,numelvol
71  INTEGER, DIMENSION(1:iElType,1:NumElVol) :: elconnvol
72 
73  INTEGER :: interfacenumelems,interfacenumnodes
74  INTEGER, DIMENSION(1:UppBnd,1:InterfaceNumElems) :: interfaceelemconn
75 
76  INTEGER :: numnp ! number of nodes
77 
78  INTEGER, DIMENSION(1:InterfaceNumNodes) :: mapnode
79 
80  REAL*8, DIMENSION(1:numnp) :: rnet ! external force
81 
82  INTEGER :: i
83 
84  INTEGER,DIMENSION(1:3) :: triconn
85 
86 ! Array of imposed fluxes on fluid/solid interface
87  REAL*8,DIMENSION(1:InterfaceNumElems) :: bcqflux
88 
89  INTEGER, DIMENSION(1:NumElVol) :: mapsfelvolel
90 
91 ! mesh coordinates
92  REAL*8, DIMENSION(1:3,1:numnp) :: coor
93 ! REAL*8, DIMENSION(1:3,1:numnp) :: disp
94 
95  REAL*8 :: x0p,y0p,z0p
96  REAL*8 :: x1p,y1p,z1p
97  REAL*8 :: x2p,y2p,z2p
98  REAL*8 :: x3p,y3p,z3p
99 
100 ! Components sides vector
101 
102  REAL*8 :: x1x0, y1y0, z1z0
103  REAL*8 :: x2x0, y2y0, z2z0
104 
105  REAL*8 :: xnorm, area
106 
107 
108 
109  DO i = 1, interfacenumelems
110 
111 ! Nodes of the Triangle ( Vertex Nodes )
112 
113  triconn(1:3) = interfaceelemconn(1:3,i)
114 
115 ! Uses the fact that the norm of the cross product vector
116 ! is the area of the parallelogram they form. The triangle they
117 ! form has half that area.
118 
119  x0p = coor(1,mapnode(triconn(1))) !+ Disp(3*MapNode(TriConn(1))-2)
120  y0p = coor(2,mapnode(triconn(1))) !+ Disp(3*MapNode(TriConn(1))-1)
121  z0p = coor(3,mapnode(triconn(1))) !+ Disp(3*MapNode(TriConn(1)))
122 
123  x1p = coor(1,mapnode(triconn(2))) !+ Disp(3*MapNode(TriConn(2))-2)
124  y1p = coor(2,mapnode(triconn(2))) !+ Disp(3*MapNode(TriConn(2))-1)
125  z1p = coor(3,mapnode(triconn(2))) !+ Disp(3*MapNode(TriConn(2)))
126 
127  x2p = coor(1,mapnode(triconn(3))) !+ Disp(3*MapNode(TriConn(3))-2)
128  y2p = coor(2,mapnode(triconn(3))) !+ Disp(3*MapNode(TriConn(3))-1)
129  z2p = coor(3,mapnode(triconn(3))) !+ Disp(3*MapNode(TriConn(3)))
130 
131 ! Find vector componets of the sides
132 
133  x1x0 = x1p - x0p
134  y1y0 = y1p - y0p
135  z1z0 = z1p - z0p
136 
137  x2x0 = x2p - x0p
138  y2y0 = y2p - y0p
139  z2z0 = z2p - z0p
140 
141 ! Take the cross product
142 
143  x3p = y1y0 * z2z0 - z1z0 * y2y0
144  y3p = z1z0 * x2x0 - x1x0 * z2z0
145  z3p = x1x0 * y2y0 - y1y0 * x2x0
146 
147 ! Computes the Euclidean norm of a vector in 3D
148 
149  xnorm = sqrt( x3p*x3p + y3p*y3p + z3p*z3p )
150 !
151 ! Area of the triangle is half the area of the parallelogram
152 ! determined by the cross product of the vectors P12 and P13
153 
154  area = 0.5d0*xnorm
155 
156 
157 ! Assembly into global load vector Rnet
158 
159  triconn(1:3) = interfaceelemconn(lwrbnd:uppbnd,i)
160 
161  rnet(mapnode(triconn(1))) = rnet(mapnode(triconn(1))) + bcqflux(i)*area/3.d0
162  rnet(mapnode(triconn(2))) = rnet(mapnode(triconn(2))) + bcqflux(i)*area/3.d0
163  rnet(mapnode(triconn(3))) = rnet(mapnode(triconn(3))) + bcqflux(i)*area/3.d0
164 
165  ENDDO
166 
167  RETURN
168 
169 END SUBROUTINE heatfluxload
170 
double sqrt(double d)
Definition: double.h:73
subroutine heatfluxload(Rnet, NumNP, InterfaceNumElems, InterfaceNumNodes, InterfaceElemConn, MapNode, LwrBnd, UppBnd, Coor, MapSFElVolEl, ElConnVol, iElType, NumElVol, BCqflux)
blockLoc i
Definition: read.cpp:79