File tree Expand file tree Collapse file tree 2 files changed +32
-8
lines changed
Filter options
Expand file tree Collapse file tree 2 files changed +32
-8
lines changed
Original file line number Diff line number Diff line change @@ -151,8 +151,7 @@ export function assembleSolidHeatTransferMat(meshConfig, boundaryConditions) {
151
151
// Computation of Galerkin's residuals and Jacobian matrix
152
152
for ( let localNodeIndex1 = 0 ; localNodeIndex1 < numNodes ; localNodeIndex1 ++ ) {
153
153
let globalNodeIndex1 = localNodalNumbers [ localNodeIndex1 ] ;
154
- residualVector [ globalNodeIndex1 ] +=
155
- gaussWeights [ gaussPointIndex1 ] * detJacobian * basisFunction [ localNodeIndex1 ] ;
154
+ // residualVector is zero for this case
156
155
157
156
for ( let localNodeIndex2 = 0 ; localNodeIndex2 < numNodes ; localNodeIndex2 ++ ) {
158
157
let globalNodeIndex2 = localNodalNumbers [ localNodeIndex2 ] ;
@@ -213,11 +212,7 @@ export function assembleSolidHeatTransferMat(meshConfig, boundaryConditions) {
213
212
// Computation of Galerkin's residuals and Jacobian matrix
214
213
for ( let localNodeIndex1 = 0 ; localNodeIndex1 < numNodes ; localNodeIndex1 ++ ) {
215
214
let globalNodeIndex1 = localNodalNumbers [ localNodeIndex1 ] ;
216
- residualVector [ globalNodeIndex1 ] +=
217
- gaussWeights [ gaussPointIndex1 ] *
218
- gaussWeights [ gaussPointIndex2 ] *
219
- detJacobian *
220
- basisFunction [ localNodeIndex1 ] ;
215
+ // residualVector is zero for this case
221
216
222
217
for ( let localNodeIndex2 = 0 ; localNodeIndex2 < numNodes ; localNodeIndex2 ++ ) {
223
218
let globalNodeIndex2 = localNodalNumbers [ localNodeIndex2 ] ;
Original file line number Diff line number Diff line change @@ -154,7 +154,36 @@ export class ThermalBoundaryConditions {
154
154
} ) ;
155
155
156
156
if ( this . meshDimension === "1D" ) {
157
- // 1D code
157
+ Object . keys ( this . boundaryConditions ) . forEach ( ( boundaryKey ) => {
158
+ if ( this . boundaryConditions [ boundaryKey ] [ 0 ] === "convection" ) {
159
+ const convectionCoeff = convectionHeatTranfCoeff [ boundaryKey ] ;
160
+ const extTemp = convectionExtTemp [ boundaryKey ] ;
161
+ this . boundaryElements [ boundaryKey ] . forEach ( ( [ elementIndex , side ] ) => {
162
+ let nodeIndex ;
163
+ if ( this . elementOrder === "linear" ) {
164
+ if ( side === 0 ) {
165
+ // Node at the left side of the reference element
166
+ nodeIndex = 0 ;
167
+ } else {
168
+ // Node at the right side of the reference element
169
+ nodeIndex = 1 ;
170
+ }
171
+ } else if ( this . elementOrder === "quadratic" ) {
172
+ if ( side === 0 ) {
173
+ // Node at the left side of the reference element
174
+ nodeIndex = 0 ;
175
+ } else {
176
+ // Node at the right side of the reference element
177
+ nodeIndex = 2 ;
178
+ }
179
+ }
180
+
181
+ const globalNodeIndex = this . nop [ elementIndex ] [ nodeIndex ] - 1 ;
182
+ residualVector [ globalNodeIndex ] += - convectionCoeff * extTemp ;
183
+ jacobianMatrix [ globalNodeIndex ] [ globalNodeIndex ] += convectionCoeff ;
184
+ } ) ;
185
+ }
186
+ } ) ;
158
187
} else if ( this . meshDimension === "2D" ) {
159
188
Object . keys ( this . boundaryConditions ) . forEach ( ( boundaryKey ) => {
160
189
if ( this . boundaryConditions [ boundaryKey ] [ 0 ] === "convection" ) {
You can’t perform that action at this time.
0 commit comments