FEM: Add tied contact with CalculiX (#23327)
* FEM: Update FemConstraintContact.cpp * FEM: Update FemConstraintContact.h * FEM: Update write_constraint_contact.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -30,6 +30,8 @@ using namespace Fem;
|
||||
|
||||
PROPERTY_SOURCE(Fem::ConstraintContact, Fem::Constraint)
|
||||
|
||||
static const char* SurfaceBehaviors[] = {"Hard", "Linear", "Tied", nullptr};
|
||||
|
||||
ConstraintContact::ConstraintContact()
|
||||
{
|
||||
/*Note: Initialise parameters here*/
|
||||
@@ -68,11 +70,12 @@ ConstraintContact::ConstraintContact()
|
||||
"ConstraintContact",
|
||||
App::PropertyType(App::Prop_None),
|
||||
"Thermal contact conductance");
|
||||
ADD_PROPERTY_TYPE(HardContact,
|
||||
(false),
|
||||
ADD_PROPERTY_TYPE(SurfaceBehavior,
|
||||
(1),
|
||||
"ConstraintContact",
|
||||
App::PropertyType(App::Prop_None),
|
||||
"Enable hard contact");
|
||||
App::Prop_None,
|
||||
"Surface behavior type");
|
||||
SurfaceBehavior.setEnums(SurfaceBehaviors);
|
||||
}
|
||||
|
||||
App::DocumentObjectExecReturn* ConstraintContact::execute()
|
||||
|
||||
@@ -53,7 +53,7 @@ public:
|
||||
App::PropertyStiffnessDensity StickSlope;
|
||||
App::PropertyBool EnableThermalContact;
|
||||
App::PropertyStringList ThermalContactConductance;
|
||||
App::PropertyBool HardContact;
|
||||
App::PropertyEnumeration SurfaceBehavior;
|
||||
|
||||
// etc
|
||||
/* */
|
||||
|
||||
@@ -92,12 +92,18 @@ def write_constraint(f, femobj, contact_obj, ccxwriter):
|
||||
dep_surf = "DEP" + contact_obj.Name
|
||||
f.write(f"{dep_surf}, {ind_surf}\n")
|
||||
f.write(f"*SURFACE INTERACTION, NAME=INT{contact_obj.Name}\n")
|
||||
if contact_obj.HardContact:
|
||||
f.write("*SURFACE BEHAVIOR, PRESSURE-OVERCLOSURE=HARD\n")
|
||||
else:
|
||||
if contact_obj.SurfaceBehavior == "Linear":
|
||||
f.write("*SURFACE BEHAVIOR, PRESSURE-OVERCLOSURE=LINEAR\n")
|
||||
slope = contact_obj.Slope.getValueAs("MPa/mm").Value
|
||||
f.write(f"{slope:.13G}\n")
|
||||
elif contact_obj.SurfaceBehavior == "Hard":
|
||||
f.write("*SURFACE BEHAVIOR, PRESSURE-OVERCLOSURE=HARD\n")
|
||||
elif contact_obj.SurfaceBehavior == "Tied":
|
||||
f.write("*SURFACE BEHAVIOR, PRESSURE-OVERCLOSURE=TIED\n")
|
||||
slope = contact_obj.Slope.getValueAs("MPa/mm").Value
|
||||
f.write(f"{slope:.13G}\n")
|
||||
else:
|
||||
return
|
||||
if contact_obj.Friction:
|
||||
f.write("*FRICTION\n")
|
||||
friction = contact_obj.FrictionCoefficient
|
||||
|
||||
Reference in New Issue
Block a user