Skip to content

Commit 3e03138

Browse files
authored
Merge branch 'main' into issue-525
2 parents 9d6266b + 5118d56 commit 3e03138

19 files changed

Lines changed: 912 additions & 129 deletions

File tree

Code/Source/solver/ComMod.h

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1469,6 +1469,12 @@ class urisType
14691469
// Valve surface position coordinates.
14701470
Array<double> x;
14711471

1472+
// Valve position coordinates at the previous time step.
1473+
Array<double> x_prev;
1474+
1475+
// Valve velocity on the valve surface nodes.
1476+
Array<double> valve_velocity;
1477+
14721478
// Valve displacement.
14731479
Array<double> Yd;
14741480

@@ -1493,6 +1499,9 @@ class urisType
14931499
// this assumption, this flag should be set to true to flip the normals.
14941500
bool invert_normal;
14951501

1502+
// Whether to include the valve velocity in the RIS implementation. Default is false.
1503+
bool include_uris_velocity = false;
1504+
14961505
// Opening positions of the valve surfaces.
14971506
Array3<double> DxOpen;
14981507

@@ -1508,9 +1517,15 @@ class urisType
15081517
// Iteration count.
15091518
int cnt = 1000000;
15101519

1511-
// Signed distance function indexed by fluid/background mesh node.
1520+
// Flag to indicate if the SDF is computed.
1521+
bool sdf_computed = false;
1522+
1523+
// Signed distance function indexed by backgroundfluid mesh node.
15121524
Vector<double> sdf;
15131525

1526+
// Valve velocity interpolated on background fluid mesh nodes.
1527+
Array<double> valve_velocity_fluid;
1528+
15141529
// Mesh scale factor.
15151530
double scF;
15161531

Code/Source/solver/Parameters.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2990,6 +2990,7 @@ URISMeshParameters::URISMeshParameters()
29902990
set_parameter("Valve_starts_as_closed", true, !required, valve_starts_as_closed);
29912991
set_parameter("Invert_normal", false, !required, invert_normal);
29922992
set_parameter("Positive_flow_normal_file_path", "", !required, positive_flow_normal_file_path);
2993+
set_parameter("Include_URIS_velocity", false, !required, include_uris_velocity);
29932994
}
29942995

29952996
void URISMeshParameters::print_parameters()

Code/Source/solver/Parameters.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1786,7 +1786,7 @@ class URISMeshParameters : public ParameterLists
17861786
Parameter<bool> valve_starts_as_closed; // Whether the valve starts as closed
17871787
Parameter<bool> invert_normal; // Whether to invert the valve surface normal vector
17881788
Parameter<std::string> positive_flow_normal_file_path; // File path for the positive flow normal
1789-
1789+
Parameter<bool> include_uris_velocity; // Whether to include the RIS velocity
17901790
};
17911791

17921792

Code/Source/solver/distribute.cpp

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,6 +1179,8 @@ void dist_uris(ComMod& com_mod, const CmMod& cm_mod, const cmType& cm) {
11791179
cm.bcast(cm_mod, &uris[iUris].resistance);
11801180
cm.bcast(cm_mod, &uris[iUris].clsFlg);
11811181
cm.bcast(cm_mod, &uris[iUris].invert_normal);
1182+
cm.bcast(cm_mod, &uris[iUris].sdf_computed);
1183+
cm.bcast(cm_mod, &uris[iUris].include_uris_velocity);
11821184
cm.bcast(cm_mod, &uris[iUris].cnt);
11831185
cm.bcast(cm_mod, &uris[iUris].scF);
11841186
cm.bcast(cm_mod, uris[iUris].nrm);
@@ -1300,8 +1302,8 @@ void dist_uris(ComMod& com_mod, const CmMod& cm_mod, const cmType& cm) {
13001302
int n;
13011303
if (cm.mas(cm_mod)) {
13021304
for (int iUris = 0; iUris < com_mod.nUris; iUris++) {
1303-
OpenN(iUris) = uris[iUris].DxOpen.nrows();
1304-
CloseN(iUris) = uris[iUris].DxClose.nrows();
1305+
OpenN(iUris) = uris[iUris].DxOpen.nslices();
1306+
CloseN(iUris) = uris[iUris].DxClose.nslices();
13051307
DxOpenFlatSize(iUris) = uris[iUris].DxOpen.size();
13061308
DxCloseFlatSize(iUris) = uris[iUris].DxClose.size();
13071309
DxOpenFlat[iUris].resize(DxOpenFlatSize(iUris));
@@ -1334,12 +1336,16 @@ void dist_uris(ComMod& com_mod, const CmMod& cm_mod, const cmType& cm) {
13341336

13351337
if (cm.slv(cm_mod)) {
13361338
for (int iUris = 0; iUris < com_mod.nUris; iUris++) {
1337-
uris[iUris].DxOpen.resize(OpenN(iUris), com_mod.nsd, uris[iUris].tnNo);
1338-
uris[iUris].DxClose.resize(CloseN(iUris), com_mod.nsd, uris[iUris].tnNo);
1339+
uris[iUris].DxOpen.resize(com_mod.nsd, uris[iUris].tnNo, OpenN(iUris));
1340+
uris[iUris].DxClose.resize(com_mod.nsd, uris[iUris].tnNo, CloseN(iUris));
13391341
uris[iUris].x.resize(com_mod.nsd, uris[iUris].tnNo);
13401342
uris[iUris].Yd.resize(com_mod.nsd, uris[iUris].tnNo);
13411343
DxOpenFlat[iUris].resize(DxOpenFlatSize(iUris));
13421344
DxCloseFlat[iUris].resize(DxCloseFlatSize(iUris));
1345+
if (uris[iUris].include_uris_velocity) {
1346+
uris[iUris].x_prev.resize(com_mod.nsd, uris[iUris].tnNo);
1347+
uris[iUris].valve_velocity.resize(com_mod.nsd, uris[iUris].tnNo);
1348+
}
13431349
}
13441350
}
13451351

@@ -1348,6 +1354,10 @@ void dist_uris(ComMod& com_mod, const CmMod& cm_mod, const cmType& cm) {
13481354
cm.bcast(cm_mod, uris[iUris].Yd);
13491355
cm.bcast(cm_mod, DxOpenFlat[iUris]);
13501356
cm.bcast(cm_mod, DxCloseFlat[iUris]);
1357+
if (uris[iUris].include_uris_velocity) {
1358+
cm.bcast(cm_mod, uris[iUris].x_prev);
1359+
cm.bcast(cm_mod, uris[iUris].valve_velocity);
1360+
}
13511361
}
13521362

13531363
if (cm.slv(cm_mod)) {

Code/Source/solver/fluid.cpp

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -621,9 +621,10 @@ void construct_fluid(ComMod& com_mod, const mshType& lM, const SolutionStates& s
621621
Array<double> ksix(nsd,nsd);
622622
// Total resistance factor value of the RIS valves for the current element
623623
// at different quadrature points
624-
Vector<double> risFactorTotalEl;
624+
Vector<double> urisFactorTotalEl;
625+
Array<double> urisValveVelTermTotalEl;
625626
if (com_mod.urisFlag) {
626-
uris::uris_compute_ris_factor(com_mod, lM, fs[0], e, risFactorTotalEl);
627+
uris::eval_uris_ris_factors_quadrature(com_mod, lM, fs[0], e, urisFactorTotalEl, urisValveVelTermTotalEl);
627628
}
628629

629630
for (int g = 0; g < fs[0].nG; g++) {
@@ -660,13 +661,15 @@ void construct_fluid(ComMod& com_mod, const mshType& lM, const SolutionStates& s
660661
if (nsd == 3) {
661662
auto N0 = fs[0].N.rcol(g);
662663
auto N1 = fs[1].N.rcol(g);
663-
double risFactorTotal = 0.0;
664+
double urisFactorTotal = 0.0;
665+
Vector<double> urisValveVelTermTotal(nsd);
664666
if (com_mod.urisFlag) {
665-
risFactorTotal = risFactorTotalEl(g);
667+
urisFactorTotal = urisFactorTotalEl(g);
668+
urisValveVelTermTotal = urisValveVelTermTotalEl.rcol(g);
666669
}
667670
fluid_3d_m(com_mod, vmsStab, fs[0].eNoN, fs[1].eNoN, w, ksix, N0, N1,
668671
Nwx, Nqx, Nwxx, al, yl, bfl, lR, lK, K_inverse_darcy_permeability,
669-
risFactorTotal);
672+
urisFactorTotal, urisValveVelTermTotal);
670673

671674
} else if (nsd == 2) {
672675
auto N0 = fs[0].N.rcol(g);
@@ -694,8 +697,8 @@ void construct_fluid(ComMod& com_mod, const mshType& lM, const SolutionStates& s
694697
// If the number of quadrature points is different for the continuity and
695698
// momentum function spaces, recompute the RIS factor
696699
if (com_mod.urisFlag) {
697-
if (static_cast<int>(risFactorTotalEl.size()) != fs[1].nG) {
698-
uris::uris_compute_ris_factor(com_mod, lM, fs[1], e, risFactorTotalEl);
700+
if (urisFactorTotalEl.size() != fs[1].nG) {
701+
uris::eval_uris_ris_factors_quadrature(com_mod, lM, fs[1], e, urisFactorTotalEl, urisValveVelTermTotalEl);
699702
}
700703
}
701704

@@ -724,13 +727,15 @@ void construct_fluid(ComMod& com_mod, const mshType& lM, const SolutionStates& s
724727
if (nsd == 3) {
725728
auto N0 = fs[0].N.rcol(g);
726729
auto N1 = fs[1].N.rcol(g);
727-
double risFactorTotal = 0.0;
730+
double urisFactorTotal = 0.0;
731+
Vector<double> urisValveVelTermTotal(nsd);
728732
if (com_mod.urisFlag) {
729-
risFactorTotal = risFactorTotalEl(g);
733+
urisFactorTotal = urisFactorTotalEl(g);
734+
urisValveVelTermTotal = urisValveVelTermTotalEl.rcol(g);
730735
}
731736
fluid_3d_c(com_mod, vmsStab, fs[0].eNoN, fs[1].eNoN, w, ksix, N0, N1,
732737
Nwx, Nqx, Nwxx, al, yl, bfl, lR, lK, K_inverse_darcy_permeability,
733-
risFactorTotal);
738+
urisFactorTotal, urisValveVelTermTotal);
734739

735740
} else if (nsd == 2) {
736741
auto N0 = fs[0].N.rcol(g);
@@ -1439,7 +1444,7 @@ void fluid_3d_c(ComMod& com_mod, const int vmsFlag, const int eNoNw, const int e
14391444
const Array<double>& Kxi, const Vector<double>& Nw, const Vector<double>& Nq, const Array<double>& Nwx,
14401445
const Array<double>& Nqx, const Array<double>& Nwxx, const Array<double>& al, const Array<double>& yl,
14411446
const Array<double>& bfl, Array<double>& lR, Array3<double>& lK, double K_inverse_darcy_permeability,
1442-
double risFactorTotal)
1447+
const double urisFactorTotal, const Vector<double>& urisValveVelTermTotal)
14431448
{
14441449
#define n_debug_fluid3d_c
14451450
#ifdef debug_fluid3d_c
@@ -1654,7 +1659,7 @@ void fluid_3d_c(ComMod& com_mod, const int vmsFlag, const int eNoNw, const int e
16541659

16551660
// In case of unfitted RIS, compute the delta function at the quad point,
16561661
// add the additional value to the stabilization param
1657-
kT = kT + pow(risFactorTotal, 2.0);
1662+
kT = kT + pow(urisFactorTotal, 2.0);
16581663

16591664
double kU = u[0]*u[0]*Kxi(0,0) + u[1]*u[0]*Kxi(1,0) + u[2]*u[0]*Kxi(2,0)
16601665
+ u[0]*u[1]*Kxi(0,1) + u[1]*u[1]*Kxi(1,1) + u[2]*u[1]*Kxi(2,1)
@@ -1682,11 +1687,11 @@ void fluid_3d_c(ComMod& com_mod, const int vmsFlag, const int eNoNw, const int e
16821687
// up[2] = -tauM*(rho*rV[2] + px[2] - rS[2] + mu*K_inverse_darcy_permeability*u[2]);
16831688

16841689
up[0] = -tauM*(rho*rV[0] + px[0] - rS[0] + mu*K_inverse_darcy_permeability*u[0]
1685-
+ risFactorTotal*u[0]);
1690+
+ urisFactorTotal*u[0] - urisValveVelTermTotal[0]);
16861691
up[1] = -tauM*(rho*rV[1] + px[1] - rS[1] + mu*K_inverse_darcy_permeability*u[1]
1687-
+ risFactorTotal*u[1]);
1692+
+ urisFactorTotal*u[1] - urisValveVelTermTotal[1]);
16881693
up[2] = -tauM*(rho*rV[2] + px[2] - rS[2] + mu*K_inverse_darcy_permeability*u[2]
1689-
+ risFactorTotal*u[2]);
1694+
+ urisFactorTotal*u[2] - urisValveVelTermTotal[2]);
16901695

16911696
for (int a = 0; a < eNoNw; a++) {
16921697
double uNx = u[0]*Nwx(0,a) + u[1]*Nwx(1,a) + u[2]*Nwx(2,a);
@@ -1695,7 +1700,7 @@ void fluid_3d_c(ComMod& com_mod, const int vmsFlag, const int eNoNw, const int e
16951700
T1 = -rho*uNx + mu*(Nwxx(0,a) + Nwxx(1,a) + Nwxx(2,a))
16961701
+ mu_x[0]*Nwx(0,a) + mu_x[1]*Nwx(1,a) + mu_x[2]*Nwx(2,a)
16971702
- mu*K_inverse_darcy_permeability*Nw(a)
1698-
- risFactorTotal*Nw(a);
1703+
- urisFactorTotal*Nw(a);
16991704

17001705
updu[0][0][a] = mu_x[0]*Nwx(0,a) + d2u2[0]*mu_g*esNx[0][a] + T1;
17011706
updu[1][0][a] = mu_x[1]*Nwx(0,a) + d2u2[1]*mu_g*esNx[0][a];
@@ -1764,7 +1769,7 @@ void fluid_3d_m(ComMod& com_mod, const int vmsFlag, const int eNoNw, const int e
17641769
const Array<double>& Kxi, const Vector<double>& Nw, const Vector<double>& Nq, const Array<double>& Nwx,
17651770
const Array<double>& Nqx, const Array<double>& Nwxx, const Array<double>& al, const Array<double>& yl,
17661771
const Array<double>& bfl, Array<double>& lR, Array3<double>& lK, double K_inverse_darcy_permeability,
1767-
double risFactorTotal)
1772+
const double urisFactorTotal, const Vector<double>& urisValveVelTermTotal)
17681773
{
17691774
#define n_debug_fluid_3d_m
17701775
#ifdef debug_fluid_3d_m
@@ -2000,7 +2005,7 @@ void fluid_3d_m(ComMod& com_mod, const int vmsFlag, const int eNoNw, const int e
20002005

20012006
// In case of unfitted RIS, compute the delta function at the quad point,
20022007
// add the additional value to the stabilization param
2003-
kT = kT + pow(risFactorTotal, 2.0);
2008+
kT = kT + pow(urisFactorTotal, 2.0);
20042009

20052010
double kU = u[0]*u[0]*Kxi(0,0) + u[1]*u[0]*Kxi(1,0) + u[2]*u[0]*Kxi(2,0)
20062011
+ u[0]*u[1]*Kxi(0,1) + u[1]*u[1]*Kxi(1,1) + u[2]*u[1]*Kxi(2,1)
@@ -2035,11 +2040,11 @@ void fluid_3d_m(ComMod& com_mod, const int vmsFlag, const int eNoNw, const int e
20352040
// up[2] = -tauM*(rho*rV[2] + px[2] - rS[2] + mu*K_inverse_darcy_permeability * u[2]);
20362041

20372042
up[0] = -tauM*(rho*rV[0] + px[0] - rS[0] + mu*K_inverse_darcy_permeability * u[0]
2038-
+ risFactorTotal * u[0]);
2043+
+ urisFactorTotal * u[0] - urisValveVelTermTotal[0]);
20392044
up[1] = -tauM*(rho*rV[1] + px[1] - rS[1] + mu*K_inverse_darcy_permeability * u[1]
2040-
+ risFactorTotal * u[1]);
2045+
+ urisFactorTotal * u[1] - urisValveVelTermTotal[1]);
20412046
up[2] = -tauM*(rho*rV[2] + px[2] - rS[2] + mu*K_inverse_darcy_permeability * u[2]
2042-
+ risFactorTotal * u[2]);
2047+
+ urisFactorTotal * u[2] - urisValveVelTermTotal[2]);
20432048

20442049
double tauC, tauB, pa;
20452050
double eps = std::numeric_limits<double>::epsilon();
@@ -2121,7 +2126,7 @@ void fluid_3d_m(ComMod& com_mod, const int vmsFlag, const int eNoNw, const int e
21212126
T1 = -rho*uNx[a] + mu*(Nwxx(0,a) + Nwxx(1,a) + Nwxx(2,a))
21222127
+ mu_x[0]*Nwx(0,a) + mu_x[1]*Nwx(1,a) + mu_x[2]*Nwx(2,a)
21232128
- mu*K_inverse_darcy_permeability*Nw(a)
2124-
- risFactorTotal*Nw(a);
2129+
- urisFactorTotal*Nw(a);
21252130

21262131
updu[0][0][a] = mu_x[0]*Nwx(0,a) + d2u2[0]*mu_g*esNx[0][a] + T1;
21272132
updu[1][0][a] = mu_x[1]*Nwx(0,a) + d2u2[1]*mu_g*esNx[0][a];
@@ -2158,7 +2163,7 @@ void fluid_3d_m(ComMod& com_mod, const int vmsFlag, const int eNoNw, const int e
21582163
lK(0,a,b) = lK(0,a,b) + wl*(T2 + T1);
21592164
// lK(0,a,b) = lK(0,a,b) + mu*K_inverse_darcy_permeability*wl*Nw(b)*Nw(a);
21602165
lK(0,a,b) = lK(0,a,b) + mu*K_inverse_darcy_permeability*wl*Nw(b)*Nw(a)
2161-
+ risFactorTotal*wl*Nw(b)*Nw(a);
2166+
+ urisFactorTotal*wl*Nw(b)*Nw(a);
21622167

21632168
// dRm_a1/du_b2
21642169
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];
@@ -2177,7 +2182,7 @@ void fluid_3d_m(ComMod& com_mod, const int vmsFlag, const int eNoNw, const int e
21772182
lK(5,a,b) = lK(5,a,b) + wl*(T2 + T1);
21782183
// lK(5,a,b) = lK(5,a,b) + mu*K_inverse_darcy_permeability*wl*Nw(b)*Nw(a);
21792184
lK(5,a,b) = lK(5,a,b) + mu*K_inverse_darcy_permeability*wl*Nw(b)*Nw(a)
2180-
+ risFactorTotal*wl*Nw(b)*Nw(a);
2185+
+ urisFactorTotal*wl*Nw(b)*Nw(a);
21812186

21822187
// dRm_a2/du_b3
21832188
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];
@@ -2196,7 +2201,7 @@ void fluid_3d_m(ComMod& com_mod, const int vmsFlag, const int eNoNw, const int e
21962201
lK(10,a,b) = lK(10,a,b) + wl*(T2 + T1);
21972202
// lK(10,a,b) = lK(10,a,b) + mu*K_inverse_darcy_permeability*wl*Nw(b)*Nw(a);
21982203
lK(10,a,b) = lK(10,a,b) + mu*K_inverse_darcy_permeability*wl*Nw(b)*Nw(a)
2199-
+ risFactorTotal*wl*Nw(b)*Nw(a);
2204+
+ urisFactorTotal*wl*Nw(b)*Nw(a);
22002205
//dmsg << "lK(10,a,b): " << lK(10,a,b);
22012206
}
22022207
}
@@ -2222,11 +2227,11 @@ void fluid_3d_m(ComMod& com_mod, const int vmsFlag, const int eNoNw, const int e
22222227
// Local residue
22232228
for (int a = 0; a < eNoNw; a++) {
22242229
lR(0,a) = lR(0,a) + mu*K_inverse_darcy_permeability*w*Nw(a)*(u[0]+up[0])
2225-
+ risFactorTotal*w*Nw(a)*u[0];
2230+
+ w*Nw(a)*(urisFactorTotal*u[0] - urisValveVelTermTotal[0]);
22262231
lR(1,a) = lR(1,a) + mu*K_inverse_darcy_permeability*w*Nw(a)*(u[1]+up[1])
2227-
+ risFactorTotal*w*Nw(a)*u[1];
2232+
+ w*Nw(a)*(urisFactorTotal*u[1] - urisValveVelTermTotal[1]);
22282233
lR(2,a) = lR(2,a) + mu*K_inverse_darcy_permeability*w*Nw(a)*(u[2]+up[2])
2229-
+ risFactorTotal*w*Nw(a)*u[2];
2234+
+ w*Nw(a)*(urisFactorTotal*u[2] - urisValveVelTermTotal[2]);
22302235
}
22312236

22322237
}

Code/Source/solver/fluid.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,14 @@ void fluid_2d_m(ComMod& com_mod, const int vmsFlag, const int eNoNw, const int e
3636
void fluid_3d_c(ComMod& com_mod, const int vmsFlag, const int eNoNw, const int eNoNq, const double w, const Array<double>& Kxi,
3737
const Vector<double>& Nw, const Vector<double>& Nq, const Array<double>& Nwx, const Array<double>& Nqx,
3838
const Array<double>& Nwxx, const Array<double>& al, const Array<double>& yl, const Array<double>& bfl,
39-
Array<double>& lR, Array3<double>& lK, double K_inverse_darcy_permeability, double risFactorTotal);
39+
Array<double>& lR, Array3<double>& lK, double K_inverse_darcy_permeability,
40+
const double urisFactorTotal, const Vector<double>& urisValveVelTotal);
4041

4142
void fluid_3d_m(ComMod& com_mod, const int vmsFlag, const int eNoNw, const int eNoNq, const double w, const Array<double>& Kxi,
4243
const Vector<double>& Nw, const Vector<double>& Nq, const Array<double>& Nwx, const Array<double>& Nqx,
4344
const Array<double>& Nwxx, const Array<double>& al, const Array<double>& yl, const Array<double>& bfl,
44-
Array<double>& lR, Array3<double>& lK, double K_inverse_darcy_permeability, double risFactorTotal);
45+
Array<double>& lR, Array3<double>& lK, double K_inverse_darcy_permeability,
46+
const double urisFactorTotal, const Vector<double>& urisValveVelTotal);
4547

4648
void get_viscosity(const ComMod& com_mod, const dmnType& lDmn, double& gamma, double& mu, double& mu_s, double& mu_x);
4749

Code/Source/solver/fsi.cpp

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,10 @@ void construct_fsi(ComMod& com_mod, CepMod& cep_mod, const mshType& lM, const So
167167
Array<double> ksix(nsd,nsd);
168168
// Total resistance factor value of the RIS valves for the current element
169169
// at different quadrature points
170-
Vector<double> risFactorTotalEl;
170+
Vector<double> urisFactorTotalEl;
171+
Array<double> urisValveVelTermTotalEl;
171172
if (com_mod.urisFlag) {
172-
uris::uris_compute_ris_factor(com_mod, lM, fs_1[0], e, risFactorTotalEl);
173+
uris::eval_uris_ris_factors_quadrature(com_mod, lM, fs_1[0], e, urisFactorTotalEl, urisValveVelTermTotalEl);
173174
}
174175

175176
for (int g = 0; g < fs_1[0].nG; g++) {
@@ -199,13 +200,15 @@ void construct_fsi(ComMod& com_mod, CepMod& cep_mod, const mshType& lM, const So
199200
case Equation_fluid: {
200201
auto N0 = fs_1[0].N.col(g);
201202
auto N1 = fs_1[1].N.col(g);
202-
double risFactorTotal = 0.0;
203+
double urisFactorTotal = 0.0;
204+
Vector<double> urisValveVelTermTotal(nsd);
203205
if (com_mod.urisFlag) {
204-
risFactorTotal = risFactorTotalEl(g);
206+
urisFactorTotal = urisFactorTotalEl(g);
207+
urisValveVelTermTotal = urisValveVelTermTotalEl.rcol(g);
205208
}
206209

207210
// using zero permeability to use Navier-Stokes here, not Navier-Stokes-Brinkman
208-
fluid::fluid_3d_m(com_mod, vmsStab, fs_1[0].eNoN, fs_1[1].eNoN, w, ksix, N0, N1, Nwx, Nqx, Nwxx, al, yl, bfl, lR, lK, 0.0, risFactorTotal);
211+
fluid::fluid_3d_m(com_mod, vmsStab, fs_1[0].eNoN, fs_1[1].eNoN, w, ksix, N0, N1, Nwx, Nqx, Nwxx, al, yl, bfl, lR, lK, 0.0, urisFactorTotal, urisValveVelTermTotal);
209212

210213
} break;
211214

@@ -256,8 +259,8 @@ void construct_fsi(ComMod& com_mod, CepMod& cep_mod, const mshType& lM, const So
256259
// If the number of quadrature points is different for the continuity and
257260
// momentum function spaces, recompute the RIS factor
258261
if (com_mod.urisFlag) {
259-
if (static_cast<int>(risFactorTotalEl.size()) != fs_2[1].nG) {
260-
uris::uris_compute_ris_factor(com_mod, lM, fs_2[1], e, risFactorTotalEl);
262+
if (urisFactorTotalEl.size() != fs_2[1].nG) {
263+
uris::eval_uris_ris_factors_quadrature(com_mod, lM, fs_2[1], e, urisFactorTotalEl, urisValveVelTermTotalEl);
261264
}
262265
}
263266

@@ -288,13 +291,15 @@ void construct_fsi(ComMod& com_mod, CepMod& cep_mod, const mshType& lM, const So
288291
case Equation_fluid: {
289292
auto N0 = fs_2[0].N.col(g);
290293
auto N1 = fs_2[1].N.col(g);
291-
double risFactorTotal = 0.0;
294+
double urisFactorTotal = 0.0;
295+
Vector<double> urisValveVelTermTotal(nsd);
292296
if (com_mod.urisFlag) {
293-
risFactorTotal = risFactorTotalEl(g);
297+
urisFactorTotal = urisFactorTotalEl(g);
298+
urisValveVelTermTotal = urisValveVelTermTotalEl.rcol(g);
294299
}
295300

296301
// using zero permeability to use Navier-Stokes here, not Navier-Stokes-Brinkman
297-
fluid::fluid_3d_c(com_mod, vmsStab, fs_2[0].eNoN, fs_2[1].eNoN, w, ksix, N0, N1, Nwx, Nqx, Nwxx, al, yl, bfl, lR, lK, 0.0, risFactorTotal);
302+
fluid::fluid_3d_c(com_mod, vmsStab, fs_2[0].eNoN, fs_2[1].eNoN, w, ksix, N0, N1, Nwx, Nqx, Nwxx, al, yl, bfl, lR, lK, 0.0, urisFactorTotal, urisValveVelTermTotal);
298303
} break;
299304

300305
case Equation_ustruct:

0 commit comments

Comments
 (0)