function dcdt = cdot_new(t,c,D,area,vol,x,x_mid);

% function dcdt = cdot_new(t,c,D,area,vol,x,x_mid);
% new cdot file using area of face for mass conservation

[M,N] = size(c);
conc = c ./ vol ;                           % cell concentration 

dx = diff(x);                               % face to face distance, (n-1) 
dx_mid = diff(x_mid);                       % center to center distance, (n-2)


% augment for ghost cells to make no flux BCs
conc = [conc(1) ; conc(:) ; conc(end)];              % cell quantity
dx_mid = [dx_mid(1) ; dx_mid(:) ; dx_mid(end)];      % face quantity
area = [area(1) ; area ; area(end)];                 % aug_area (cell)
avg_area = area(1:end-1) + 1/2*(diff(area));         % avg_area (face) 

% now find cdot
flux_face = (D.*avg_area).*(diff(conc)./dx_mid);  % face quantity
dcdt = diff(flux_face)./dx;                       % back to cell quantity  
      
