cosmetic changes

This commit is contained in:
Axel Kohlmeyer
2022-03-12 16:14:55 -05:00
parent 9931323463
commit fe9b426c7e
3 changed files with 17 additions and 20 deletions

View File

@ -43,7 +43,7 @@ using namespace LAMMPS_NS;
using namespace FixConst;
static const char cite_fix_lbfluid[] =
"fix lb/fluid command:\n\n"
"fix lb/fluid command: doi:10.1016/j.cpc.2022.108318\n\n"
"@Article{Denniston et al.,\n"
" author = {C. Denniston, N. Afrasiabian, M.G. Cole-Andre,"
"F.E. Mackay, S.T.T. Ollila, T. Whitehead},\n"
@ -68,12 +68,11 @@ class Site {
/* ------------------------------------------------------------------------ */
FixLbFluid::FixLbFluid(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg),
Gamma(nullptr), hydroF(nullptr), massp(nullptr),
density_lb(nullptr), u_lb(nullptr), f_lb(nullptr), fnew(nullptr), feq(nullptr),
Ff(nullptr), Wf(nullptr), Fftempx(nullptr), Wftempx(nullptr),
Fftempy(nullptr), Wftempy(nullptr), Fftempz(nullptr), Wftempz(nullptr),
sublattice(nullptr), wholelattice(nullptr)
Fix(lmp, narg, arg), Gamma(nullptr), hydroF(nullptr), massp(nullptr), density_lb(nullptr),
u_lb(nullptr), f_lb(nullptr), fnew(nullptr), feq(nullptr), Ff(nullptr), Wf(nullptr),
Fftempx(nullptr), Wftempx(nullptr), Fftempy(nullptr), Wftempy(nullptr), Fftempz(nullptr),
Wftempz(nullptr), n_stencil(2), random(nullptr), dof_lb(0), sublattice(nullptr),
wholelattice(nullptr)
{
//=====================================================================================================
// Sample inputfile call:
@ -215,8 +214,9 @@ FixLbFluid::FixLbFluid(LAMMPS *lmp, int narg, char **arg) :
h_s = h_p = w_p = l_pp = l_e = l_p = 0;
lin_init = 0;
Gamma = new double[atom->ntypes + 1];
for (int i = 0; i <= atom->ntypes; i++) Gamma[i] = 1.0;
const int ntypes = atom->ntypes;
Gamma = new double[ntypes + 1];
for (int i = 0; i <= ntypes; i++) Gamma[i] = 1.0;
// Flags for fix references (i.e. quantities accessible via f_ID[n]
vector_flag = 1;
@ -233,7 +233,7 @@ FixLbFluid::FixLbFluid(LAMMPS *lmp, int narg, char **arg) :
else
itype = utils::inumeric(FLERR, arg[iarg + 1], false, lmp);
double scalefactor = utils::numeric(FLERR, arg[iarg + 2], false, lmp);
if (itype < 0 || itype > atom->ntypes)
if (itype < 0 || itype > ntypes)
error->all(FLERR, "Illegal fix lb/fluid command: scaleGamma");
if (itype)
Gamma[itype] = scalefactor;

View File

@ -111,7 +111,7 @@ class FixLbFluid : public Fix {
int step;
int n_stencil = 2; // Number of points for spread/interpolate stencil
int n_stencil; // Number of points for spread/interpolate stencil
double bodyforcex, bodyforcey, bodyforcez; // Body Forces acting on the fluid (default=0)
double vwtp, vwbt; // Velocities of the z walls in the y
@ -141,7 +141,7 @@ class FixLbFluid : public Fix {
double timeEqb, timeUpdate, timePCalc, timefluidForce, timeCorrectU;
double dof_lb = 0;
double dof_lb;
int fixviscouslb;

View File

@ -40,7 +40,6 @@ FixLbMomentum::FixLbMomentum(LAMMPS *lmp, int narg, char **arg) :
{
if (narg < 4) error->all(FLERR, "Illegal fix lb/momentum command");
nevery = utils::inumeric(FLERR, arg[3], false, lmp);
;
if (nevery <= 0) error->all(FLERR, "Illegal fix lb/momentum command");
linear = 1;
@ -159,9 +158,9 @@ void FixLbMomentum::end_of_step()
etacov[1] = rho * ucmx;
etacov[2] = rho * ucmy;
etacov[3] = rho * ucmz;
etacov[4] = rho * (2. * u_lb[i][j][k][0] * ucmx - ucmx * ucmx);
etacov[5] = rho * (2. * u_lb[i][j][k][1] * ucmy - ucmy * ucmy);
etacov[6] = rho * (2. * u_lb[i][j][k][2] * ucmz - ucmz * ucmz);
etacov[4] = rho * (2.0 * u_lb[i][j][k][0] * ucmx - ucmx * ucmx);
etacov[5] = rho * (2.0 * u_lb[i][j][k][1] * ucmy - ucmy * ucmy);
etacov[6] = rho * (2.0 * u_lb[i][j][k][2] * ucmz - ucmz * ucmz);
etacov[7] = rho * (u_lb[i][j][k][0] * ucmy + u_lb[i][j][k][1] * ucmx - ucmx * ucmy);
etacov[8] = rho * (u_lb[i][j][k][1] * ucmz + u_lb[i][j][k][2] * ucmy - ucmy * ucmz);
etacov[9] = rho * (u_lb[i][j][k][0] * ucmz + u_lb[i][j][k][2] * ucmx - ucmx * ucmz);
@ -174,14 +173,12 @@ void FixLbMomentum::end_of_step()
ucmx * ucmy * u_lb[i][j][k][2] + ucmx * ucmy * ucmz);
for (int l = 0; l < 15; l++)
for (int ii = 1; ii < 14; ii++) {
for (int ii = 1; ii < 14; ii++)
f_lb[i][j][k][l] -= w_lb15[l] * mg_lb15[ii][l] * etacov[ii] * Ng_lb15[ii];
}
} else // 19-velocity model
for (int l = 0; l < 19; l++)
for (int ii = 1; ii < 14; ii++) {
for (int ii = 1; ii < 14; ii++)
f_lb[i][j][k][l] -= w_lb19[l] * mg_lb19[ii][l] * etacov[ii] * Ng_lb19[ii];
}
if (xflag) u_lb[i][j][k][0] -= vcmall[0];
if (yflag) u_lb[i][j][k][1] -= vcmall[1];