Modify heat_gran_conduction

Riccardo Maione's picture
Submitted by Riccardo Maione on Mon, 04/14/2014 - 16:25

Hi all,

I would like to modify "fix_heat_gran_conduction" in such a way that it can accept matrix of conductivity coefficients, to simulate heat transport inside anisotropic particles.
I was able to make LIGGGHTS compile and accept a matrix of conductivity coefficients, but when LIGGGHTS finishes its run the heat exchanged between particles is zero.
here there are the two fix_heat_gran_conduction code pieces i have just modified:

line 112:
int max_type = pair_gran->mpg->max_type();
int f = max_type*max_type;
if (conductivity) delete []conductivity;
conductivity = new double[f];
fix_conductivity = static_cast(modify->find_fix_property("thermalConductivity","property/global","peratomtypepair",max_type,max_type,style));

// pre-calculate conductivity for possible contact material combinations
for(int k=1; k< max_type+1; k++)
for(int i=1;i< max_type+1; i++)
for(int j=1;j< max_type+1;j++)
{
conductivity[i-1] = fix_conductivity->compute_array(i-1,k-1);
if(conductivity[i-1] < 0.) error->all(FLERR,"Fix heat/gran/conduction: Thermal conductivity must not be < 0");
}

this was the part which creates the matrix of conductivity coefficients
And line 274

int max_type = pair_gran->mpg->max_type();

tcoi = conductivity[max_type*type[i]-max_type+type[j]-1];
tcoj = conductivity[max_type*type[j]-max_type+type[i]-1];

any help would be very much apprecieted
Riccardo Maione