Permalink
Browse files

Merge pull request #12548 from bwspenc/fix_meshed_gap_tests

Fix meshed gap tests
  • Loading branch information...
aeslaughter committed Nov 28, 2018
2 parents 40b8c6f + 147ac98 commit 9d9df1f057657e516298911e97cc26584c437481
@@ -99,8 +99,25 @@ class PenetrationThread
EDGE_AND_COMMON_NODE
};
/**
* When interactions are identified between a node and two faces, compete between the faces
* to determine whether first (pi1) or second (pi2) interaction is stronger
* @param pi1 Pointer to the PenetrationInfo object for the first face
* @param pi2 Pointer to the PenetrationInfo object for the second face
* @return Appropriate ComputeInterationResult enum entry identifying which face is a better match
*/
CompeteInteractionResult competeInteractions(PenetrationInfo * pi1, PenetrationInfo * pi2);
/**
* Determine whether first (pi1) or second (pi2) interaction is stronger when it is known
* that the node projects to both of the two competing faces
* @param pi1 Pointer to the PenetrationInfo object for the first face
* @param pi2 Pointer to the PenetrationInfo object for the second face
* @return Appropriate ComputeInterationResult enum entry identifying which face is a better match
*/
CompeteInteractionResult competeInteractionsBothOnFace(PenetrationInfo * pi1,
PenetrationInfo * pi2);
CommonEdgeResult interactionsOffCommonEdge(PenetrationInfo * pi1, PenetrationInfo * pi2);
bool findRidgeContactPoint(Point & contact_point,
@@ -15,6 +15,7 @@
#include "SubProblem.h"
#include "MooseVariableFE.h"
#include "MooseMesh.h"
#include "MooseUtils.h"
#include "libmesh/threads.h"
@@ -499,7 +500,6 @@ PenetrationThread::switchInfo(PenetrationInfo *& info, PenetrationInfo *& infoNe
infoNew = NULL; // Set this to NULL so that we don't delete it (now owned by _penetration_info).
}
// Determine whether first (pi1) or second (pi2) interaction is stronger
PenetrationThread::CompeteInteractionResult
PenetrationThread::competeInteractions(PenetrationInfo * pi1, PenetrationInfo * pi2)
{
@@ -527,42 +527,8 @@ PenetrationThread::competeInteractions(PenetrationInfo * pi1, PenetrationInfo *
result = SECOND_WINS;
else if (pi1->_tangential_distance == 0.0 && pi2->_tangential_distance == 0.0) // on both faces
{
if (pi1->_distance >= 0.0 &&
pi2->_distance < 0.0) // favor face with positive distance (penetrated)
result = FIRST_WINS;
else if (pi2->_distance >= 0.0 && pi1->_distance < 0.0)
result = SECOND_WINS;
else if (std::abs(pi1->_distance) < std::abs(pi2->_distance)) // otherwise, favor the closer
// face
{
// TODO: This could cause an abrupt jump from one face to the other. Smooth this transition
// Moose::out<<"Case1: n: "<<pi1->_node->id()<<" e1: "<<pi1->_elem->id()<<" e2:
// "<<pi2->_elem->id()<<std::endl;
result = FIRST_WINS;
}
else if (std::abs(pi2->_distance) < std::abs(pi1->_distance)) // otherwise, favor the closer
// face
{
// TODO: This could cause an abrupt jump from one face to the other. Smooth this transition
// Moose::out<<"Case2: n: "<<pi1->_node->id()<<" e1: "<<pi1->_elem->id()<<" e2:
// "<<pi2->_elem->id()<<std::endl;
result = SECOND_WINS;
}
else // completely equal. Favor the one with a smaller element id (for repeatibility)
{
// TODO: This could cause an abrupt jump from one face to the other. Smooth this transition
// Moose::out<<"Case3: n: "<<pi1->_node->id()<<" e1: "<<pi1->_elem->id()<<" e2:
// "<<pi2->_elem->id()<<std::endl;
if (pi1->_elem->id() < pi2->_elem->id())
result = FIRST_WINS;
result = competeInteractionsBothOnFace(pi1, pi2);
else
result = SECOND_WINS;
}
}
else if (pi1->_tangential_distance <= _tangential_tolerance &&
pi2->_tangential_distance <= _tangential_tolerance) // off but within tol of both faces
{
@@ -588,33 +554,39 @@ PenetrationThread::competeInteractions(PenetrationInfo * pi1, PenetrationInfo *
else
mooseError("Invalid off_edge_nodes counts");
}
else // Use the same logic as in the on-face condition (above). A little copy-paste can't
// hurt...
{
if (pi1->_distance >= 0.0 &&
pi2->_distance < 0.0) // favor face with positive distance (penetrated)
result = FIRST_WINS;
else // The node projects to both faces within tangential tolerance.
result = competeInteractionsBothOnFace(pi1, pi2);
}
else if (pi2->_distance >= 0.0 && pi1->_distance < 0.0)
result = SECOND_WINS;
return result;
}
else if (std::abs(pi1->_distance) <
std::abs(pi2->_distance)) // otherwise, favor the closer face
result = FIRST_WINS;
PenetrationThread::CompeteInteractionResult
PenetrationThread::competeInteractionsBothOnFace(PenetrationInfo * pi1, PenetrationInfo * pi2)
{
CompeteInteractionResult result = NEITHER_WINS;
else if (std::abs(pi2->_distance) <
std::abs(pi1->_distance)) // otherwise, favor the closer face
result = SECOND_WINS;
if (pi1->_distance >= 0.0 && pi2->_distance < 0.0)
result = FIRST_WINS; // favor face with positive distance (penetrated) -- first in this case
else // completely equal. Favor the one with a smaller element id (for repeatibility)
{
if (pi1->_elem->id() < pi2->_elem->id())
result = FIRST_WINS;
else if (pi2->_distance >= 0.0 && pi1->_distance < 0.0)
result = SECOND_WINS; // favor face with positive distance (penetrated) -- second in this case
else
result = SECOND_WINS;
}
}
// TODO: This logic below could cause an abrupt jump from one face to the other with small mesh
// movement. If there is some way to smooth the transition, we should do it.
else if (MooseUtils::relativeFuzzyLessThan(std::abs(pi1->_distance), std::abs(pi2->_distance)))
result = FIRST_WINS; // otherwise, favor the closer face -- first in this case
else if (MooseUtils::relativeFuzzyLessThan(std::abs(pi2->_distance), std::abs(pi1->_distance)))
result = SECOND_WINS; // otherwise, favor the closer face -- second in this case
else // Equal within tolerance. Favor the one with a smaller element id (for repeatibility)
{
if (pi1->_elem->id() < pi2->_elem->id())
result = FIRST_WINS;
else
result = SECOND_WINS;
}
return result;
@@ -7,6 +7,7 @@
[Variables]
[./temp]
block = '1 3'
initial_condition = 1.0
[../]
[]
@@ -20,6 +21,7 @@
type = HeatSource
variable = temp
block = 3
value = 10.0
[../]
[]
@@ -28,7 +30,7 @@
type = DirichletBC
variable = temp
boundary = 1
value = 0
value = 1.0
[../]
[]
@@ -7,6 +7,7 @@
[Variables]
[./temp]
block = '1 3'
initial_condition = 1.0
[../]
[]
@@ -23,13 +24,13 @@
type = DirichletBC
variable = temp
boundary = 1
value = 0
value = 1
[../]
[./right]
type = DirichletBC
variable = temp
boundary = 4
value = 1
value = 2
[../]
[]
@@ -5,10 +5,6 @@
type = 'Exodiff'
input = 'meshed_gap_thermal_contact.i'
exodiff = 'meshed_gap_thermal_contact_out.e'
allow_warnings = true
# It's possible for this test to hit the "negative temperature" error
# because the test uses values 0 and 1 for boundary conditions and
# the solver may find slightly negative values in this case.
requirement = "The ThermalContact system shall enforce heat transfer
across a meshed gap in a 2D plane geometry."
[../]
@@ -17,7 +13,6 @@
type = 'Exodiff'
input = 'meshed_annulus_thermal_contact.i'
exodiff = 'meshed_annulus_thermal_contact_out.e'
allow_warnings = true
requirement = "The ThermalContact system shall enforce heat transfer
across a meshed circular annulus in a 2D plane geometry."
[../]

0 comments on commit 9d9df1f

Please sign in to comment.