white space and comment removal
This commit is contained in:
@ -256,7 +256,7 @@ void FixGranularMDR::pre_force(int)
|
||||
( psi[i] > 0.1 ) ? w_confinement = 1.0/(1.0 + exp(-75.0*(psi[i]-0.2))) : w_confinement = 0.0;
|
||||
const double dR = MAX(dRnumerator[i] / (dRdenominator[i] - 4.0 * MY_PI * pow(R, 2.0))*w_confinement, 0.0);
|
||||
|
||||
const double N_window = 10.0;
|
||||
const double N_window = 10.0;
|
||||
if (dR > 0.0) dRavg[i] += (dR - dRavg[i]) / N_window;
|
||||
|
||||
if (((radius[i] + dR) < (1.5 * Ro[i])) && (dR > 0.0)) radius[i] += dRavg[i];
|
||||
|
||||
@ -20,7 +20,6 @@
|
||||
#include "math_const.h"
|
||||
|
||||
#include "style_gran_sub_mod.h" // IWYU pragma: keep
|
||||
|
||||
#include <cmath>
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
@ -189,12 +188,7 @@ GranSubModDampingMDR::GranSubModDampingMDR(GranularModel *gm, LAMMPS *lmp) :
|
||||
double GranSubModDampingMDR::calculate_forces()
|
||||
{
|
||||
using namespace Granular_MDR_NS;
|
||||
double *history = & gm->history[gm->normal_model->history_index]; // load in all history variables
|
||||
//printf("%p %d damping\n", (void*)& history[DAMP_SCALE], gm->normal_model->history_index);
|
||||
double *history = & gm->history[gm->normal_model->history_index];
|
||||
damp_prefactor = damp * history[DAMP_SCALE];
|
||||
return -damp_prefactor * gm->vnnr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//printf("DAMP_SCALE = %d, damp_scale_history = %e, damp = %e, damp_prefactor = %e, F_DAMP = %e \n", DAMP_SCALE, history[DAMP_SCALE], damp, damp_prefactor, -damp_prefactor * gm->vnnr);
|
||||
}
|
||||
@ -472,7 +472,6 @@ void GranSubModNormalMDR::coeffs_to_local()
|
||||
Y = coeffs[2]; // yield stress
|
||||
gamma = coeffs[3]; // effective surface energy
|
||||
psi_b = coeffs[4]; // bulk response trigger based on ratio of remaining free area: A_{free}/A_{total}
|
||||
//CoR = coeffs[5]; // coefficent of restitution
|
||||
damp = coeffs[5]; // coefficent of restitution
|
||||
|
||||
if (E <= 0.0) error->all(FLERR, "Illegal MDR normal model, Young's modulus must be greater than 0");
|
||||
@ -480,7 +479,6 @@ void GranSubModNormalMDR::coeffs_to_local()
|
||||
if (Y < 0.0) error->all(FLERR, "Illegal MDR normal model, yield stress must be greater than or equal to 0");
|
||||
if (gamma < 0.0) error->all(FLERR, "Illegal MDR normal model, effective surface energy must be greater than or equal to 0");
|
||||
if (psi_b < 0.0 || psi_b > 1.0) error->all(FLERR, "Illegal MDR normal model, psi_b must be between 0 and 1.0");
|
||||
//if (CoR < 0.0 || CoR > 1.0) error->all(FLERR, "Illegal MDR normal model, coefficent of restitution must be between 0 and 1.0");
|
||||
if (damp < 0.0) error->all(FLERR, "Illegal MDR normal model, damping coefficent must be greater than or equal to 0");
|
||||
|
||||
G = E / (2.0 * (1.0 + nu)); // shear modulus
|
||||
@ -531,7 +529,7 @@ void GranSubModNormalMDR::init()
|
||||
index_sigmaxx = atom->find_custom("sigmaxx", tmp1, tmp2); // xx-component of the stress tensor, not necessary for force calculation
|
||||
index_sigmayy = atom->find_custom("sigmayy", tmp1, tmp2); // yy-component of the stress tensor, not necessary for force calculation
|
||||
index_sigmazz = atom->find_custom("sigmazz", tmp1, tmp2); // zz-component of the stress tensor, not necessary for force calculation
|
||||
index_dRavg = atom->find_custom("dRavg", tmp1, tmp2); // radius update increment
|
||||
index_dRavg = atom->find_custom("dRavg", tmp1, tmp2); // radius update increment
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
@ -871,7 +869,7 @@ double GranSubModNormalMDR::calculate_forces()
|
||||
if (aAdh < acrit) {
|
||||
aAdh = 0.0;
|
||||
F_MDR = 0.0;
|
||||
} else {
|
||||
} else {
|
||||
g_aAdh = A * 0.5 - A * Binv * sqrt(Bsq * 0.25 - pow(aAdh, 2));
|
||||
g_aAdh = round_up_negative_epsilon(g_aAdh);
|
||||
|
||||
@ -879,7 +877,7 @@ double GranSubModNormalMDR::calculate_forces()
|
||||
const double F_na = calculate_nonadhesive_mdr_force(deltaeAdh, Ainv, Eeff, A, B);
|
||||
const double F_Adhes = 2.0 * Eeff * (deltae1D - deltaeAdh) * aAdh;
|
||||
F_MDR = F_na + F_Adhes;
|
||||
if (std::isnan(F_MDR))
|
||||
if (std::isnan(F_MDR))
|
||||
error->one(FLERR, "F_MDR is NaN, case 3: tensile springs exceed critical length");
|
||||
}
|
||||
}
|
||||
@ -904,7 +902,7 @@ double GranSubModNormalMDR::calculate_forces()
|
||||
Ac_avg += wij * Ac;
|
||||
|
||||
// contact radius for damping
|
||||
(gamma > 0.0) ? a_damp += aAdh : a_damp += a_na;
|
||||
(gamma > 0.0) ? a_damp += aAdh : a_damp += a_na;
|
||||
|
||||
// bulk force calculation
|
||||
double F_BULK;
|
||||
|
||||
@ -250,12 +250,7 @@ void GranularModel::init()
|
||||
|
||||
// Must have valid normal, damping, and tangential models
|
||||
if (normal_model->name == "none") error->all(FLERR, "Must specify normal granular model");
|
||||
if (normal_model->name == "mdr") {
|
||||
//if (damping_model->name != "none")
|
||||
//error->all(FLERR, "MDR require 'none' damping model. To damp, specify a coefficient of restitution < 1.");
|
||||
} else {
|
||||
if (damping_model->name == "none") error->all(FLERR, "Must specify damping granular model");
|
||||
}
|
||||
if (damping_model->name == "none") error->all(FLERR, "Must specify damping granular model");
|
||||
if (tangential_model->name == "none") error->all(FLERR, "Must specify tangential granular model");
|
||||
|
||||
// Twisting, rolling, and heat are optional
|
||||
|
||||
Reference in New Issue
Block a user