# evaluation of the diffusion term at each grid point Classic List Threaded 4 messages Open this post in threaded view
|

## evaluation of the diffusion term at each grid point

 Hi For the example of export data to csv file https://www.featool.com/doc/post#postex, would it be possible to evaluate the diffusion term d_cd*(cx_x + cy_y) at each grid point for the convection and diffusion module? It seems the cx and cy are saved in fea, but cx_x and cy_y are not saved? Thanks!
Open this post in threaded view
|

## Re: evaluation of the diffusion term at each grid point

 Administrator The "_xi" underscore syntax is only used for equation specification (indicating terms to use partial integration in the FEA discretization) and *can not* be used for postprocessing. Technically it is possible to reconstruct 2nd order derivatives using the gradient_recovery function as for example here (however accuracy might be an issue, especially at boundaries):  i_dvar = 1; % Dependent variable to differentiate. j_deriv = 2; % Derivative component 2=x, 3=y, 4=z. ux = gradient_recovery(fea, i_dvar, j_deriv, fea.sol.u(:,end)); uxx = gradient_recovery(fea, i_dvar, j_deriv, ux); % Add custom variable for uxx. fea.vars = struct('name', 'uxx', 'data', uxx); postplot(fea, 'surfexpr', 'uxx') Note, that the diffusive flux over the domain does not genrally include second order derivatives as it would be defined as "-d_cd*(cx + cy)" [mol/m^2/s].
 thanks for your suggestion. Would it be possible to evaluate the contribution of the advection and diffusion at each grid point (see figure below). I tried to extract the cx, cy, c, u and v at each grid point. However, if I used the formula below to calculate the Jdiff and Jadv and then generate the surface plot, I got some patterns that are hard to explain. I used griddata(x,y,z,X,Y,'v4') and then surface to generate these surface maps. Are there numerical issues in these calculations based on datasets extracted from Featool? which function did Featool use to generate the surface map? Would it be possible to get diffusion and advection distributions directly from Featool? 