git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@13170 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -13,7 +13,7 @@ OBJ = $(SRC:.cpp=.o)
|
|||||||
|
|
||||||
# Package variables
|
# Package variables
|
||||||
|
|
||||||
PACKAGE = asphere body class2 colloid coreshell dipole fld gpu granular kim \
|
PACKAGE = asphere body class2 colloid dipole fld gpu granular kim \
|
||||||
kokkos kspace manybody mc meam misc molecule mpiio opt peri poems \
|
kokkos kspace manybody mc meam misc molecule mpiio opt peri poems \
|
||||||
qeq reax replica rigid shock snap srd voronoi xtc
|
qeq reax replica rigid shock snap srd voronoi xtc
|
||||||
|
|
||||||
|
|||||||
@ -33,6 +33,7 @@
|
|||||||
#include "random_mars.h"
|
#include "random_mars.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
|
#include "citeme.h"
|
||||||
#include "math_const.h"
|
#include "math_const.h"
|
||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
@ -41,11 +42,34 @@ using namespace MathConst;
|
|||||||
|
|
||||||
#define MAXLINE 1024
|
#define MAXLINE 1024
|
||||||
|
|
||||||
|
static const char cite_fix_ttm_mod[] =
|
||||||
|
"fix ttm/mod command:\n\n"
|
||||||
|
"@article{Pisarev2014,\n"
|
||||||
|
"author = {Pisarev, V. V. and Starikov, S. V.},\n"
|
||||||
|
"title = {{Atomistic simulation of ion track formation in UO2.}},\n"
|
||||||
|
"journal = {J.~Phys.:~Condens.~Matter},\n"
|
||||||
|
"volume = {26},\n"
|
||||||
|
"number = {47},\n"
|
||||||
|
"pages = {475401},\n"
|
||||||
|
"year = {2014}\n"
|
||||||
|
"}\n\n"
|
||||||
|
"@article{Norman2013,\n"
|
||||||
|
"author = {Norman, G. E. and Starikov, S. V. and Stegailov, V. V. and Saitov, I. M. and Zhilyaev, P. A.},\n"
|
||||||
|
"title = {{Atomistic Modeling of Warm Dense Matter in the Two-Temperature State}},\n"
|
||||||
|
"journal = {Contrib.~Plasm.~Phys.},\n"
|
||||||
|
"number = {2},\n"
|
||||||
|
"volume = {53},\n"
|
||||||
|
"pages = {129--139},\n"
|
||||||
|
"year = {2013}\n"
|
||||||
|
"}\n\n";
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
FixTTMMod::FixTTMMod(LAMMPS *lmp, int narg, char **arg) :
|
FixTTMMod::FixTTMMod(LAMMPS *lmp, int narg, char **arg) :
|
||||||
Fix(lmp, narg, arg)
|
Fix(lmp, narg, arg)
|
||||||
{
|
{
|
||||||
|
if (lmp->citeme) lmp->citeme->add(cite_fix_ttm_mod);
|
||||||
|
|
||||||
if (narg < 9) error->all(FLERR,"Illegal fix ttm/mod command");
|
if (narg < 9) error->all(FLERR,"Illegal fix ttm/mod command");
|
||||||
vector_flag = 1;
|
vector_flag = 1;
|
||||||
size_vector = 2;
|
size_vector = 2;
|
||||||
@ -55,16 +79,16 @@ FixTTMMod::FixTTMMod(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
restart_peratom = 1;
|
restart_peratom = 1;
|
||||||
restart_global = 1;
|
restart_global = 1;
|
||||||
seed = atoi(arg[3]);
|
seed = atoi(arg[3]);
|
||||||
nxnodes = atoi(arg[4]);
|
fpr_2 = fopen(arg[4],"r");
|
||||||
nynodes = atoi(arg[5]);
|
nxnodes = atoi(arg[5]);
|
||||||
nznodes = atoi(arg[6]);
|
nynodes = atoi(arg[6]);
|
||||||
fpr = fopen(arg[7],"r");
|
nznodes = atoi(arg[7]);
|
||||||
|
fpr = fopen(arg[8],"r");
|
||||||
if (fpr == NULL) {
|
if (fpr == NULL) {
|
||||||
char str[128];
|
char str[128];
|
||||||
sprintf(str,"Cannot open file %s",arg[7]);
|
sprintf(str,"Cannot open file %s",arg[7]);
|
||||||
error->one(FLERR,str);
|
error->one(FLERR,str);
|
||||||
}
|
}
|
||||||
fpr_2 = fopen(arg[8],"r");
|
|
||||||
if (fpr == NULL) {
|
if (fpr == NULL) {
|
||||||
char str[128];
|
char str[128];
|
||||||
sprintf(str,"Cannot open file %s",arg[8]);
|
sprintf(str,"Cannot open file %s",arg[8]);
|
||||||
@ -233,6 +257,7 @@ FixTTMMod::FixTTMMod(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
memory->create(sum_mass_vsq_all,nxnodes,nynodes,nznodes,
|
memory->create(sum_mass_vsq_all,nxnodes,nynodes,nznodes,
|
||||||
"ttm/mod:sum_mass_vsq_all");
|
"ttm/mod:sum_mass_vsq_all");
|
||||||
memory->create(T_electron_old,nxnodes,nynodes,nznodes,"ttm/mod:T_electron_old");
|
memory->create(T_electron_old,nxnodes,nynodes,nznodes,"ttm/mod:T_electron_old");
|
||||||
|
memory->create(T_electron_first,nxnodes,nynodes,nznodes,"ttm/mod:T_electron_first");
|
||||||
memory->create(T_electron,nxnodes,nynodes,nznodes,"ttm/mod:T_electron");
|
memory->create(T_electron,nxnodes,nynodes,nznodes,"ttm/mod:T_electron");
|
||||||
memory->create(net_energy_transfer,nxnodes,nynodes,nznodes,
|
memory->create(net_energy_transfer,nxnodes,nynodes,nznodes,
|
||||||
"ttm/mod:net_energy_transfer");
|
"ttm/mod:net_energy_transfer");
|
||||||
@ -585,89 +610,113 @@ void FixTTMMod::end_of_step()
|
|||||||
// required this MD step to maintain a stable explicit solve
|
// required this MD step to maintain a stable explicit solve
|
||||||
int num_inner_timesteps = 1;
|
int num_inner_timesteps = 1;
|
||||||
double inner_dt = update->dt;
|
double inner_dt = update->dt;
|
||||||
double stability_criterion = 1.0 -
|
double stability_criterion = 0.0;
|
||||||
2.0*inner_dt/el_specific_heat *
|
|
||||||
(el_thermal_conductivity*(1.0/dx/dx + 1.0/dy/dy + 1.0/dz/dz));
|
for (int ixnode = 0; ixnode < nxnodes; ixnode++)
|
||||||
if (stability_criterion < 0.0) {
|
for (int iynode = 0; iynode < nynodes; iynode++)
|
||||||
inner_dt = 0.25*el_specific_heat /
|
for (int iznode = 0; iznode < nznodes; iznode++)
|
||||||
(el_thermal_conductivity*(1.0/dx/dx + 1.0/dy/dy + 1.0/dz/dz));
|
T_electron_first[ixnode][iynode][iznode] =
|
||||||
}
|
T_electron[ixnode][iynode][iznode];
|
||||||
num_inner_timesteps = static_cast<unsigned int>(update->dt/inner_dt) + 1;
|
do {
|
||||||
inner_dt = update->dt/double(num_inner_timesteps);
|
for (int ixnode = 0; ixnode < nxnodes; ixnode++)
|
||||||
if (num_inner_timesteps > 1000000)
|
|
||||||
error->warning(FLERR,"Too many inner timesteps in fix ttm",0);
|
|
||||||
for (int ith_inner_timestep = 0; ith_inner_timestep < num_inner_timesteps;
|
|
||||||
ith_inner_timestep++) {
|
|
||||||
for (int ixnode = 0; ixnode < nxnodes; ixnode++)
|
|
||||||
for (int iynode = 0; iynode < nynodes; iynode++)
|
for (int iynode = 0; iynode < nynodes; iynode++)
|
||||||
for (int iznode = 0; iznode < nznodes; iznode++)
|
for (int iznode = 0; iznode < nznodes; iznode++)
|
||||||
T_electron_old[ixnode][iynode][iznode] =
|
T_electron[ixnode][iynode][iznode] =
|
||||||
T_electron[ixnode][iynode][iznode];
|
T_electron_first[ixnode][iynode][iznode];
|
||||||
// compute new electron T profile
|
|
||||||
duration = duration + inner_dt;
|
stability_criterion = 1.0 -
|
||||||
for (int ixnode = 0; ixnode < nxnodes; ixnode++)
|
2.0*inner_dt/el_specific_heat *
|
||||||
for (int iynode = 0; iynode < nynodes; iynode++)
|
(el_thermal_conductivity*(1.0/dx/dx + 1.0/dy/dy + 1.0/dz/dz));
|
||||||
for (int iznode = 0; iznode < nznodes; iznode++) {
|
if (stability_criterion < 0.0) {
|
||||||
int right_xnode = ixnode + 1;
|
inner_dt = 0.25*el_specific_heat /
|
||||||
int right_ynode = iynode + 1;
|
(el_thermal_conductivity*(1.0/dx/dx + 1.0/dy/dy + 1.0/dz/dz));
|
||||||
int right_znode = iznode + 1;
|
}
|
||||||
if (right_xnode == nxnodes) right_xnode = 0;
|
num_inner_timesteps = static_cast<unsigned int>(update->dt/inner_dt) + 1;
|
||||||
if (right_ynode == nynodes) right_ynode = 0;
|
inner_dt = update->dt/double(num_inner_timesteps);
|
||||||
if (right_znode == nznodes) right_znode = 0;
|
if (num_inner_timesteps > 1000000)
|
||||||
int left_xnode = ixnode - 1;
|
error->warning(FLERR,"Too many inner timesteps in fix ttm",0);
|
||||||
int left_ynode = iynode - 1;
|
for (int ith_inner_timestep = 0; ith_inner_timestep < num_inner_timesteps;
|
||||||
int left_znode = iznode - 1;
|
ith_inner_timestep++) {
|
||||||
if (left_xnode == -1) left_xnode = nxnodes - 1;
|
for (int ixnode = 0; ixnode < nxnodes; ixnode++)
|
||||||
if (left_ynode == -1) left_ynode = nynodes - 1;
|
for (int iynode = 0; iynode < nynodes; iynode++)
|
||||||
if (left_znode == -1) left_znode = nznodes - 1;
|
for (int iznode = 0; iznode < nznodes; iznode++)
|
||||||
double skin_layer_d = double(skin_layer);
|
T_electron_old[ixnode][iynode][iznode] =
|
||||||
double ixnode_d = double(ixnode);
|
T_electron[ixnode][iynode][iznode];
|
||||||
double surface_d = double(t_surface_l);
|
// compute new electron T profile
|
||||||
mult_factor = 0.0;
|
duration = duration + inner_dt;
|
||||||
if (duration < width){
|
for (int ixnode = 0; ixnode < nxnodes; ixnode++)
|
||||||
if (ixnode >= t_surface_l) mult_factor = (intensity/(dx*skin_layer_d))*exp((-1.0)*(ixnode_d - surface_d)/skin_layer_d);
|
for (int iynode = 0; iynode < nynodes; iynode++)
|
||||||
}
|
for (int iznode = 0; iznode < nznodes; iznode++) {
|
||||||
if (ixnode < t_surface_l) net_energy_transfer_all[ixnode][iynode][iznode] = 0.0;
|
int right_xnode = ixnode + 1;
|
||||||
double cr_vac = 1;
|
int right_ynode = iynode + 1;
|
||||||
if (T_electron_old[ixnode][iynode][iznode] == 0) cr_vac = 0;
|
int right_znode = iznode + 1;
|
||||||
double cr_v_l_x = 1;
|
if (right_xnode == nxnodes) right_xnode = 0;
|
||||||
if (T_electron_old[left_xnode][iynode][iznode] == 0) cr_v_l_x = 0;
|
if (right_ynode == nynodes) right_ynode = 0;
|
||||||
double cr_v_r_x = 1;
|
if (right_znode == nznodes) right_znode = 0;
|
||||||
if (T_electron_old[right_xnode][iynode][iznode] == 0) cr_v_r_x = 0;
|
int left_xnode = ixnode - 1;
|
||||||
double cr_v_l_y = 1;
|
int left_ynode = iynode - 1;
|
||||||
if (T_electron_old[ixnode][left_ynode][iznode] == 0) cr_v_l_y = 0;
|
int left_znode = iznode - 1;
|
||||||
double cr_v_r_y = 1;
|
if (left_xnode == -1) left_xnode = nxnodes - 1;
|
||||||
if (T_electron_old[ixnode][right_ynode][iznode] == 0) cr_v_r_y = 0;
|
if (left_ynode == -1) left_ynode = nynodes - 1;
|
||||||
double cr_v_l_z = 1;
|
if (left_znode == -1) left_znode = nznodes - 1;
|
||||||
if (T_electron_old[ixnode][iynode][left_znode] == 0) cr_v_l_z = 0;
|
double skin_layer_d = double(skin_layer);
|
||||||
double cr_v_r_z = 1;
|
double ixnode_d = double(ixnode);
|
||||||
if (T_electron_old[ixnode][iynode][right_znode] == 0) cr_v_r_z = 0;
|
double surface_d = double(t_surface_l);
|
||||||
if (cr_vac != 0) {
|
mult_factor = 0.0;
|
||||||
T_electron[ixnode][iynode][iznode] =
|
if (duration < width){
|
||||||
T_electron_old[ixnode][iynode][iznode] +
|
if (ixnode >= t_surface_l) mult_factor = (intensity/(dx*skin_layer_d))*exp((-1.0)*(ixnode_d - surface_d)/skin_layer_d);
|
||||||
inner_dt/el_properties(T_electron_old[ixnode][iynode][iznode]).el_heat_capacity *
|
}
|
||||||
((cr_v_r_x*el_properties(T_electron_old[ixnode][iynode][iznode]/2.0+T_electron_old[right_xnode][iynode][iznode]/2.0).el_thermal_conductivity*
|
if (ixnode < t_surface_l) net_energy_transfer_all[ixnode][iynode][iznode] = 0.0;
|
||||||
(T_electron_old[right_xnode][iynode][iznode]-T_electron_old[ixnode][iynode][iznode])/dx -
|
double cr_vac = 1;
|
||||||
cr_v_l_x*el_properties(T_electron_old[ixnode][iynode][iznode]/2.0+T_electron_old[left_xnode][iynode][iznode]/2.0).el_thermal_conductivity*
|
if (T_electron_old[ixnode][iynode][iznode] == 0) cr_vac = 0;
|
||||||
(T_electron_old[ixnode][iynode][iznode]-T_electron_old[left_xnode][iynode][iznode])/dx)/dx +
|
double cr_v_l_x = 1;
|
||||||
(cr_v_r_y*el_properties(T_electron_old[ixnode][iynode][iznode]/2.0+T_electron_old[ixnode][right_ynode][iznode]/2.0).el_thermal_conductivity*
|
if (T_electron_old[left_xnode][iynode][iznode] == 0) cr_v_l_x = 0;
|
||||||
(T_electron_old[ixnode][right_ynode][iznode]-T_electron_old[ixnode][iynode][iznode])/dy -
|
double cr_v_r_x = 1;
|
||||||
cr_v_l_y*el_properties(T_electron_old[ixnode][iynode][iznode]/2.0+T_electron_old[ixnode][left_ynode][iznode]/2.0).el_thermal_conductivity*
|
if (T_electron_old[right_xnode][iynode][iznode] == 0) cr_v_r_x = 0;
|
||||||
(T_electron_old[ixnode][iynode][iznode]-T_electron_old[ixnode][left_ynode][iznode])/dy)/dy +
|
double cr_v_l_y = 1;
|
||||||
(cr_v_r_z*el_properties(T_electron_old[ixnode][iynode][iznode]/2.0+T_electron_old[ixnode][iynode][right_znode]/2.0).el_thermal_conductivity*
|
if (T_electron_old[ixnode][left_ynode][iznode] == 0) cr_v_l_y = 0;
|
||||||
(T_electron_old[ixnode][iynode][right_znode]-T_electron_old[ixnode][iynode][iznode])/dz -
|
double cr_v_r_y = 1;
|
||||||
cr_v_l_z*el_properties(T_electron_old[ixnode][iynode][iznode]/2.0+T_electron_old[ixnode][iynode][left_znode]/2.0).el_thermal_conductivity*
|
if (T_electron_old[ixnode][right_ynode][iznode] == 0) cr_v_r_y = 0;
|
||||||
(T_electron_old[ixnode][iynode][iznode]-T_electron_old[ixnode][iynode][left_znode])/dz)/dz);
|
double cr_v_l_z = 1;
|
||||||
T_electron[ixnode][iynode][iznode]+=inner_dt/el_properties(T_electron[ixnode][iynode][iznode]).el_heat_capacity*
|
if (T_electron_old[ixnode][iynode][left_znode] == 0) cr_v_l_z = 0;
|
||||||
(mult_factor -
|
double cr_v_r_z = 1;
|
||||||
net_energy_transfer_all[ixnode][iynode][iznode]/del_vol);
|
if (T_electron_old[ixnode][iynode][right_znode] == 0) cr_v_r_z = 0;
|
||||||
}
|
if (cr_vac != 0) {
|
||||||
else T_electron[ixnode][iynode][iznode] =
|
T_electron[ixnode][iynode][iznode] =
|
||||||
T_electron_old[ixnode][iynode][iznode];
|
T_electron_old[ixnode][iynode][iznode] +
|
||||||
if ((T_electron[ixnode][iynode][iznode] > 0.0) && (T_electron[ixnode][iynode][iznode] < electron_temperature_min))
|
inner_dt/el_properties(T_electron_old[ixnode][iynode][iznode]).el_heat_capacity *
|
||||||
T_electron[ixnode][iynode][iznode] = T_electron[ixnode][iynode][iznode] + 0.5*(electron_temperature_min - T_electron[ixnode][iynode][iznode]);
|
((cr_v_r_x*el_properties(T_electron_old[ixnode][iynode][iznode]/2.0+T_electron_old[right_xnode][iynode][iznode]/2.0).el_thermal_conductivity*
|
||||||
}
|
(T_electron_old[right_xnode][iynode][iznode]-T_electron_old[ixnode][iynode][iznode])/dx -
|
||||||
}
|
cr_v_l_x*el_properties(T_electron_old[ixnode][iynode][iznode]/2.0+T_electron_old[left_xnode][iynode][iznode]/2.0).el_thermal_conductivity*
|
||||||
|
(T_electron_old[ixnode][iynode][iznode]-T_electron_old[left_xnode][iynode][iznode])/dx)/dx +
|
||||||
|
(cr_v_r_y*el_properties(T_electron_old[ixnode][iynode][iznode]/2.0+T_electron_old[ixnode][right_ynode][iznode]/2.0).el_thermal_conductivity*
|
||||||
|
(T_electron_old[ixnode][right_ynode][iznode]-T_electron_old[ixnode][iynode][iznode])/dy -
|
||||||
|
cr_v_l_y*el_properties(T_electron_old[ixnode][iynode][iznode]/2.0+T_electron_old[ixnode][left_ynode][iznode]/2.0).el_thermal_conductivity*
|
||||||
|
(T_electron_old[ixnode][iynode][iznode]-T_electron_old[ixnode][left_ynode][iznode])/dy)/dy +
|
||||||
|
(cr_v_r_z*el_properties(T_electron_old[ixnode][iynode][iznode]/2.0+T_electron_old[ixnode][iynode][right_znode]/2.0).el_thermal_conductivity*
|
||||||
|
(T_electron_old[ixnode][iynode][right_znode]-T_electron_old[ixnode][iynode][iznode])/dz -
|
||||||
|
cr_v_l_z*el_properties(T_electron_old[ixnode][iynode][iznode]/2.0+T_electron_old[ixnode][iynode][left_znode]/2.0).el_thermal_conductivity*
|
||||||
|
(T_electron_old[ixnode][iynode][iznode]-T_electron_old[ixnode][iynode][left_znode])/dz)/dz);
|
||||||
|
T_electron[ixnode][iynode][iznode]+=inner_dt/el_properties(T_electron[ixnode][iynode][iznode]).el_heat_capacity*
|
||||||
|
(mult_factor -
|
||||||
|
net_energy_transfer_all[ixnode][iynode][iznode]/del_vol);
|
||||||
|
}
|
||||||
|
else T_electron[ixnode][iynode][iznode] =
|
||||||
|
T_electron_old[ixnode][iynode][iznode];
|
||||||
|
if ((T_electron[ixnode][iynode][iznode] > 0.0) && (T_electron[ixnode][iynode][iznode] < electron_temperature_min))
|
||||||
|
T_electron[ixnode][iynode][iznode] = T_electron[ixnode][iynode][iznode] + 0.5*(electron_temperature_min - T_electron[ixnode][iynode][iznode]);
|
||||||
|
|
||||||
|
if (el_properties(T_electron[ixnode][iynode][iznode]).el_thermal_conductivity > el_thermal_conductivity)
|
||||||
|
el_thermal_conductivity = el_properties(T_electron[ixnode][iynode][iznode]).el_thermal_conductivity;
|
||||||
|
if ((T_electron[ixnode][iynode][iznode] > 0.0) && (el_properties(T_electron[ixnode][iynode][iznode]).el_heat_capacity < el_specific_heat))
|
||||||
|
el_specific_heat = el_properties(T_electron[ixnode][iynode][iznode]).el_heat_capacity;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stability_criterion = 1.0 -
|
||||||
|
2.0*inner_dt/el_specific_heat *
|
||||||
|
(el_thermal_conductivity*(1.0/dx/dx + 1.0/dy/dy + 1.0/dz/dz));
|
||||||
|
|
||||||
|
} while (stability_criterion < 0.0);
|
||||||
// output nodal temperatures for current timestep
|
// output nodal temperatures for current timestep
|
||||||
if ((nfileevery) && !(update->ntimestep % nfileevery)) {
|
if ((nfileevery) && !(update->ntimestep % nfileevery)) {
|
||||||
// compute atomic Ta for each grid point
|
// compute atomic Ta for each grid point
|
||||||
|
|||||||
Reference in New Issue
Block a user