13 #if !defined(KRATOS_EDGEBASED_LEVELSET_FLUID_SOLVER_H_INCLUDED)
14 #define KRATOS_EDGEBASED_LEVELSET_FLUID_SOLVER_H_INCLUDED
31 #include "utilities/geometry_utilities.h"
37 template <
unsigned int TDim,
class MatrixContainer,
class TSparseSpace,
class TLinearSolver>
65 double stabdt_pressure_factor,
66 double stabdt_convection_factor,
68 bool assume_constant_dp)
69 : mr_matrix_container(mr_matrix_container),
70 mr_model_part(mr_model_part),
71 mstabdt_pressure_factor(stabdt_pressure_factor),
72 mstabdt_convection_factor(stabdt_convection_factor),
73 mtau2_factor(tau2_factor),
74 massume_constant_dp(assume_constant_dp)
77 for (ModelPart::NodesContainerType::iterator it = mr_model_part.
NodesBegin(); it != mr_model_part.
NodesEnd(); it++)
78 it->FastGetSolutionStepValue(VISCOSITY) =
viscosity;
82 mdelta_t_avg = 1000.0;
89 mWallLawIsActive =
false;
106 mr_matrix_container.
SetToZero(mBodyForce);
108 mr_matrix_container.
SetToZero(mViscosity);
124 mr_matrix_container.
SetToZero(mNodalFlag);
126 mr_matrix_container.
SetToZero(mdistances);
129 mr_matrix_container.
SetToZero(mTauPressure);
130 mTauConvection.resize(
n_nodes);
131 mr_matrix_container.
SetToZero(mTauConvection);
141 mEdgeDimensions.resize(n_edges);
142 mr_matrix_container.
SetToZero(mEdgeDimensions);
148 mr_matrix_container.
SetToZero(mPiConvection);
165 mr_matrix_container.
SetToZero(mdiv_error);
166 mdiag_stiffness.resize(
n_nodes);
167 mr_matrix_container.
SetToZero(mdiag_stiffness);
183 std::vector<unsigned int> tempFixedVelocities;
184 std::vector<array_1d<double, TDim>> tempFixedVelocitiesValues;
185 std::vector<unsigned int> tempPressureOutletList;
186 for (ModelPart::NodesContainerType::iterator inode = mr_model_part.
NodesBegin();
190 int index = inode->FastGetSolutionStepValue(AUX_INDEX);
192 if (inode->Is(INLET))
194 tempFixedVelocities.push_back(index);
195 tempFixedVelocitiesValues.push_back(mvel_n1[index]);
198 if (inode->Is(OUTLET) || inode->IsFixed(PRESSURE))
200 tempPressureOutletList.push_back(index);
203 mFixedVelocities.resize(tempFixedVelocities.size(),
false);
204 mFixedVelocitiesValues.resize(tempFixedVelocitiesValues.size(),
false);
205 mPressureOutletList.resize(tempPressureOutletList.size(),
false);
208 mFixedVelocities[
i] = tempFixedVelocities[
i];
209 mFixedVelocitiesValues[
i] = tempFixedVelocitiesValues[
i];
213 mPressureOutletList[
i] = tempPressureOutletList[
i];
220 if constexpr (TDim == 3)
227 std::vector<int> row_partition(number_of_threads);
230 for (
int k = 0;
k < number_of_threads;
k++)
235 for (
int i_node =
static_cast<int>(row_partition[
k]); i_node < static_cast<int>(row_partition[
k + 1]); i_node++)
245 unsigned int j_neighbour = mr_matrix_container.
GetColumnIndex()[csr_index];
247 if ((
static_cast<int>(j_neighbour) > i_node) && (flag == 0))
250 mL.push_back(i_node, i_node, 0.0);
254 mL.push_back(i_node, j_neighbour, 0.0);
258 mL.push_back(i_node, i_node, 0.0);
264 CalculateEdgeLengths(mr_model_part.
Nodes());
268 for (ModelPart::NodesContainerType::iterator inode = mr_model_part.
NodesBegin();
274 for (
unsigned int i = 0;
i < TDim;
i++)
277 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
278 press_proj[l_comp] =
temp[l_comp];
286 mshock_coeff =
coeff;
315 unsigned int n_nodes = mvel_n1.size();
316 for (
unsigned int i_node = 0; i_node <
n_nodes; i_node++)
319 const double havg_i = mHavg[i_node];
320 const double hmin_i = mHmin[i_node];
321 const double eps_i = mEps[i_node];
322 const double nu = mViscosity[i_node];
324 double vel_norm = 0.0;
325 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
327 vel_norm += v_i[l_comp] * v_i[l_comp];
329 vel_norm = sqrt(vel_norm);
334 double delta_t_i = CFLNumber * 1.0 / (2.0 * vel_norm / hmin_i + 4.0 *
nu / (hmin_i * hmin_i));
335 double delta_t_i_avg = 1.0 / (2.0 * vel_norm / havg_i + 4.0 *
nu / (havg_i * havg_i));
342 unsigned int j_neighbour = mr_matrix_container.
GetColumnIndex()[csr_index];
346 double v_diff_norm = 0.0;
347 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
349 double temp = v_i[l_comp] - v_j[l_comp];
352 v_diff_norm = sqrt(v_diff_norm);
353 v_diff_norm /= eps_i;
354 double delta_t_j = CFLNumber * 1.0 / (2.0 * v_diff_norm / hmin_i + 4.0 *
nu / (hmin_i * hmin_i));
356 if (delta_t_j < delta_t_i)
357 delta_t_i = delta_t_j;
364 if (delta_t_i_avg < mdelta_t_avg)
365 mdelta_t_avg = delta_t_i_avg;
377 if constexpr (TDim == 3)
378 ApplySmagorinsky3D(MolecularViscosity, Cs);
380 ApplySmagorinsky2D(MolecularViscosity, Cs);
392 int fixed_size = mFixedVelocities.size();
394 #pragma omp parallel for firstprivate(fixed_size)
395 for (
int i_velocity = 0; i_velocity < fixed_size; i_velocity++)
397 unsigned int i_node = mFixedVelocities[i_velocity];
401 for (
unsigned int comp = 0; comp < TDim; comp++)
402 u_i_fix[comp] = u_i[comp];
440 double delta_t = CurrentProcessInfo[DELTA_TIME];
443 double time_inv_avg = 1.0 / mdelta_t_avg;
445 double stabdt_pressure_factor = mstabdt_pressure_factor;
446 double stabdt_convection_factor = mstabdt_convection_factor;
447 double tau2_factor = mtau2_factor;
449 #pragma omp parallel for firstprivate(time_inv_avg, stabdt_pressure_factor, stabdt_convection_factor, tau2_factor)
450 for (
int i_node = 0; i_node <
n_nodes; i_node++)
452 double &h_avg_i = mHavg[i_node];
455 const double nu_i = mViscosity[i_node];
456 const double eps_i = mEps[i_node];
457 const double lindarcy_i = mA[i_node];
458 const double nonlindarcy_i = mB[i_node];
460 double vel_norm = 0.0;
461 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
463 vel_norm += a_i[l_comp] * a_i[l_comp];
465 vel_norm = sqrt(vel_norm);
470 double rel_vel_norm = 0.0;
471 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
473 rel_vel_i[l_comp] = a_i[l_comp] - str_v_i[l_comp];
474 rel_vel_norm += rel_vel_i[l_comp] * rel_vel_i[l_comp];
476 rel_vel_norm = sqrt(rel_vel_norm);
478 double porosity_coefficient = ComputePorosityCoefficient(rel_vel_norm, eps_i, lindarcy_i, nonlindarcy_i);
482 double tau = 1.0 / (2.0 * vel_norm / h_avg_i + stabdt_pressure_factor * time_inv_avg + (4.0 * nu_i) / (h_avg_i * h_avg_i) + porosity_coefficient);
483 double tau_conv = 1.0 / (2.0 * vel_norm / h_avg_i + stabdt_convection_factor * time_inv_avg + (4.0 * nu_i) / (h_avg_i * h_avg_i) + porosity_coefficient);
484 mTauPressure[i_node] =
tau;
485 mTauConvection[i_node] = tau_conv;
487 mTau2[i_node] = (nu_i + h_avg_i * vel_norm * 0.5) * tau2_factor;
495 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
500 const double &eps_i = mEps[i_node];
506 unsigned int j_neighbour = mr_matrix_container.GetColumnIndex()[csr_index];
507 array_1d<double, TDim> a_j = mvel_n1[j_neighbour];
508 const array_1d<double, TDim> &U_j = mvel_n1[j_neighbour];
509 const double &eps_j = mEps[j_neighbour];
513 CSR_Tuple &edge_ij = mr_matrix_container.GetEdgeValues()[csr_index];
515 edge_ij.Add_ConvectiveContribution(pi_i, a_i, U_i, a_j, U_j);
520 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
521 pi_i[l_comp] *= m_inv;
530 Add_Effective_Inverse_Multiply(mWork, mWork,
delta_t / 6.0, mr_matrix_container.
GetLumpedMass(), mdiag_stiffness,
rhs);
531 Add_Effective_Inverse_Multiply(mvel_n1, mvel_n, 0.5 *
delta_t, mr_matrix_container.
GetLumpedMass(), mdiag_stiffness,
rhs);
537 Add_Effective_Inverse_Multiply(mWork, mWork,
delta_t / 3.0, mr_matrix_container.
GetLumpedMass(), mdiag_stiffness,
rhs);
538 Add_Effective_Inverse_Multiply(mvel_n1, mvel_n, 0.5 *
delta_t, mr_matrix_container.
GetLumpedMass(), mdiag_stiffness,
rhs);
544 Add_Effective_Inverse_Multiply(mWork, mWork,
delta_t / 3.0, mr_matrix_container.
GetLumpedMass(), mdiag_stiffness,
rhs);
545 Add_Effective_Inverse_Multiply(mvel_n1, mvel_n,
delta_t, mr_matrix_container.
GetLumpedMass(), mdiag_stiffness,
rhs);
551 Add_Effective_Inverse_Multiply(mWork, mWork,
delta_t / 6.0, mr_matrix_container.
GetLumpedMass(), mdiag_stiffness,
rhs);
577 double inverse_rho = 1.0 / mRho;
579 #pragma omp parallel for private(stab_low, stab_high)
580 for (
int i_node = 0; i_node <
n_nodes; i_node++)
582 double dist = mdistances[i_node];
585 const double nu_i = mViscosity[i_node];
586 const double nu_j = nu_i;
592 const double &p_i =
pressure[i_node];
593 const double &eps_i = mEps[i_node];
594 const double lindarcy_i = mA[i_node];
595 const double nonlindarcy_i = mB[i_node];
600 double rel_vel_norm = 0.0;
601 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
603 rel_vel_i[l_comp] = U_i[l_comp] - str_v_i[l_comp];
604 rel_vel_norm += rel_vel_i[l_comp] * rel_vel_i[l_comp];
606 rel_vel_norm = sqrt(rel_vel_norm);
608 double edge_tau = mTauConvection[i_node];
614 for (
unsigned int comp = 0; comp < TDim; comp++)
615 rhs_i[comp] = m_i * eps_i * f_i[comp];
618 double porosity_coefficient = ComputePorosityCoefficient(rel_vel_norm, eps_i, lindarcy_i, nonlindarcy_i);
619 diag_stiffness[i_node] = m_i * porosity_coefficient;
622 for (
unsigned int comp = 0; comp < TDim; comp++)
624 rhs_i[comp] += m_i * porosity_coefficient * str_v_i[comp];
631 unsigned int j_neighbour = mr_matrix_container.
GetColumnIndex()[csr_index];
635 const double &p_j =
pressure[j_neighbour];
636 const double &eps_j = mEps[j_neighbour];
645 edge_ij.
Sub_grad_p(rhs_i, p_i * inverse_rho * eps_i, p_j * inverse_rho * eps_i);
658 if (mWallLawIsActive ==
true)
659 ComputeWallResistance(
vel, diag_stiffness);
669 void SolveStep2(
typename TLinearSolver::Pointer pLinearSolver)
678 for (ModelPart::NodesContainerType::iterator inode = mr_model_part.
NodesBegin();
682 inode->GetValue(IS_VISITED) = 0.0;
685 std::vector<PointVector> layers(2);
688 for (ModelPart::NodesContainerType::iterator inode = mr_model_part.
NodesBegin();
692 if (inode->FastGetSolutionStepValue(DISTANCE) < 0.0)
697 if (
i->FastGetSolutionStepValue(DISTANCE) >= 0.0)
699 if (inode->GetValue(IS_VISITED) == 0.0)
702 inode->GetValue(IS_VISITED) = 1.0;
708 inode->FastGetSolutionStepValue(PRESSURE) = 0.0;
712 for (
PointIterator iii = (layers[0]).begin(); iii != (layers[0]).
end(); iii++)
718 if (jjj->FastGetSolutionStepValue(DISTANCE) >= 0 &&
719 jjj->GetValue(IS_VISITED) == 0.0)
721 layers[1].
push_back(Node::WeakPointer(*jjj.base()));
722 jjj->GetValue(IS_VISITED) = 2.0;
728 for (
PointIterator iii = layers[1].begin(); iii != layers[1].end(); iii++)
731 unsigned int i_node = iii->FastGetSolutionStepValue(AUX_INDEX);
734 for (
unsigned int comp = 0; comp < TDim; comp++)
737 double dist_i = mdistances[i_node];
742 unsigned int j_neighbour = mr_matrix_container.
GetColumnIndex()[csr_index];
744 const double &dist_j = mdistances[j_neighbour];
753 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
754 grad_d[l_comp] *= m_inv;
756 double norm_grad =
norm_2(grad_d);
758 if (norm_grad < 100.0)
764 double pestimate = 0.0;
767 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
768 pestimate += r_press_proj[l_comp] * grad_d[l_comp];
770 iii->FastGetSolutionStepValue(PRESSURE) = pestimate;
774 std::cout <<
"attention gradient of distance much greater than 1 on node:" << i_node << std::endl;
775 double avg_number = 0.0;
782 if (
i->GetValue(IS_VISITED) == 1.0)
784 pavg +=
i->FastGetSolutionStepValue(PRESSURE);
789 KRATOS_ERROR_IF(avg_number == 0) <<
"can not happen that the extrapolation node has no neighbours" << std::endl;
791 iii->FastGetSolutionStepValue(PRESSURE) = pavg / avg_number;
807 double delta_t = CurrentProcessInfo[DELTA_TIME];
817 double &rhs_i =
rhs[i_node];
819 const double &p_i = mPn1[i_node];
820 const double &p_old_i = mPn[i_node];
830 unsigned int j_neighbour = mr_matrix_container.GetColumnIndex()[csr_index];
831 const double &p_j = mPn1[j_neighbour];
832 const double &p_old_j = mPn[j_neighbour];
833 const array_1d<double, TDim> &U_j_curr = mvel_n1[j_neighbour];
834 const array_1d<double, TDim> &xi_j = mXi[j_neighbour];
836 CSR_Tuple &edge_ij = mr_matrix_container.GetEdgeValues()[csr_index];
839 double edge_tau = 0.25 * (mTauPressure[i_node] + mTauPressure[j_neighbour]);
841 double edge_tau = 0.5 * mTauPressure[i_node];
844 if (edge_tau < delta_t)
849 edge_ij.CalculateScalarLaplacian(sum_l_ikjk);
851 double sum_l_ikjk_onlydt = sum_l_ikjk * (delta_t);
852 sum_l_ikjk *= (delta_t + edge_tau);
856 rhs_i -= sum_l_ikjk * (p_j - p_i);
857 rhs_i += sum_l_ikjk_onlydt * (p_old_j - p_old_i);
860 edge_ij.Sub_D_v(rhs_i, U_i_curr * mRho, U_j_curr * mRho);
865 edge_ij.Add_div_v(temp, xi_i, xi_j);
866 rhs_i += edge_tau * temp;
869 mL(i_node, j_neighbour) = sum_l_ikjk;
873 mL(i_node, i_node) = l_ii;
876 if (muse_mass_correction ==
true)
879 double &rhs_i =
rhs[i_node];
880 rhs_i -= mdiv_error[i_node];
885 double max_diag = 0.0;
886 for (
int i_node = 0; i_node <
n_nodes; i_node++)
888 double L_diag = mL(i_node, i_node);
889 if (std::abs(L_diag) > std::abs(max_diag))
896 for (
unsigned int i_pressure = 0; i_pressure < mPressureOutletList.size(); i_pressure++)
898 unsigned int i_node = mPressureOutletList[i_pressure];
899 mL(i_node, i_node) = max_diag;
903 unsigned int j_neighbour = mr_matrix_container.
GetColumnIndex()[csr_index];
904 mL(i_node, j_neighbour) = 0.0;
910 if (mdistances[i_node] >= 0)
912 mL(i_node, i_node) = max_diag;
916 unsigned int j_neighbour = mr_matrix_container.
GetColumnIndex()[csr_index];
917 mL(i_node, j_neighbour) = 0.0;
924 unsigned int j_neighbour = mr_matrix_container.
GetColumnIndex()[csr_index];
925 if (mdistances[j_neighbour] >= 0)
926 mL(i_node, j_neighbour) = 0.0;
933 double *Lvalues = mL.value_data().begin();
934 SizeType *Lrow_indices = mL.index1_data().begin();
935 SizeType *Lcol_indices = mL.index2_data().begin();
943 if (
static_cast<unsigned int>(Lcol_indices[
j]) ==
k)
945 t = fabs(Lvalues[
j]);
949 scaling_factors[
k] = 1.0 / sqrt(
t);
955 double k_factor = scaling_factors[
k];
961 Lvalues[
j] *= scaling_factors[Lcol_indices[
j]] * k_factor;
970 pLinearSolver->Solve(mL, dp,
rhs);
974 mPn1[i_node] += dp[i_node] * scaling_factors[i_node];
981 #pragma omp parallel for private(work_array)
982 for (
int i_node = 0; i_node <
n_nodes; i_node++)
985 for (
unsigned int comp = 0; comp < TDim; comp++)
988 double dist = mdistances[i_node];
992 const double &p_i = mPn1[i_node];
997 unsigned int j_neighbour = mr_matrix_container.
GetColumnIndex()[csr_index];
999 const double &p_j = mPn1[j_neighbour];
1008 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
1009 xi_i[l_comp] *= m_inv;
1033 double delta_t = CurrentProcessInfo[DELTA_TIME];
1036 if (massume_constant_dp ==
true)
1040 double rho_inv = 1.0 / mRho;
1041 #pragma omp parallel for private(correction) firstprivate(delta_t, rho_inv, factor)
1042 for (
int i_node = 0; i_node <
n_nodes; i_node++)
1044 double dist = mdistances[i_node];
1048 double delta_p_i = (mPn1[i_node] - mPn[i_node]) * rho_inv *
factor;
1051 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
1052 correction[l_comp] = 0.0;
1055 for (
unsigned int csr_index = mr_matrix_container.
GetRowStartIndex()[i_node]; csr_index != mr_matrix_container.
GetRowStartIndex()[i_node + 1]; csr_index++)
1057 unsigned int j_neighbour = mr_matrix_container.
GetColumnIndex()[csr_index];
1058 double delta_p_j = (mPn1[j_neighbour] - mPn[j_neighbour]) * rho_inv *
factor;
1062 edge_ij.
Sub_grad_p(correction, delta_p_i, delta_p_j);
1066 const double &
d = mdiag_stiffness[i_node];
1069 for (
unsigned int comp = 0; comp < TDim; comp++)
1082 if (muse_mass_correction ==
true)
1084 #pragma omp parallel for private(correction) firstprivate(delta_t, rho_inv)
1085 for (
int i_node = 0; i_node <
n_nodes; i_node++)
1087 const double dist = mdistances[i_node];
1088 double &div_i_err = mdiv_error[i_node];
1095 for (
unsigned int csr_index = mr_matrix_container.
GetRowStartIndex()[i_node]; csr_index != mr_matrix_container.
GetRowStartIndex()[i_node + 1]; csr_index++)
1097 unsigned int j_neighbour = mr_matrix_container.
GetColumnIndex()[csr_index];
1102 edge_ij.
Add_D_v(div_i_err, U_i_curr * mRho, U_j_curr * mRho);
1117 if (mWallLawIsActive ==
false)
1120 int edge_size = medge_nodes_direction.size();
1122 #pragma omp parallel for firstprivate(edge_size)
1123 for (
int i = 0;
i < edge_size;
i++)
1125 int i_node = medge_nodes[
i];
1127 double dist = mdistances[i_node];
1133 for (
unsigned int comp = 0; comp < TDim; comp++)
1134 temp += U_i[comp] * direction[comp];
1136 for (
unsigned int comp = 0; comp < TDim; comp++)
1137 U_i[comp] = direction[comp] *
temp;
1142 int corner_size = mcorner_nodes.size();
1143 for (
int i = 0;
i < corner_size;
i++)
1145 int i_node = mcorner_nodes[
i];
1148 for (
unsigned int comp = 0; comp < TDim; comp++)
1154 int slip_size = mSlipBoundaryList.size();
1156 #pragma omp parallel for firstprivate(slip_size)
1157 for (
int i_slip = 0; i_slip < slip_size; i_slip++)
1159 unsigned int i_node = mSlipBoundaryList[i_slip];
1160 double dist = mdistances[i_node];
1165 double projection_length = 0.0;
1166 double normalization = 0.0;
1167 for (
unsigned int comp = 0; comp < TDim; comp++)
1169 projection_length += U_i[comp] * an_i[comp];
1170 normalization += an_i[comp] * an_i[comp];
1172 projection_length /= normalization;
1174 for (
unsigned int comp = 0; comp < TDim; comp++)
1175 U_i[comp] -= projection_length * an_i[comp];
1180 int fixed_size = mFixedVelocities.size();
1182 #pragma omp parallel for firstprivate(fixed_size)
1183 for (
int i_velocity = 0; i_velocity < fixed_size; i_velocity++)
1185 unsigned int i_node = mFixedVelocities[i_velocity];
1186 double dist = mdistances[i_node];
1192 for (
unsigned int comp = 0; comp < TDim; comp++)
1193 u_i[comp] = u_i_fix[comp];
1216 for (ModelPart::NodesContainerType::iterator inode = mr_model_part.
NodesBegin();
1220 inode->GetValue(IS_VISITED) = 0.0;
1227 for (ModelPart::NodesContainerType::iterator inode = mr_model_part.
NodesBegin();
1231 if (inode->FastGetSolutionStepValue(DISTANCE) < 0.0)
1236 if (
i->FastGetSolutionStepValue(DISTANCE) >= 0.0)
1238 if (inode->GetValue(IS_VISITED) == 0.0)
1241 inode->GetValue(IS_VISITED) = 1.0;
1250 inode->FastGetSolutionStepValue(PRESSURE) = 0.0;
1252 inode->FastGetSolutionStepValue(PRESSURE, 1) = 0.0;
1263 for (
PointIterator iii = (layers[il]).begin(); iii != (layers[il]).
end(); iii++)
1269 if (jjj->FastGetSolutionStepValue(DISTANCE) >= 0 &&
1270 jjj->GetValue(IS_VISITED) == 0.0)
1272 layers[il + 1].
push_back(Node::WeakPointer(*jjj.base()));
1273 jjj->GetValue(IS_VISITED) =
double(il + 2.0);
1284 for (
PointIterator iii = (layers[0]).begin(); iii != (layers[0]).
end(); iii++)
1287 double avg_number = 0.0;
1292 if (
i->GetValue(IS_VISITED) == 0.0)
1295 noalias(aux_proj) += inside_press_grad;
1300 if (avg_number != 0.0)
1302 aux_proj /= avg_number;
1303 noalias(iii->FastGetSolutionStepValue(PRESS_PROJ)) = aux_proj;
1309 for (
unsigned int i = 0;
i < TDim;
i++)
1318 for (
PointIterator iii = layers[il].begin(); iii != layers[il].end(); iii++)
1326 double avg_number = 0.0;
1333 if (
i->GetValue(IS_VISITED) < (il + 1) &&
i->GetValue(IS_VISITED) != 0.0)
1337 noalias(direction_vec) -= coords_bottom;
1340 double pestimate =
i->FastGetSolutionStepValue(PRESSURE, 1) +
temp;
1342 noalias(aux_proj) += press_grad;
1344 noalias(aux) +=
i->FastGetSolutionStepValue(VELOCITY);
1349 if (avg_number != 0.0)
1353 aux_proj /= avg_number;
1357 KRATOS_THROW_ERROR(std::runtime_error,
"error in extrapolation:: no neighbours find on a extrapolation layer -- impossible",
"");
1360 noalias(iii->FastGetSolutionStepValue(VELOCITY)) = aux;
1361 noalias(iii->FastGetSolutionStepValue(VELOCITY, 1)) = aux;
1363 iii->FastGetSolutionStepValue(PRESSURE, 1) = pavg;
1365 noalias(iii->FastGetSolutionStepValue(PRESS_PROJ)) = aux_proj;
1366 noalias(iii->FastGetSolutionStepValue(PRESS_PROJ, 1)) = aux_proj;
1374 ModelPart::NodesContainerType::iterator it_begin = mr_model_part.
NodesBegin();
1375 for (
unsigned int i_node = 0; i_node < mr_model_part.
Nodes().size(); i_node++)
1377 ModelPart::NodesContainerType::iterator it = it_begin + i_node;
1378 if (it->FastGetSolutionStepValue(DISTANCE) <= 0.0)
1379 it->GetValue(IS_VISITED) = 1.0;
1381 it->GetValue(IS_VISITED) = 0.0;
1386 for (
PointIterator iii = layers[il].begin(); iii != layers[il].end(); iii++)
1387 iii->GetValue(IS_VISITED) = 1.0;
1400 for (ModelPart::NodesContainerType::iterator inode = mr_model_part.
NodesBegin();
1404 double dist = inode->FastGetSolutionStepValue(DISTANCE);
1405 inode->FastGetSolutionStepValue(DISTANCE) = -
dist;
1415 for (ModelPart::NodesContainerType::iterator inode = mr_model_part.
NodesBegin();
1419 double dist = inode->FastGetSolutionStepValue(DISTANCE);
1421 inode->GetValue(IS_VISITED) = 1.0;
1423 inode->GetValue(IS_VISITED) = 0.0;
1433 for (ModelPart::NodesContainerType::iterator inode = mr_model_part.
NodesBegin();
1437 inode->FastGetSolutionStepValue(rVar, 1) = inode->FastGetSolutionStepValue(rVar);
1447 for (ModelPart::NodesContainerType::iterator inode = mr_model_part.
NodesBegin();
1451 inode->GetValue(IS_VISITED) = 0.0;
1455 for (ModelPart::NodesContainerType::iterator inode = mr_model_part.
NodesBegin();
1459 if (inode->FastGetSolutionStepValue(DISTANCE) > 0.0)
1461 inode->GetValue(IS_VISITED) = 1.0;
1465 i->GetValue(IS_VISITED) = 1.0;
1476 for (ModelPart::NodesContainerType::iterator inode = mr_model_part.
NodesBegin();
1480 inode->GetValue(IS_VISITED) = 0.0;
1484 for (ModelPart::NodesContainerType::iterator inode = mr_model_part.
NodesBegin();
1488 if (inode->FastGetSolutionStepValue(DISTANCE) <= 0.0)
1490 inode->GetValue(IS_VISITED) = 1.0;
1494 i->GetValue(IS_VISITED) = 1.0;
1505 for (ModelPart::NodesContainerType::iterator inode = mr_model_part.
NodesBegin();
1509 inode->GetValue(IS_VISITED) = 0.0;
1513 for (ModelPart::NodesContainerType::iterator inode = mr_model_part.
NodesBegin();
1517 if (inode->FastGetSolutionStepValue(DISTANCE) <= 0.0)
1519 inode->GetValue(IS_VISITED) = 1.0;
1535 if constexpr (TDim == 2)
1537 for (ModelPart::ConditionsContainerType::iterator cond_it = rConditions.begin(); cond_it != rConditions.end(); cond_it++)
1538 CalculateNormal2D(cond_it, area_normal);
1540 else if constexpr (TDim == 3)
1545 for (ModelPart::ConditionsContainerType::iterator cond_it = rConditions.begin(); cond_it != rConditions.end(); cond_it++)
1546 CalculateNormal3D(cond_it, area_normal, v1, v2);
1550 unsigned int n_nodes = mNodalFlag.size();
1554 for (
unsigned int i_node = 0; i_node <
n_nodes; i_node++)
1557 mis_slip[i_node] =
false;
1563 const double node_factor = 1.0 / TDim;
1564 for (ModelPart::ConditionsContainerType::iterator cond_it = rConditions.begin(); cond_it != rConditions.end(); cond_it++)
1573 if (
static_cast<bool>(cond_it->Is(SLIP)))
1574 for (
unsigned int if_node = 0; if_node < TDim; if_node++)
1576 unsigned int i_node =
static_cast<unsigned int>(face_geometry[if_node].FastGetSolutionStepValue(AUX_INDEX));
1578 mis_slip[i_node] =
true;
1579 for (
unsigned int comp = 0; comp < TDim; comp++)
1581 slip_normal[comp] += node_factor * face_normal[comp];
1587 std::vector<unsigned int> tempmSlipBoundaryList;
1588 for (
unsigned int i_node = 0; i_node <
n_nodes; i_node++)
1590 if (mis_slip[i_node] ==
true)
1591 tempmSlipBoundaryList.push_back(i_node);
1593 mis_slip[i_node] =
false;
1595 mSlipBoundaryList.resize(tempmSlipBoundaryList.size(),
false);
1598 mSlipBoundaryList[
i] = tempmSlipBoundaryList[
i];
1603 for (ModelPart::ConditionsContainerType::iterator cond_it = rConditions.begin(); cond_it != rConditions.end(); cond_it++)
1612 bool is_inlet_or_outlet =
false;
1613 if (cond_it->IsNot(SLIP))
1614 is_inlet_or_outlet =
true;
1617 for (
unsigned int if_node = 0; if_node < TDim; if_node++)
1618 if (face_geometry[if_node].Is(INLET) || face_geometry[if_node].Is(OUTLET) || face_geometry[if_node].IsFixed(PRESSURE))
1619 is_inlet_or_outlet =
true;
1622 if (is_inlet_or_outlet)
1623 for (
unsigned int if_node = 0; if_node < TDim; if_node++)
1625 unsigned int i_node =
static_cast<unsigned int>(face_geometry[if_node].FastGetSolutionStepValue(AUX_INDEX));
1627 mis_slip[i_node] =
true;
1628 for (
unsigned int comp = 0; comp < TDim; comp++)
1630 inout_normal[comp] += node_factor * face_normal[comp];
1636 std::vector<unsigned int> tempmInOutBoundaryList;
1637 for (
unsigned int i_node = 0; i_node <
n_nodes; i_node++)
1639 if (mis_slip[i_node] ==
true)
1640 tempmInOutBoundaryList.push_back(i_node);
1642 mInOutBoundaryList.resize(tempmInOutBoundaryList.size(),
false);
1645 mInOutBoundaryList[
i] = tempmInOutBoundaryList[
i];
1666 mSlipNormal.clear();
1668 mFixedVelocities.clear();
1669 mFixedVelocitiesValues.clear();
1670 mPressureOutletList.clear();
1671 mSlipBoundaryList.clear();
1673 mTauPressure.clear();
1674 mTauConvection.clear();
1678 mPiConvection.clear();
1688 mdiag_stiffness.clear();
1704 WorkConvection.resize(
n_nodes);
1719 for (
int i_node = 0; i_node <
n_nodes; i_node++)
1721 ModelPart::NodesContainerType::iterator it_begin = mr_model_part.
NodesBegin();
1722 active_nodes[i_node] = (it_begin + i_node)->
GetValue(IS_VISITED);
1729 #pragma omp parallel for private(a_i, a_j)
1730 for (
int i_node = 0; i_node <
n_nodes; i_node++)
1735 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
1738 const double &phi_i = mphi_n1[i_node];
1740 noalias(a_i) = mvel_n1[i_node];
1741 a_i /= mEps[i_node];
1744 for (
unsigned int csr_index = mr_matrix_container.
GetRowStartIndex()[i_node]; csr_index != mr_matrix_container.
GetRowStartIndex()[i_node + 1]; csr_index++)
1746 unsigned int j_neighbour = mr_matrix_container.
GetColumnIndex()[csr_index];
1748 noalias(a_j) = mvel_n1[j_neighbour];
1749 a_j /= mEps[j_neighbour];
1751 const double &phi_j = mphi_n1[j_neighbour];
1761 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
1762 pi_i[l_comp] *= m_inv;
1769 const double &p_i = mphi_n1[i_node];
1770 double &beta_i = mBeta[i_node];
1773 for (
unsigned int csr_index = mr_matrix_container.
GetRowStartIndex()[i_node]; csr_index != mr_matrix_container.
GetRowStartIndex()[i_node + 1]; csr_index++)
1775 unsigned int j_neighbour = mr_matrix_container.GetColumnIndex()[csr_index];
1777 const double &p_j = mphi_n1[j_neighbour];
1778 const array_1d<double, TDim> &l_k = mEdgeDimensions[csr_index];
1779 const array_1d<double, TDim> &pi_j = mPiConvection[j_neighbour];
1782 for (unsigned int comp = 0; comp < TDim; comp++)
1783 proj += 0.5 * l_k[comp] * (pi_i[comp] + pi_j[comp]);
1785 double numerator = fabs(fabs(p_j - p_i) - fabs(proj));
1786 double denom = fabs(fabs(p_j - p_i) + 1e-6);
1788 beta_i += numerator / denom;
1799 double delta_t = CurrentProcessInfo[DELTA_TIME];
1805 CalculateRHS_convection(mphi_n1, mvel_n1,
rhs, active_nodes);
1811 CalculateRHS_convection(mphi_n1, mvel_n1,
rhs, active_nodes);
1817 CalculateRHS_convection(mphi_n1, mvel_n1,
rhs, active_nodes);
1823 CalculateRHS_convection(mphi_n1, mvel_n1,
rhs, active_nodes);
1830 int corner_size = mcorner_nodes.size();
1831 for (
int i = 0;
i < corner_size;
i++)
1833 int i_node = mcorner_nodes[
i];
1834 bool to_be_wettened =
true;
1835 double min_dist = 0.0;
1836 for (
unsigned int csr_index = mr_matrix_container.
GetRowStartIndex()[i_node]; csr_index != mr_matrix_container.
GetRowStartIndex()[i_node + 1]; csr_index++)
1838 unsigned int j_neighbour = mr_matrix_container.
GetColumnIndex()[csr_index];
1839 double neighb_dist = mphi_n1[j_neighbour];
1840 if (min_dist > neighb_dist)
1841 min_dist = neighb_dist;
1842 if (neighb_dist >= 0.0)
1844 to_be_wettened =
false;
1847 if (to_be_wettened ==
true)
1848 mphi_n1[i_node] = min_dist;
1868 int n_large_distance_gradient = 0;
1875 for (
int i_node = 0; i_node <
n_nodes; i_node++)
1877 double dist = mdistances[i_node];
1881 for (
unsigned int comp = 0; comp < TDim; comp++)
1884 double dist_i = mdistances[i_node];
1886 for (
unsigned int csr_index = mr_matrix_container.
GetRowStartIndex()[i_node]; csr_index != mr_matrix_container.
GetRowStartIndex()[i_node + 1]; csr_index++)
1889 unsigned int j_neighbour = mr_matrix_container.
GetColumnIndex()[csr_index];
1891 const double &dist_j = mdistances[j_neighbour];
1900 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
1901 grad_d[l_comp] *= m_inv;
1903 double norm_grad =
norm_2(grad_d);
1905 if (norm_grad > 1.5)
1906 n_large_distance_gradient += 1;
1910 if (n_large_distance_gradient != 0)
1912 bool success =
false;
1917 bool success =
true;
1924 mWallLawIsActive =
true;
1931 double dt = CurrentProcessInfo[DELTA_TIME];
1934 int inout_size = mInOutBoundaryList.size();
1935 double vol_var = 0.0;
1937 for (
int i = 0;
i < inout_size;
i++)
1939 unsigned int i_node = mInOutBoundaryList[
i];
1940 double dist = mdistances[i_node];
1945 double projection_length = 0.0;
1946 for (
unsigned int comp = 0; comp < TDim; comp++)
1948 projection_length += U_i[comp] * an_i[comp];
1950 vol_var += projection_length;
1953 return vol_var *
dt;
1964 double wet_volume = 0.0;
1966 for (
int i = 0; i < static_cast<int>(mdistances.size());
i++)
1968 double dist = mdistances[
i];
1973 wet_volume += 1.0 / m_inv;
1984 double volume_error = expected_volume - measured_volume;
1985 if (measured_volume < expected_volume)
1987 double layer_volume = 0.0;
1988 std::vector<unsigned int> first_outside;
1989 int n_nodes = mdistances.size();
1992 for (
int i_node = 0; i_node <
n_nodes; i_node++)
1994 double dist = mdistances[i_node];
1997 for (
unsigned int csr_index = mr_matrix_container.
GetRowStartIndex()[i_node]; csr_index != mr_matrix_container.
GetRowStartIndex()[i_node + 1]; csr_index++)
1999 unsigned int j_neighbour = mr_matrix_container.
GetColumnIndex()[csr_index];
2000 if (mdistances[j_neighbour] <= 0.0)
2002 const double nodal_mass = 1.0 / mr_matrix_container.
GetInvertedMass()[i_node];
2004 if (nodal_mass < volume_error - layer_volume)
2006 first_outside.push_back(i_node);
2007 layer_volume += nodal_mass;
2013 for (
unsigned int i = 0;
i < first_outside.size();
i++)
2015 unsigned int i_node = first_outside[
i];
2016 mdistances[i_node] = -mHavg[i_node];
2028 std::vector<unsigned int> first_outside;
2029 int n_nodes = mdistances.size();
2032 for (
int i_node = 0; i_node <
n_nodes; i_node++)
2034 double dist = mdistances[i_node];
2037 for (
unsigned int csr_index = mr_matrix_container.
GetRowStartIndex()[i_node]; csr_index != mr_matrix_container.
GetRowStartIndex()[i_node + 1]; csr_index++)
2039 unsigned int j_neighbour = mr_matrix_container.
GetColumnIndex()[csr_index];
2040 if (mdistances[j_neighbour] <= 0.0)
2043 mdistances[i_node] = -mHavg[i_node];
2065 mdelta_t_avg = 1e10;
2078 double n_nodes = mvel_n1.size();
2079 for (
unsigned int i_node = 0; i_node <
n_nodes; i_node++)
2082 const double havg_i = mHavg[i_node];
2083 const double hmin_i = mHmin[i_node];
2084 const double eps_i = mEps[i_node];
2085 const double nu_i = mViscosity[i_node];
2087 double vel_norm = 0.0;
2088 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
2090 vel_norm += v_i[l_comp] * v_i[l_comp];
2092 vel_norm = sqrt(vel_norm);
2097 double delta_t_i = CFLNumber * 1.0 / (2.0 * vel_norm / hmin_i + 4.0 * nu_i / (hmin_i * hmin_i));
2098 double delta_t_i_avg = 1.0 / (2.0 * vel_norm / havg_i + 4.0 * nu_i / (havg_i * havg_i));
2100 if (delta_t_i < 10
e-8)
2102 v_i *= delta_t_i / 10
e-8;
2106 if (delta_t_i_avg < 10
e-8)
2108 v_i *= delta_t_i_avg / 10
e-8;
2109 delta_t_i_avg = 10
e-8;
2114 for (
unsigned int csr_index = mr_matrix_container.
GetRowStartIndex()[i_node]; csr_index != mr_matrix_container.
GetRowStartIndex()[i_node + 1]; csr_index++)
2117 unsigned int j_neighbour = mr_matrix_container.
GetColumnIndex()[csr_index];
2121 double v_diff_norm = 0.0;
2122 for (
unsigned int l_comp = 0; l_comp < TDim; l_comp++)
2124 double temp = v_i[l_comp] - v_j[l_comp];
2127 v_diff_norm = sqrt(v_diff_norm);
2128 v_diff_norm /= eps_i;
2129 double delta_t_j = CFLNumber * 1.0 / (2.0 * v_diff_norm / hmin_i + 4.0 * nu_i / (hmin_i * hmin_i));
2131 if (delta_t_j < 10
e-8)
2133 v_j *= delta_t_j / 10
e-8;
2137 if (delta_t_j < delta_t_i)
2138 delta_t_i = delta_t_j;
2145 if (delta_t_i_avg < mdelta_t_avg)
2146 mdelta_t_avg = delta_t_i_avg;
2164 for (ModelPart::NodesContainerType::iterator inode = mr_model_part.
NodesBegin();
2168 const double eps = inode->FastGetSolutionStepValue(POROSITY);
2169 const double d = inode->FastGetSolutionStepValue(DIAMETER);
2170 const double nu = inode->FastGetSolutionStepValue(VISCOSITY);
2171 double &
a = inode->FastGetSolutionStepValue(LIN_DARCY_COEF);
2172 double &
b = inode->FastGetSolutionStepValue(NONLIN_DARCY_COEF);
2175 double k_inv = 150.0 * (1.0 - eps) * (1.0 - eps) / (eps * eps * eps *
d *
d);
2177 b = (1.75 / eps) * sqrt(k_inv / (150.0 * eps));
2189 for (ModelPart::NodesContainerType::iterator inode = mr_model_part.
NodesBegin();
2193 const double eps = inode->FastGetSolutionStepValue(POROSITY);
2195 double &
a = inode->FastGetSolutionStepValue(LIN_DARCY_COEF);
2196 double &
b = inode->FastGetSolutionStepValue(NONLIN_DARCY_COEF);
2213 bool muse_mass_correction;
2216 bool mWallLawIsActive;
2220 double mstabdt_pressure_factor;
2221 double mstabdt_convection_factor;
2222 double mtau2_factor;
2223 bool massume_constant_dp;
2252 IndicesVectorType mSlipBoundaryList, mPressureOutletList, mFixedVelocities, mInOutBoundaryList;
2262 std::vector<bool> mis_slip;
2287 double mdelta_t_avg;
2290 double mshock_coeff;
2295 void CalculateNormal2D(ModelPart::ConditionsContainerType::iterator cond_it,
array_1d<double, 3> &area_normal)
2299 area_normal[0] = face_geometry[1].Y() - face_geometry[0].Y();
2300 area_normal[1] = -(face_geometry[1].X() - face_geometry[0].X());
2301 area_normal[2] = 0.00;
2306 void CalculateNormal3D(ModelPart::ConditionsContainerType::iterator cond_it, array_1d<double, 3> &area_normal, array_1d<double, 3> &v1, array_1d<double, 3> &v2)
2308 Geometry<Node> &face_geometry = (cond_it)->GetGeometry();
2310 v1[0] = face_geometry[1].X() - face_geometry[0].X();
2311 v1[1] = face_geometry[1].Y() - face_geometry[0].Y();
2312 v1[2] = face_geometry[1].Z() - face_geometry[0].Z();
2314 v2[0] = face_geometry[2].X() - face_geometry[0].X();
2315 v2[1] = face_geometry[2].Y() - face_geometry[0].Y();
2316 v2[2] = face_geometry[2].Z() - face_geometry[0].Z();
2319 area_normal *= -0.5;
2332 unsigned int n_nodes = rNodes.size();
2334 std::vector<array_1d<double, 3>> position;
2338 for (
typename ModelPart::NodesContainerType::iterator node_it = rNodes.begin(); node_it != rNodes.end(); node_it++)
2341 unsigned int i_node =
static_cast<unsigned int>(node_it->FastGetSolutionStepValue(AUX_INDEX));
2343 noalias(position[i_node]) = node_it->Coordinates();
2346 mHmin[i_node] = 1e10;
2350 for (
unsigned int i_node = 0; i_node <
n_nodes; i_node++)
2352 mHmin[i_node] = aaa[i_node];
2356 if constexpr (TDim == 2)
2358 for (
unsigned int i_node = 0; i_node <
n_nodes; i_node++)
2360 double &h_i = mHavg[i_node];
2363 h_i = sqrt(2.0 * m_i);
2366 else if constexpr (TDim == 3)
2368 for (
unsigned int i_node = 0; i_node <
n_nodes; i_node++)
2370 double &h_i = mHavg[i_node];
2373 h_i = pow(6.0 * m_i, 1.0 / 3.0);
2378 for (
unsigned int i_node = 0; i_node <
n_nodes; i_node++)
2380 array_1d<double, 3> &pos_i = position[i_node];
2382 for (
unsigned int csr_index = mr_matrix_container.
GetRowStartIndex()[i_node]; csr_index != mr_matrix_container.
GetRowStartIndex()[i_node + 1]; csr_index++)
2384 unsigned int j_neighbour = mr_matrix_container.
GetColumnIndex()[csr_index];
2385 array_1d<double, 3> &pos_j = position[j_neighbour];
2387 array_1d<double, TDim> &l_k = mEdgeDimensions[csr_index];
2388 for (
unsigned int comp = 0; comp < TDim; comp++)
2389 l_k[comp] = pos_i[comp] - pos_j[comp];
2399 void CalculateRHS_convection(
2412 array_1d<double, TDim> a_i;
2413 array_1d<double, TDim> a_j;
2415 #pragma omp parallel for private(stab_low, stab_high, a_i, a_j)
2416 for (
int i_node = 0; i_node <
n_nodes; i_node++)
2418 double &rhs_i =
rhs[i_node];
2419 const double &h_i = mHavg[i_node];
2420 const double &phi_i = mphi[i_node];
2421 noalias(a_i) = convective_velocity[i_node];
2422 a_i /= mEps[i_node];
2424 const array_1d<double, TDim> &proj_i = mPiConvection[i_node];
2425 double pi_i = proj_i[0] * a_i[0];
2426 for (
unsigned int l_comp = 1; l_comp < TDim; l_comp++)
2427 pi_i += proj_i[l_comp] * a_i[l_comp];
2431 if (active_nodes[i_node] != 0.0)
2433 const double &beta = mBeta[i_node];
2435 double norm_a = a_i[0] * a_i[0];
2436 for (
unsigned int l_comp = 1; l_comp < TDim; l_comp++)
2437 norm_a += a_i[l_comp] * a_i[l_comp];
2438 norm_a = sqrt(norm_a);
2441 for (
unsigned int csr_index = mr_matrix_container.
GetRowStartIndex()[i_node]; csr_index != mr_matrix_container.
GetRowStartIndex()[i_node + 1]; csr_index++)
2443 unsigned int j_neighbour = mr_matrix_container.
GetColumnIndex()[csr_index];
2445 if (active_nodes[j_neighbour] != 0.0)
2447 const double &phi_j = mphi[j_neighbour];
2448 noalias(a_j) = convective_velocity[j_neighbour];
2449 a_j /= mEps[j_neighbour];
2451 const array_1d<double, TDim> &proj_j = mPiConvection[j_neighbour];
2452 double pi_j = proj_j[0] * a_i[0];
2453 for (
unsigned int l_comp = 1; l_comp < TDim; l_comp++)
2454 pi_j += proj_j[l_comp] * a_i[l_comp];
2459 edge_ij.Sub_ConvectiveContribution(rhs_i, a_i, phi_i, a_j, phi_j);
2462 edge_ij.CalculateConvectionStabilization_LOW(stab_low, a_i, phi_i, a_j, phi_j);
2464 double edge_tau = mTauConvection[i_node];
2466 edge_ij.CalculateConvectionStabilization_HIGH(stab_high, a_i, pi_i, a_j, pi_j);
2468 edge_ij.Sub_StabContribution(rhs_i, edge_tau, 1.0, stab_low, stab_high);
2470 double coeff = 0.5 * mshock_coeff;
2471 double laplacian_ij = 0.0;
2472 edge_ij.CalculateScalarLaplacian(laplacian_ij);
2473 double capturing = laplacian_ij * (phi_j - phi_i);
2476 for (
unsigned int k_comp = 0; k_comp < TDim; k_comp++)
2477 for (
unsigned int m_comp = 0; m_comp < TDim; m_comp++)
2478 aaa += a_i[k_comp] * a_i[m_comp] * edge_ij.LaplacianIJ(k_comp, m_comp);
2482 aaa /= (norm_a * norm_a);
2483 double capturing2 = aaa * (phi_j - phi_i);
2485 if (fabs(capturing) > fabs(capturing2))
2486 rhs_i -=
coeff * (capturing - capturing2) * beta * norm_a * h_i;
2498 void CornerDectectionHelper(Geometry<Node> &face_geometry,
2499 const array_1d<double, 3> &face_normal,
2501 const GlobalPointersVector<Condition> &neighb,
2502 const unsigned int i1,
2503 const unsigned int i2,
2504 const unsigned int neighb_index,
2505 std::vector<unsigned int> &edge_nodes,
2508 double acceptable_angle = 45.0 / 180.0 * 3.1;
2509 double acceptable_cos = cos(acceptable_angle);
2511 if (face_geometry[i1].Id() < face_geometry[i2].Id())
2513 const array_1d<double, 3> &neighb_normal = neighb[neighb_index].GetValue(NORMAL);
2514 double neighb_An =
norm_2(neighb_normal);
2516 double cos_normal = 1.0 / (An * neighb_An) *
inner_prod(face_normal, neighb_normal);
2519 if (cos_normal < acceptable_cos)
2521 array_1d<double, 3> edge = face_geometry[i2].Coordinates() - face_geometry[i1].Coordinates();
2525 int index1 = face_geometry[i1].FastGetSolutionStepValue(AUX_INDEX);
2526 int index2 = face_geometry[i2].FastGetSolutionStepValue(AUX_INDEX);
2528 edge_nodes[index1] += 1;
2529 edge_nodes[index2] += 1;
2532 for (
unsigned int i = 0;
i < edge.size();
i++)
2534 sign1 += cornern_list[index1][
i] * edge[
i];
2539 for (
unsigned int i = 0;
i < edge.size();
i++)
2540 cornern_list[index1][
i] += edge[
i];
2544 for (
unsigned int i = 0;
i < edge.size();
i++)
2545 cornern_list[index1][
i] -= edge[
i];
2548 double sign2 =
inner_prod(cornern_list[index2], edge);
2551 for (
unsigned int i = 0;
i < edge.size();
i++)
2552 cornern_list[index2][
i] += edge[
i];
2556 for (
unsigned int i = 0;
i < edge.size();
i++)
2557 cornern_list[index2][
i] -= edge[
i];
2570 array_1d<double, 3> area_normal;
2573 unsigned int n_nodes = mNodalFlag.size();
2574 std::vector<unsigned int> temp_edge_nodes(
n_nodes);
2576 for (
unsigned int i_node = 0; i_node <
n_nodes; i_node++)
2578 temp_edge_nodes[i_node] = 0.0;
2583 for (ModelPart::ConditionsContainerType::iterator cond_it = rConditions.begin(); cond_it != rConditions.end(); cond_it++)
2586 Geometry<Node> &face_geometry = cond_it->GetGeometry();
2589 const array_1d<double, 3> &face_normal = cond_it->GetValue(NORMAL);
2590 double An =
norm_2(face_normal);
2595 if (cond_it->Is(SLIP))
2597 const GlobalPointersVector<Condition> &neighb = cond_it->GetValue(NEIGHBOUR_CONDITIONS);
2601 CornerDectectionHelper(face_geometry, face_normal, An, neighb, 1, 2, 0, temp_edge_nodes, temp_cornern_list);
2605 CornerDectectionHelper(face_geometry, face_normal, An, neighb, 2, 0, 1, temp_edge_nodes, temp_cornern_list);
2609 CornerDectectionHelper(face_geometry, face_normal, An, neighb, 0, 1, 2, temp_edge_nodes, temp_cornern_list);
2614 std::vector<unsigned int> tempmedge_nodes;
2615 std::vector<array_1d<double, TDim>> tempmedge_nodes_direction;
2616 std::vector<unsigned int> tempmcorner_nodes;
2617 for (
unsigned int i_node = 0; i_node <
n_nodes; i_node++)
2619 if (temp_edge_nodes[i_node] == 2)
2621 tempmedge_nodes.push_back(i_node);
2622 array_1d<double, TDim> &node_edge = temp_cornern_list[i_node];
2624 node_edge /=
norm_2(node_edge);
2625 tempmedge_nodes_direction.push_back(node_edge);
2627 else if (temp_edge_nodes[i_node] > 2)
2628 tempmcorner_nodes.push_back(i_node);
2630 medge_nodes.resize(tempmedge_nodes.size(),
false);
2631 medge_nodes_direction.resize(tempmedge_nodes_direction.size(),
false);
2632 mcorner_nodes.resize(tempmcorner_nodes.size(),
false);
2634 IndexPartition<unsigned int>(tempmedge_nodes.size()).for_each([&](
unsigned int i){
2635 medge_nodes[
i] = tempmedge_nodes[
i];
2636 medge_nodes_direction[
i] = tempmedge_nodes_direction[
i];
2639 IndexPartition<unsigned int>(tempmcorner_nodes.size()).for_each([&](
unsigned int i){
2640 mcorner_nodes[
i] = tempmcorner_nodes[
i];
2643 for (
int i = 0; i < static_cast<int>(mcorner_nodes.size());
i++)
2651 double ComputePorosityCoefficient(
const double &vel_norm,
const double &eps,
const double &
a,
const double &
b)
2657 non_linear = eps *
b * vel_norm;
2659 return linear + non_linear;
2667 IndexPartition<unsigned int>(
n_nodes).for_each([&](
unsigned int i_node){
2668 double dist = mdistances[i_node];
2670 double correction = 0.0;
2671 const double &origin_i = to_be_smoothed[i_node];
2676 for (
unsigned int csr_index = mr_matrix_container.
GetRowStartIndex()[i_node]; csr_index != mr_matrix_container.
GetRowStartIndex()[i_node + 1]; csr_index++)
2678 unsigned int j_neighbour = mr_matrix_container.GetColumnIndex()[csr_index];
2679 const double &origin_j = to_be_smoothed[j_neighbour];
2681 CSR_Tuple &edge_ij = mr_matrix_container.GetEdgeValues()[csr_index];
2684 edge_ij.CalculateScalarLaplacian(l_ikjk);
2686 correction += l_ikjk * (origin_j - origin_i);
2690 aux[i_node] = origin_i - correction;
2693 IndexPartition<unsigned int>(
n_nodes).for_each([&](
unsigned int i_node){
2694 to_be_smoothed[i_node] = aux[i_node];
2698 void ComputeWallResistance(
2707 double ym = mY_wall;
2708 double y_plus_incercept = 10.9931899;
2709 unsigned int itmax = 100;
2712 int slip_size = mSlipBoundaryList.size();
2714 #pragma omp parallel for firstprivate(slip_size, B, toll, ym, y_plus_incercept, itmax)
2715 for (
int i_slip = 0; i_slip < slip_size; i_slip++)
2717 unsigned int i_node = mSlipBoundaryList[i_slip];
2718 double dist = mdistances[i_node];
2722 KRATOS_ERROR_IF(mViscosity[i_node] == 0) <<
"it is not possible to use the wall law with 0 viscosity" << std::endl;
2724 const double nu = mViscosity[i_node];
2727 const array_1d<double, TDim> &U_i =
vel[i_node];
2728 const array_1d<double, TDim> &an_i = mSlipNormal[i_node];
2731 double mod_vel = 0.0;
2733 for (
unsigned int comp = 0; comp < TDim; comp++)
2735 mod_vel += U_i[comp] * U_i[comp];
2736 area += an_i[comp] * an_i[comp];
2738 mod_vel = sqrt(mod_vel);
2740 diag_stiffness[i_node] += area * mod_vel / pow(1.0 /
k * log(100.00) +
B, 2);
2742 double mod_uthaw = sqrt(mod_vel *
nu / ym);
2743 const double y_plus = ym * mod_uthaw /
nu;
2745 if (y_plus > y_plus_incercept)
2748 unsigned int it = 0;
2751 while (fabs(dx) > toll * mod_uthaw && it < itmax)
2754 double temp =
a * log(ym * mod_uthaw /
nu) +
B;
2755 double y = mod_uthaw * (
temp)-mod_vel;
2756 double y1 =
temp +
a;
2763 std::cout <<
"attention max number of iterations exceeded in wall law computation" << std::endl;
2767 diag_stiffness[i_node] += 0.0;
2771 void ApplySmagorinsky3D(
double MolecularViscosity,
double Cs)
2776 array_1d<double, TDim> grad_vx;
2777 array_1d<double, TDim> grad_vy;
2778 array_1d<double, TDim> grad_vz;
2781 array_1d<double, TDim> stab_high;
2783 #pragma omp parallel for private(grad_vx, grad_vy, grad_vz)
2784 for (
int i_node = 0; i_node <
n_nodes; i_node++)
2787 for (
unsigned int comp = 0; comp < TDim; comp++)
2789 grad_vx[comp] = 0.0;
2790 grad_vy[comp] = 0.0;
2791 grad_vz[comp] = 0.0;
2794 const array_1d<double, TDim> &U_i = mvel_n1[i_node];
2795 const double h = mHmin[i_node];
2797 for (
unsigned int csr_index = mr_matrix_container.
GetRowStartIndex()[i_node]; csr_index != mr_matrix_container.
GetRowStartIndex()[i_node + 1]; csr_index++)
2799 unsigned int j_neighbour = mr_matrix_container.
GetColumnIndex()[csr_index];
2800 const array_1d<double, TDim> &U_j = mvel_n1[j_neighbour];
2802 edge_ij.Add_grad_p(grad_vx, U_i[0], U_j[0]);
2803 edge_ij.Add_grad_p(grad_vy, U_i[1], U_j[1]);
2804 edge_ij.Add_grad_p(grad_vz, U_i[2], U_j[2]);
2808 for (
unsigned int comp = 0; comp < TDim; comp++)
2810 grad_vx[comp] *= m_inv;
2811 grad_vy[comp] *= m_inv;
2812 grad_vz[comp] *= m_inv;
2818 grad_vx[1] += grad_vy[0];
2819 grad_vx[2] += grad_vz[0];
2820 grad_vy[2] += grad_vz[1];
2821 grad_vy[0] += grad_vx[1];
2822 grad_vz[0] += grad_vx[2];
2823 grad_vz[1] += grad_vy[2];
2827 for (
unsigned int comp = 0; comp < TDim; comp++)
2829 aux += grad_vx[comp] * grad_vx[comp];
2830 aux += grad_vy[comp] * grad_vy[comp];
2831 aux += grad_vz[comp] * grad_vz[comp];
2836 double turbulent_viscosity = Cs *
h *
h * sqrt(aux) ;
2838 mViscosity[i_node] = turbulent_viscosity + MolecularViscosity;
2844 void ApplySmagorinsky2D(
double MolecularViscosity,
double Cs)
2849 array_1d<double, TDim> grad_vx;
2850 array_1d<double, TDim> grad_vy;
2854 array_1d<double, TDim> stab_high;
2856 #pragma omp parallel for private(grad_vx, grad_vy)
2857 for (
int i_node = 0; i_node <
n_nodes; i_node++)
2860 for (
unsigned int comp = 0; comp < TDim; comp++)
2862 grad_vx[comp] = 0.0;
2863 grad_vy[comp] = 0.0;
2866 const array_1d<double, TDim> &U_i = mvel_n1[i_node];
2867 const double h = mHmin[i_node];
2869 for (
unsigned int csr_index = mr_matrix_container.
GetRowStartIndex()[i_node]; csr_index != mr_matrix_container.
GetRowStartIndex()[i_node + 1]; csr_index++)
2871 unsigned int j_neighbour = mr_matrix_container.
GetColumnIndex()[csr_index];
2872 const array_1d<double, TDim> &U_j = mvel_n1[j_neighbour];
2874 edge_ij.Add_grad_p(grad_vx, U_i[0], U_j[0]);
2875 edge_ij.Add_grad_p(grad_vy, U_i[1], U_j[1]);
2879 for (
unsigned int comp = 0; comp < TDim; comp++)
2881 grad_vx[comp] *= m_inv;
2882 grad_vy[comp] *= m_inv;
2887 grad_vx[1] += grad_vy[0];
2888 grad_vy[0] += grad_vx[1];
2891 for (
unsigned int comp = 0; comp < TDim; comp++)
2893 aux += grad_vx[comp] * grad_vx[comp];
2894 aux += grad_vy[comp] * grad_vy[comp];
2899 double turbulent_viscosity = Cs *
h *
h * sqrt(aux) ;
2901 mViscosity[i_node] = turbulent_viscosity + MolecularViscosity;
2907 void Add_Effective_Inverse_Multiply(
2916 int loop_size = destination.size();
2918 IndexPartition<unsigned int>(loop_size).for_each([&](
unsigned int i_node){
2919 array_1d<double, TDim> &dest = destination[i_node];
2920 const double m = mass[i_node];
2921 const double d = diag_stiffness[i_node];
2922 const array_1d<double, TDim> &origin_vec1 = origin1[i_node];
2923 const array_1d<double, TDim> &origin_value = origin[i_node];
2925 for (
unsigned int comp = 0; comp < TDim; comp++)
2926 dest[comp] = value / (
m + value *
d) * (
m / value * origin_vec1[comp] + origin_value[comp]);
Definition: edgebased_levelset.h:39
TSparseSpace::VectorType TSystemVectorType
Definition: edgebased_levelset.h:54
EdgeBasedLevelSet(MatrixContainer &mr_matrix_container, ModelPart &mr_model_part, const double viscosity, const double density, bool use_mass_correction, double stabdt_pressure_factor, double stabdt_convection_factor, double tau2_factor, bool assume_constant_dp)
Definition: edgebased_levelset.h:60
void UpdateFixedVelocityValues()
Definition: edgebased_levelset.h:384
void PushFreeSurface()
Definition: edgebased_levelset.h:2024
double ComputeWetVolume()
Definition: edgebased_levelset.h:1956
double ComputeTimeStep(const double CFLNumber, const double MaxDt)
Definition: edgebased_levelset.h:292
void Initialize()
Definition: edgebased_levelset.h:97
void DiscreteVolumeCorrection(double expected_volume, double measured_volume)
Definition: edgebased_levelset.h:1982
vector< unsigned int > IndicesVectorType
Definition: edgebased_levelset.h:46
~EdgeBasedLevelSet()
Definition: edgebased_levelset.h:92
void CalculatePorousResistanceLaw(unsigned int res_law)
Definition: edgebased_levelset.h:2159
void Clear()
Definition: edgebased_levelset.h:1654
std::size_t SizeType
Definition: edgebased_levelset.h:56
void ConvectDistance()
Definition: edgebased_levelset.h:1693
void ApplyVelocityBC(CalcVectorType &VelArray)
Definition: edgebased_levelset.h:1113
vector< CSR_Tuple > EdgesVectorType
Definition: edgebased_levelset.h:43
void MarkInternalNodes()
Definition: edgebased_levelset.h:1501
double ComputeVolumeVariation()
Definition: edgebased_levelset.h:1928
void MarkInternalAndMixedNodes()
Definition: edgebased_levelset.h:1472
void ChangeSignToDistance()
Definition: edgebased_levelset.h:1396
void SolveStep2(typename TLinearSolver::Pointer pLinearSolver)
Definition: edgebased_levelset.h:669
double ComputeBoundedTimeStep(const double CFLNumber, const double MaxDt)
Definition: edgebased_levelset.h:2055
void ActivateWallResistance(double Ywall)
Definition: edgebased_levelset.h:1922
vector< array_1d< double, TDim > > CalcVectorType
Definition: edgebased_levelset.h:48
void SolveStep3()
Definition: edgebased_levelset.h:1021
bool CheckDistanceConvection()
Definition: edgebased_levelset.h:1866
void SetShockCapturingCoefficient(double coeff)
Definition: edgebased_levelset.h:284
void SolveStep1()
Definition: edgebased_levelset.h:411
void ApplySmagorinsky(double MolecularViscosity, double Cs)
Definition: edgebased_levelset.h:373
TSparseSpace::MatrixType TSystemMatrixType
Definition: edgebased_levelset.h:53
void MarkExternalAndMixedNodes()
Definition: edgebased_levelset.h:1443
vector< double > ValuesVectorType
Definition: edgebased_levelset.h:50
void ExtrapolateValues(unsigned int extrapolation_layers)
Definition: edgebased_levelset.h:1203
void ReduceTimeStep(ModelPart &rModelPart, double NewTime)
Definition: edgebased_levelset.h:1856
void MarkNodesByDistance(double min, double max)
Definition: edgebased_levelset.h:1411
EdgesStructureType< TDim > CSR_Tuple
Definition: edgebased_levelset.h:42
void CalculateNormals(ModelPart::ConditionsContainerType &rConditions)
Definition: edgebased_levelset.h:1528
void SaveScalarVariableToOldStep(Variable< double > &rVar)
Definition: edgebased_levelset.h:1429
void CalculateRHS(const CalcVectorType &vel, const ValuesVectorType &pressure, const CalcVectorType &convective_velocity, CalcVectorType &rhs, ValuesVectorType &diag_stiffness)
Definition: edgebased_levelset.h:562
Definition: edge_data.h:42
void Sub_ViscousContribution(array_1d< double, TDim > &destination, const array_1d< double, TDim > &U_i, const double &nu_i, const array_1d< double, TDim > &U_j, const double &nu_j)
Definition: edge_data.h:362
void Sub_ConvectiveContribution(array_1d< double, TDim > &destination, const array_1d< double, TDim > &a_i, const array_1d< double, TDim > &U_i, const array_1d< double, TDim > &a_j, const array_1d< double, TDim > &U_j)
Definition: edge_data.h:167
void Add_grad_p(array_1d< double, TDim > &destination, const double &p_i, const double &p_j)
Definition: edge_data.h:99
void Sub_StabContribution(array_1d< double, TDim > &destination, const double tau, const double beta, const array_1d< double, TDim > &stab_low, const array_1d< double, TDim > &stab_high)
Definition: edge_data.h:330
void CalculateConvectionStabilization_HIGH(array_1d< double, TDim > &stab_high, const array_1d< double, TDim > &a_i, const array_1d< double, TDim > &pi_i, const array_1d< double, TDim > &a_j, const array_1d< double, TDim > &pi_j)
Definition: edge_data.h:265
void Add_D_v(double &destination, const array_1d< double, TDim > &v_i, const array_1d< double, TDim > &v_j)
Definition: edge_data.h:78
void Sub_grad_p(array_1d< double, TDim > &destination, const double &p_i, const double &p_j)
Definition: edge_data.h:105
void CalculateConvectionStabilization_LOW(array_1d< double, TDim > &stab_low, const array_1d< double, TDim > &a_i, const array_1d< double, TDim > &U_i, const array_1d< double, TDim > &a_j, const array_1d< double, TDim > &U_j)
Definition: edge_data.h:240
Geometry base class.
Definition: geometry.h:71
This class is a vector which stores global pointers.
Definition: global_pointers_vector.h:61
boost::indirect_iterator< typename TContainerType::iterator > iterator
Definition: global_pointers_vector.h:79
void push_back(TPointerType x)
Definition: global_pointers_vector.h:322
iterator begin()
Definition: global_pointers_vector.h:221
iterator end()
Definition: global_pointers_vector.h:229
This class is useful for index iteration over containers.
Definition: parallel_utilities.h:451
void for_each(TUnaryFunction &&f)
Definition: parallel_utilities.h:514
static T CrossProduct(const T &a, const T &b)
Performs the vector product of the two input vectors a,b.
Definition: math_utils.h:762
Definition: edge_data.h:381
void WriteVectorToDatabase(Variable< array_1d< double, 3 >> &rVariable, CalcVectorType &rOrigin, ModelPart::NodesContainerType &rNodes)
Definition: edge_data.h:905
void AssignVectorToVector(const CalcVectorType &origin, CalcVectorType &destination)
Definition: edge_data.h:1082
ValuesVectorType & GetLumpedMass()
Definition: edge_data.h:420
void FillOldScalarFromDatabase(Variable< double > &rVariable, ValuesVectorType &rDestination, ModelPart::NodesContainerType &rNodes)
Definition: edge_data.h:879
void SetToZero(EdgesVectorType &data_vector)
Definition: edge_data.h:1038
IndicesVectorType & GetColumnIndex()
Definition: edge_data.h:410
ValuesVectorType & GetInvertedMass()
Definition: edge_data.h:425
IndicesVectorType & GetRowStartIndex()
Definition: edge_data.h:415
void FillVectorFromDatabase(Variable< array_1d< double, 3 >> &rVariable, CalcVectorType &rDestination, ModelPart::NodesContainerType &rNodes)
Definition: edge_data.h:790
void FillScalarFromDatabase(Variable< double > &rVariable, ValuesVectorType &rDestination, ModelPart::NodesContainerType &rNodes)
Definition: edge_data.h:851
void WriteScalarToDatabase(Variable< double > &rVariable, ValuesVectorType &rOrigin, ModelPart::NodesContainerType &rNodes)
Definition: edge_data.h:933
void Add_Minv_value(CalcVectorType &destination, const CalcVectorType &origin1, const double value, const ValuesVectorType &Minv_vec, const CalcVectorType &origin)
Definition: edge_data.h:963
void FillOldVectorFromDatabase(Variable< array_1d< double, 3 >> &rVariable, CalcVectorType &rDestination, ModelPart::NodesContainerType &rNodes)
Definition: edge_data.h:821
void FillCoordinatesFromDatabase(CalcVectorType &rDestination, ModelPart::NodesContainerType &rNodes)
Definition: edge_data.h:759
ValuesVectorType & GetHmin()
Definition: edge_data.h:435
unsigned int GetNumberEdges()
Definition: edge_data.h:400
EdgesVectorType & GetEdgeValues()
Definition: edge_data.h:405
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
MeshType::ConditionsContainerType ConditionsContainerType
Condintions container. A vector set of Conditions with their Id's as key.
Definition: model_part.h:183
void OverwriteSolutionStepData(IndexType SourceSolutionStepIndex, IndexType DestinationSourceSolutionStepIndex)
Definition: model_part.cpp:180
NodeIterator NodesBegin(IndexType ThisIndex=0)
Definition: model_part.h:487
ConditionsContainerType & Conditions(IndexType ThisIndex=0)
Definition: model_part.h:1381
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
MeshType::NodesContainerType NodesContainerType
Nodes container. Which is a vector set of nodes with their Id's as key.
Definition: model_part.h:128
NodeIterator NodesEnd(IndexType ThisIndex=0)
Definition: model_part.h:497
NodesContainerType & Nodes(IndexType ThisIndex=0)
Definition: model_part.h:507
This class defines the node.
Definition: node.h:65
static void DivideInPartitions(const int NumTerms, const int NumThreads, PartitionVector &Partitions)
Divide an array of length NumTerms between NumThreads threads.
Definition: openmp_utils.h:158
static int ThisThread()
Wrapper for omp_get_thread_num().
Definition: openmp_utils.h:108
static int GetNumThreads()
Returns the current number of threads.
Definition: parallel_utilities.cpp:34
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
void SetCurrentTime(double NewTime)
Definition: process_info.cpp:63
#define KRATOS_THROW_ERROR(ExceptionType, ErrorMessage, MoreInfo)
Definition: define.h:77
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_WATCH(variable)
Definition: define.h:806
#define KRATOS_TRY
Definition: define.h:109
#define KRATOS_ERROR_IF(conditional)
Definition: exception.h:162
dt
Definition: DEM_benchmarks.py:173
end
Definition: DEM_benchmarks.py:180
static double max(double a, double b)
Definition: GeometryFunctions.h:79
static double min(double a, double b)
Definition: GeometryFunctions.h:71
Parameters GetValue(Parameters &rParameters, const std::string &rEntry)
Definition: add_kratos_parameters_to_python.cpp:53
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
TExpressionType::data_type norm_2(AMatrix::MatrixExpression< TExpressionType, TCategory > const &TheExpression)
Definition: amatrix_interface.h:625
TExpression1Type::data_type inner_prod(AMatrix::MatrixExpression< TExpression1Type, TCategory1 > const &First, AMatrix::MatrixExpression< TExpression2Type, TCategory2 > const &Second)
Definition: amatrix_interface.h:592
std::vector< PointTypePointer > PointVector
Definition: internal_variables_interpolation_process.h:53
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
TABLE_NUMBER_ANGULAR_VELOCITY TABLE_NUMBER_MOMENT I33 BEAM_INERTIA_ROT_UNIT_LENGHT_Y KRATOS_DEFINE_APPLICATION_VARIABLE(DEM_APPLICATION, double, BEAM_INERTIA_ROT_UNIT_LENGHT_Z) typedef std double
Definition: DEM_application_variables.h:182
PointVector::iterator PointIterator
Definition: internal_variables_interpolation_process.h:54
Point PointType
Geometric definitions.
Definition: mortar_classes.h:36
list coeff
Definition: bombardelli_test.py:41
float dist
Definition: edgebased_PureConvection.py:89
bool use_mass_correction
Definition: edgebased_var.py:13
float viscosity
Definition: edgebased_var.py:8
int extrapolation_layers
Definition: edgebased_var.py:15
float density
Definition: face_heat.py:56
y
Other simbols definition.
Definition: generate_axisymmetric_navier_stokes_element.py:54
tau
Definition: generate_convection_diffusion_explicit_element.py:115
h
Definition: generate_droplet_dynamics.py:91
rhs
Definition: generate_frictional_mortar_condition.py:297
a
Definition: generate_stokes_twofluid_element.py:77
b
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:31
int n_nodes
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:15
nu
Definition: isotropic_damage_automatic_differentiation.py:135
int t
Definition: ode_solve.py:392
int d
Definition: ode_solve.py:397
int n
manufactured solution and derivatives (u=0 at z=0 dudz=0 at z=domain_height)
Definition: ode_solve.py:402
vel
Definition: pure_conduction.py:76
int k
Definition: quadrature.py:595
int j
Definition: quadrature.py:648
float temp
Definition: rotating_cone.py:85
float delta_t
Definition: rotatingcone_PureConvectionBenchmarking.py:129
int m
Definition: run_marine_rain_substepping.py:8
body_force
Definition: script_ELASTIC.py:102
int current_id
Output settings end ####.
Definition: script.py:194
B
Definition: sensitivityMatrix.py:76
integer i
Definition: TensorModule.f:17
integer function sign1(a)
Definition: TensorModule.f:872
float pressure
Definition: test_pureconvectionsolver_benchmarking.py:101
e
Definition: run_cpp_mpi_tests.py:31
float factor
for node in (self.combined_model_part).Nodes: pold = node.GetSolutionStepValue(PRESSURE,...
Definition: ulf_PGLASS.py:254