-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvment and bugfixing in CFiniteElementVec #105
Conversation
{ | ||
if (smat->bishop_model < 0) // Without Bishop | ||
{ | ||
for (int i = 0; i < nnodes; i++) | ||
{ | ||
nodal_pore_p[i] = (biot < 0.0 && _nodal_p1[i] < 0.0) ? | ||
0.0 : LoadFactor * S_Water * _nodal_p1[i]; | ||
nodal_pore_p[i] = LoadFactor * _nodal_S[i] * _nodal_p1[i]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Element saturation to nodal saturation.
@@ -1721,7 +1683,7 @@ void CFiniteElementVec::GlobalAssembly_RHS() | |||
{ | |||
const double p0 = h_pcs->GetNodeValue(nodes[i], idx_p1_ini); | |||
const double Sat0 = LoadFactor * m_mmp->SaturationCapillaryPressureFunction(-p0); | |||
nodal_pore_p[i] -= (p0 > 0.0) ? LoadFactor * Sat0 * p0 : 0.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed the restriction of positive pore pressure in the total stress calculation for the partially saturated flow.
|
||
for (i = 0; i < nnodesHQ; i++) | ||
{ | ||
NodalVal2[i] = dm_pcs->GetNodeValue(nodes[i], Idx_dm1[0]); | ||
NodalVal3[i] = dm_pcs->GetNodeValue(nodes[i], Idx_dm1[1]); | ||
NodalVal2[i] = dm_pcs->GetNodeValue(nodes[i], Idx_dm0[0]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed a bug in the monolithic H2M.
@@ -2791,35 +2770,13 @@ void CRFProcessDeformation::PostExcavation() | |||
{ | |||
// MXDumpGLS("rf_pcs.txt",1,eqs->b,eqs->x); //abort();} | |||
// 07.04.2010 WW | |||
bool done; | |||
ElementValue_DM* eleV_DM = NULL; | |||
if ((fem_dm->Flow_Type == 0 || fem_dm->Flow_Type == 2 || fem_dm->Flow_Type == 1) && Neglect_H_ini == 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the repeated code.
FEM/fem_ele_vec.cpp
Outdated
Sw += shapefct[i] * _nodal_S[i]; | ||
} | ||
rho = (1. - porosity) * fabs(smat->Density()) + porosity * Sw * density_fluid; | ||
const double density_fluid = (mfp_vector.empty()) ? m_mfp->Density() : 0.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i am puzzled here. why should the fluid density be zero if mfp_vector is not empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, it is wrong. Removed the ternary operator.
FEM/fem_ele_vec.cpp
Outdated
|
||
if (Flow_Type == 2 || Flow_Type == 3) | ||
double rho = (1. - porosity) * fabs(smat->Density()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since smat->Density() is positive (line 738), fabs is not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed.
FEM/fem_ele_vec.cpp
Outdated
return rho; | ||
|
||
// If negative value is given in the .msp file, gravity by solid is skipped | ||
if (smat->Density() > 0.0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please correct indent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected.
FEM/fem_ele_vec.cpp
Outdated
double fac = 1.0; | ||
if (Flow_Type == 1) | ||
fac = -1.0; | ||
const double fac = (_flow_type == FiniteElement::RICHARDS_FLOW) ? -1. : 1.; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you write a comment here explaining what is fac variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added.
FEM/rf_pcs.cpp
Outdated
if ((GetCurveValue(ExcavCurve, 0, aktuelle_zeit, &valid) + ExcavBeginCoordinate) | ||
> (ele_center[ExcavDirection]) | ||
&& (ele_center[ExcavDirection] - ExcavBeginCoordinate) > -0.001) | ||
const double expected_coordinate = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i see these lines several times. can you create a function for this and remove repeated codes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created a new function.
…ess results of TH_usM modelling
…CFiniteElementVec
in the the local assmebly.
to remove the duplicated pieces of code.
8992194
to
c495882
Compare
c495882
to
efe1ed9
Compare
FEM/fem_ele_vec.cpp
Outdated
if ((GetCurveValue(pcs->ExcavCurve, 0, aktuelle_zeit, &valid) + pcs->ExcavBeginCoordinate) | ||
> (ele_center[pcs->ExcavDirection]) | ||
&& (ele_center[pcs->ExcavDirection] - pcs->ExcavBeginCoordinate) > -0.001) | ||
const double expected_coordinate = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't it possible to use the new function isPointInExcavatedDomain()
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace the lines with the new function.
@@ -1634,8 +1599,10 @@ void CFiniteElementVec::GlobalAssembly_RHS() | |||
else if (pcs->ExcavMaterialGroup > -1) | |||
{ | |||
double const* ele_center(elem->GetGravityCenter()); | |||
if ((GetCurveValue(pcs->ExcavCurve, 0, aktuelle_zeit, &valid) + pcs->ExcavBeginCoordinate) | |||
< (ele_center[pcs->ExcavDirection])) | |||
const double expected_coordinate = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just took a loot. Here the if-condition is different from that in the new function.
… code duplication
looks good |
This PR improves CFiniteElementVec, and it contains
The changes in 2) improves the computation solutions of the benchmarks for the THM coupled processes. Therefore the reference results of the affected benchmarks have to be updated too.