how to obtain divergence via FVM
hello everyone
I need to calculate a form like div (coef * grad Phi), I think it is better to assemble it as a summation of fluxes around a control volume . Can you please tell me how to implement it via fortran?Thank you very much! Regards! lg88 
What is Phi? Is the coefficient a constant?

Phi is a additional variable and the coef is a constant.Thank you for your help.
Regards lg88 
You might be able to do this without fortran. If you define an algebraic additional variable as phi.grad, then take the div of that algebraic additional variable you might be able to do it entirely in CEL. Then you don't need to worry about the details of summing fluxes and all that.

Thanks to ghorrocks.After I get the phi.grad ,how can I take the div of that algebraic additional variable?Are there any use like .grad?
Regards! lg88 
There is not a function for div like that, so you just write the equation out in its direction components long hand. So you define one equation for each cartension direction.

So I need to calculate the gradient of the phi.grad in x,y,z direction respectively and then add them together ?
I have another question.I need to use the div(coff*grad phi) scale with the volume of the cell.Are there any word standing the volume of the cell, just like the u stand the velocity of x direction? regards! lg88 
Have a look in the list of available variables in the CFX reference guide.
Also, don't forget CEL has functions like volumeInt() so if you use them you might not need to get the volume either. 
oh,I find that it is not easy as you said.
Firstly, ''define an algebraic additional variable as phi.grad".Is it a vector? then where can I write the expression .grad?And when I calculate the div,maybe I just need use the second component of the grad rather than a whole vector . Are there any guides I can refer to? Then ,I have read the function of volumeInt().I find that it is total volume of a domain or subdomain rather than a cell volume.Are there any about the cell volume? regards lg88 
I have never used the .grad function, try it and you should be able to work it out.
Quote:
Cell volume is an available variable (see the CFX Reference manual) but again, I bet the volumeInt() function does what you want without requiring cell volumes. 
All times are GMT 4. The time now is 02:10. 