Skip to content

Commit 9b452f3

Browse files
Add Darcy permeability terms to Jacobian matrix
Co-authored-by: abrown97 <[email protected]>
1 parent 949d1a6 commit 9b452f3

File tree

1 file changed

+35
-13
lines changed

1 file changed

+35
-13
lines changed

Code/Source/solver/fluid.cpp

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,26 +1417,30 @@ void fluid_2d_m(ComMod& com_mod, const int vmsFlag, const int eNoNw, const int e
14171417

14181418
// dRm_a1/du_b1
14191419
// derivative of x-component of momentum (weak form) residual with respect to the x-component of (the acceleration at the next time step)
1420-
lK(0,a,b) = lK(0,a,b) + mu*K_inverse_darcy_permeability*wl*Nw(b)*Nw(a);
1420+
lK(0,a,b) = lK(0,a,b) + mu*K_inverse_darcy_permeability*wl*Nw(b)*Nw(a)
1421+
+ mu*K_inverse_darcy_permeability*wl*Nw(a)*updu(0,0,b);
14211422

14221423
T2 = mu*rM(1,0) + tauC*rM(0,1) + esNx(0,a)*mu_g*esNx(1,b) - rho*tauM*uaNx(a)*updu(1,0,b);
14231424

14241425
// dRm_a1/du_b2
14251426
// derivative of x-component of momentum (weak form) residual with respect to the y-component of (the acceleration at the next time step)
1426-
lK(1,a,b) = lK(1,a,b) + wl*(T2);
1427+
lK(1,a,b) = lK(1,a,b) + wl*(T2)
1428+
+ mu*K_inverse_darcy_permeability*wl*Nw(a)*updu(1,0,b);
14271429

14281430
T2 = mu*rM(0,1) + tauC*rM(1,0) + esNx(1,a)*mu_g*esNx(0,b) - rho*tauM*uaNx(a)*updu(0,1,b);
14291431

14301432
// dRm_a2/du_b1
14311433
// derivative of y-component of momentum (weak form) residual with respect to the x-component of (the acceleration at the next time step)
1432-
lK(3,a,b) = lK(3,a,b) + wl*(T2);
1434+
lK(3,a,b) = lK(3,a,b) + wl*(T2)
1435+
+ mu*K_inverse_darcy_permeability*wl*Nw(a)*updu(0,1,b);
14331436

14341437
T2 = (mu + tauC)*rM(1,1) + esNx(1,a)*mu_g*esNx(1,b) - rho*tauM*uaNx(a)*updu(1,1,b);
14351438

14361439
// dRm_a2/du_b2
14371440
// derivative of y-component of momentum (weak form) residual with respect to the y-component of (the acceleration at the next time step)
14381441
lK(4,a,b) = lK(4,a,b) + wl*(T2 + T1);
1439-
lK(4,a,b) = lK(4,a,b) + mu*K_inverse_darcy_permeability*wl*Nw(b)*Nw(a);
1442+
lK(4,a,b) = lK(4,a,b) + mu*K_inverse_darcy_permeability*wl*Nw(b)*Nw(a)
1443+
+ mu*K_inverse_darcy_permeability*wl*Nw(a)*updu(1,1,b);
14401444
}
14411445
}
14421446

@@ -2202,45 +2206,63 @@ void fluid_3d_m(ComMod& com_mod, const int vmsFlag, const int eNoNw, const int e
22022206
lK(0,a,b) = lK(0,a,b) + wl*(T2 + T1);
22032207
// lK(0,a,b) = lK(0,a,b) + mu*K_inverse_darcy_permeability*wl*Nw(b)*Nw(a);
22042208
lK(0,a,b) = lK(0,a,b) + mu*K_inverse_darcy_permeability*wl*Nw(b)*Nw(a)
2205-
+ (Res*DDir)*wl*Nw(b)*Nw(a);
2209+
+ (Res*DDir)*wl*Nw(b)*Nw(a)
2210+
+ mu*K_inverse_darcy_permeability*wl*Nw(a)*updu[0][0][b]
2211+
+ (Res*DDir)*wl*Nw(a)*updu[0][0][b];
22062212

22072213
// dRm_a1/du_b2
22082214
T2 = mu*rM[1][0] + tauC*rM[0][1] + esNx[0][a]*mu_g*esNx[1][b] - rho*tauM*uaNx[a]*updu[1][0][b];
2209-
lK(1,a,b) = lK(1,a,b) + wl*(T2);
2215+
lK(1,a,b) = lK(1,a,b) + wl*(T2)
2216+
+ mu*K_inverse_darcy_permeability*wl*Nw(a)*updu[1][0][b]
2217+
+ (Res*DDir)*wl*Nw(a)*updu[1][0][b];
22102218

22112219
// dRm_a1/du_b3
22122220
T2 = mu*rM[2][0] + tauC*rM[0][2] + esNx[0][a]*mu_g*esNx[2][b] - rho*tauM*uaNx[a]*updu[2][0][b];
2213-
lK(2,a,b) = lK(2,a,b) + wl*(T2);
2221+
lK(2,a,b) = lK(2,a,b) + wl*(T2)
2222+
+ mu*K_inverse_darcy_permeability*wl*Nw(a)*updu[2][0][b]
2223+
+ (Res*DDir)*wl*Nw(a)*updu[2][0][b];
22142224

22152225
// dRm_a2/du_b1
22162226
T2 = mu*rM[0][1] + tauC*rM[1][0] + esNx[1][a]*mu_g*esNx[0][b] - rho*tauM*uaNx[a]*updu[0][1][b];
2217-
lK(4,a,b) = lK(4,a,b) + wl*(T2);
2227+
lK(4,a,b) = lK(4,a,b) + wl*(T2)
2228+
+ mu*K_inverse_darcy_permeability*wl*Nw(a)*updu[0][1][b]
2229+
+ (Res*DDir)*wl*Nw(a)*updu[0][1][b];
22182230

22192231
// dRm_a2/du_b2
22202232
T2 = (mu + tauC)*rM[1][1] + esNx[1][a]*mu_g*esNx[1][b] - rho*tauM*uaNx[a]*updu[1][1][b];
22212233
lK(5,a,b) = lK(5,a,b) + wl*(T2 + T1);
22222234
// lK(5,a,b) = lK(5,a,b) + mu*K_inverse_darcy_permeability*wl*Nw(b)*Nw(a);
22232235
lK(5,a,b) = lK(5,a,b) + mu*K_inverse_darcy_permeability*wl*Nw(b)*Nw(a)
2224-
+ (Res*DDir)*wl*Nw(b)*Nw(a);
2236+
+ (Res*DDir)*wl*Nw(b)*Nw(a)
2237+
+ mu*K_inverse_darcy_permeability*wl*Nw(a)*updu[1][1][b]
2238+
+ (Res*DDir)*wl*Nw(a)*updu[1][1][b];
22252239

22262240
// dRm_a2/du_b3
22272241
T2 = mu*rM[2][1] + tauC*rM[1][2] + esNx[1][a]*mu_g*esNx[2][b] - rho*tauM*uaNx[a]*updu[2][1][b];
2228-
lK(6,a,b) = lK(6,a,b) + wl*(T2);
2242+
lK(6,a,b) = lK(6,a,b) + wl*(T2)
2243+
+ mu*K_inverse_darcy_permeability*wl*Nw(a)*updu[2][1][b]
2244+
+ (Res*DDir)*wl*Nw(a)*updu[2][1][b];
22292245

22302246
// dRm_a3/du_b1
22312247
T2 = mu*rM[0][2] + tauC*rM[2][0] + esNx[2][a]*mu_g*esNx[0][b] - rho*tauM*uaNx[a]*updu[0][2][b];
2232-
lK(8,a,b) = lK(8,a,b) + wl*(T2);
2248+
lK(8,a,b) = lK(8,a,b) + wl*(T2)
2249+
+ mu*K_inverse_darcy_permeability*wl*Nw(a)*updu[0][2][b]
2250+
+ (Res*DDir)*wl*Nw(a)*updu[0][2][b];
22332251

22342252
// dRm_a3/du_b2
22352253
T2 = mu*rM[1][2] + tauC*rM[2][1] + esNx[2][a]*mu_g*esNx[1][b] - rho*tauM*uaNx[a]*updu[1][2][b];
2236-
lK(9,a,b) = lK(9,a,b) + wl*(T2);
2254+
lK(9,a,b) = lK(9,a,b) + wl*(T2)
2255+
+ mu*K_inverse_darcy_permeability*wl*Nw(a)*updu[1][2][b]
2256+
+ (Res*DDir)*wl*Nw(a)*updu[1][2][b];
22372257

22382258
// dRm_a3/du_b3;
22392259
T2 = (mu + tauC)*rM[2][2] + esNx[2][a]*mu_g*esNx[2][b] - rho*tauM*uaNx[a]*updu[2][2][b];
22402260
lK(10,a,b) = lK(10,a,b) + wl*(T2 + T1);
22412261
// lK(10,a,b) = lK(10,a,b) + mu*K_inverse_darcy_permeability*wl*Nw(b)*Nw(a);
22422262
lK(10,a,b) = lK(10,a,b) + mu*K_inverse_darcy_permeability*wl*Nw(b)*Nw(a)
2243-
+ (Res*DDir)*wl*Nw(b)*Nw(a);
2263+
+ (Res*DDir)*wl*Nw(b)*Nw(a)
2264+
+ mu*K_inverse_darcy_permeability*wl*Nw(a)*updu[2][2][b]
2265+
+ (Res*DDir)*wl*Nw(a)*updu[2][2][b];
22442266
//dmsg << "lK(10,a,b): " << lK(10,a,b);
22452267
}
22462268
}

0 commit comments

Comments
 (0)