CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Write a fvc::Xxx function to do a vol to surface field calculation (https://www.cfd-online.com/Forums/openfoam-programming-development/139784-write-fvc-xxx-function-do-vol-surface-field-calculation.html)

zhulianhua July 31, 2014 07:26

Write a fvc::Xxx function to do a vol to surface field calculation
 
Hi,

I want to write a explicit Filed operating function. It calculates as surfaceScalar Field from a volScalarField.

The input parameters are :

volScalarField vf;
dimensionedVector d; // a distance smaller than cell size

The output field is :

volScalarField vs;

The calculation procedure is:

For each cell face center x_s: vs(x_s) = vf(x_s - d),
as d is small enough, x_s - d is located in one of the neighbor cell of the cell face, say cell N.
The vf field value at (x_s -d) is interpolated from the center of cell N.

What is simplest way to write this function?


Best,

Lianhua


All times are GMT -4. The time now is 21:14.