Skip to content
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

[DEMApplication][Fast] Clean up "global viscous damping" #13023

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions applications/DEMApplication/DEM_application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,6 @@ KRATOS_CREATE_VARIABLE(double, PARTICLE_INELASTIC_ROLLING_RESISTANCE_ENERGY)
KRATOS_CREATE_VARIABLE(double, PARTICLE_MAX_NORMAL_BALL_TO_BALL_FORCE_TIMES_RADIUS)
KRATOS_CREATE_VARIABLE(int, COMPUTE_ENERGY_OPTION)
KRATOS_CREATE_VARIABLE(double, GLOBAL_DAMPING)
KRATOS_CREATE_VARIABLE(double, GLOBAL_VISCOUS_DAMPING)
KRATOS_CREATE_VARIABLE(double, NORMAL_IMPACT_VELOCITY)
KRATOS_CREATE_VARIABLE(double, TANGENTIAL_IMPACT_VELOCITY)
KRATOS_CREATE_VARIABLE(double, FACE_NORMAL_IMPACT_VELOCITY)
Expand Down Expand Up @@ -883,7 +882,6 @@ void KratosDEMApplication::Register() {
KRATOS_REGISTER_VARIABLE(PARTICLE_MAX_NORMAL_BALL_TO_BALL_FORCE_TIMES_RADIUS)
KRATOS_REGISTER_VARIABLE(COMPUTE_ENERGY_OPTION)
KRATOS_REGISTER_VARIABLE(GLOBAL_DAMPING)
KRATOS_REGISTER_VARIABLE(GLOBAL_VISCOUS_DAMPING)
KRATOS_REGISTER_VARIABLE(NORMAL_IMPACT_VELOCITY)
KRATOS_REGISTER_VARIABLE(TANGENTIAL_IMPACT_VELOCITY)
KRATOS_REGISTER_VARIABLE(FACE_NORMAL_IMPACT_VELOCITY)
Expand Down
1 change: 0 additions & 1 deletion applications/DEMApplication/DEM_application_variables.h
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,6 @@ namespace Kratos
KRATOS_DEFINE_APPLICATION_VARIABLE(DEM_APPLICATION, double, PARTICLE_MAX_NORMAL_BALL_TO_BALL_FORCE_TIMES_RADIUS)
KRATOS_DEFINE_APPLICATION_VARIABLE(DEM_APPLICATION, int, COMPUTE_ENERGY_OPTION)
KRATOS_DEFINE_APPLICATION_VARIABLE(DEM_APPLICATION, double, GLOBAL_DAMPING)
KRATOS_DEFINE_APPLICATION_VARIABLE(DEM_APPLICATION, double, GLOBAL_VISCOUS_DAMPING)
KRATOS_DEFINE_APPLICATION_VARIABLE(DEM_APPLICATION, double, NORMAL_IMPACT_VELOCITY)
KRATOS_DEFINE_APPLICATION_VARIABLE(DEM_APPLICATION, double, TANGENTIAL_IMPACT_VELOCITY)
KRATOS_DEFINE_APPLICATION_VARIABLE(DEM_APPLICATION, double, FACE_NORMAL_IMPACT_VELOCITY)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ SphericParticle& SphericParticle::operator=(const SphericParticle& rOther) {
mSearchRadius = rOther.mSearchRadius;
mRealMass = rOther.mRealMass;
mClusterId = rOther.mClusterId;
mGlobalViscousDamping = rOther.mGlobalViscousDamping;
mDiscontinuumConstitutiveLaw = rOther.mDiscontinuumConstitutiveLaw->CloneUnique();
mRollingFrictionModel = rOther.mRollingFrictionModel->CloneUnique();
mGlobalDampingModel = rOther.mGlobalDampingModel->CloneUnique();
Expand Down Expand Up @@ -1803,15 +1802,6 @@ void SphericParticle::ComputeAdditionalForces(array_1d<double, 3>& externally_ap
noalias(externally_applied_force) += counter_force;}
} else {
noalias(externally_applied_force) += ComputeWeight(gravity, r_process_info);
//Global viscous damping force
const array_1d<double, 3>& vel = this->GetGeometry()[0].FastGetSolutionStepValue(VELOCITY);
const double vel_magnitude = DEM_MODULUS_3(vel);
if (vel_magnitude != 0.0)
{
mGlobalViscousDamping = r_process_info[GLOBAL_VISCOUS_DAMPING]; //update the coefficient of GLOBAL_VISCOUS_DAMPING
const array_1d<double, 3> viscous_damping_force = -2.0 * mGlobalViscousDamping * sqrt(GetMass() * GetRadius() * GetYoung()) * vel;
noalias(externally_applied_force) += viscous_damping_force;
}
noalias(externally_applied_force) += this->GetGeometry()[0].FastGetSolutionStepValue(EXTERNAL_APPLIED_FORCE);
noalias(externally_applied_moment) += this->GetGeometry()[0].FastGetSolutionStepValue(EXTERNAL_APPLIED_MOMENT);
}
Expand Down Expand Up @@ -1957,8 +1947,6 @@ void SphericParticle::MemberDeclarationFirstStep(const ProcessInfo& r_process_in
mStrainTensor = NULL;
mDifferentialStrainTensor = NULL;
}

mGlobalViscousDamping = r_process_info[GLOBAL_VISCOUS_DAMPING];
}

std::unique_ptr<DEMDiscontinuumConstitutiveLaw> SphericParticle::pCloneDiscontinuumConstitutiveLawWithNeighbour(SphericParticle* neighbour) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,6 @@ PropertiesProxy* mFastProperties;
int mClusterId;
DEMIntegrationScheme* mpTranslationalIntegrationScheme;
DEMIntegrationScheme* mpRotationalIntegrationScheme;
double mGlobalViscousDamping;
double mBondedScalingFactor[3] = {0.0};

private:
Expand Down Expand Up @@ -508,7 +507,6 @@ virtual void save(Serializer& rSerializer) const override
rSerializer.save("mSearchRadius", mSearchRadius);
rSerializer.save("mRealMass", mRealMass);
rSerializer.save("mClusterId", mClusterId);
rSerializer.save("mGlobalViscousDamping",mGlobalViscousDamping);
}

virtual void load(Serializer& rSerializer) override
Expand Down Expand Up @@ -562,7 +560,6 @@ virtual void load(Serializer& rSerializer) override
rSerializer.load("mSearchRadius", mSearchRadius);
rSerializer.load("mRealMass", mRealMass);
rSerializer.load("mClusterId", mClusterId);
rSerializer.load("mGlobalViscousDamping",mGlobalViscousDamping);
}

}; // Class SphericParticle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,6 @@ PYBIND11_MODULE(KratosDEMApplication,m)
KRATOS_REGISTER_IN_PYTHON_VARIABLE(m, PARTICLE_MAX_NORMAL_BALL_TO_BALL_FORCE_TIMES_RADIUS)
KRATOS_REGISTER_IN_PYTHON_VARIABLE(m, COMPUTE_ENERGY_OPTION)
KRATOS_REGISTER_IN_PYTHON_VARIABLE(m, GLOBAL_DAMPING)
KRATOS_REGISTER_IN_PYTHON_VARIABLE(m, GLOBAL_VISCOUS_DAMPING)
KRATOS_REGISTER_IN_PYTHON_VARIABLE(m, NORMAL_IMPACT_VELOCITY)
KRATOS_REGISTER_IN_PYTHON_VARIABLE(m, TANGENTIAL_IMPACT_VELOCITY)
KRATOS_REGISTER_IN_PYTHON_VARIABLE(m, FACE_NORMAL_IMPACT_VELOCITY)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ def GetDefaultInputParameters():
"ZStrainValue" : "0.0*t",
"ImposeZStrainIn2DWithControlModule" : false,
"GlobalDamping" : 0.0,
"GlobalViscousDamping" : 0.0,
"GlobalDampingModel" : "NonViscousConstantForceDirection",
"PoissonEffectOption" : true,
"ShearStrainParallelToBondOption" : true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,6 @@ def __init__(self, all_model_parts, creator_destructor, dem_fem_search, DEM_para
Logger.PrintWarning("DEM", "\nGlobal Damping parameter not found! No damping will be applied...\n")
else:
self.global_damping = DEM_parameters["GlobalDamping"].GetDouble()

if not "GlobalViscousDamping" in DEM_parameters.keys():
self.global_viscous_damping = 0.0
Logger.PrintWarning("DEM", "\nGlobal Viscous Damping parameter not found! No damping will be applied...\n")
else:
self.global_viscous_damping = DEM_parameters["GlobalViscousDamping"].GetDouble()

self.global_damping_option = self.global_damping != 0.0

Expand Down Expand Up @@ -315,7 +309,6 @@ def SetVariablesAndOptions(self):
self.spheres_model_part.ProcessInfo.SetValue(NODAL_MASS_COEFF, self.nodal_mass_coeff)
self.SetOneOrZeroInProcessInfoAccordingToBoolValue(self.spheres_model_part, ROLLING_FRICTION_OPTION, self.rolling_friction_option)
self.spheres_model_part.ProcessInfo.SetValue(GLOBAL_DAMPING, self.global_damping)
self.spheres_model_part.ProcessInfo.SetValue(GLOBAL_VISCOUS_DAMPING, self.global_viscous_damping)
self.SetOneOrZeroInProcessInfoAccordingToBoolValue(self.spheres_model_part, GLOBAL_DAMPING_OPTION, self.global_damping_option)
self.spheres_model_part.ProcessInfo.SetValue(DEM_GLOBAL_DAMPING_MODEL_NAME, self.global_damping_model)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
"VirtualMassCoefficient" : 1.0,
"RollingFrictionOption" : true,
"GlobalDamping" : 0.0,
"GlobalViscousDamping" : 0.0,
"ContactMeshOption" : true,
"OutputFileType" : "Ascii",
"Multifile" : "multiple_files",
Expand Down
Loading