automatic interpolation of field on call
I have a question. Let's say I have a field
Code:
const volScalarField& k Code:
label faceI // surface between two cells Code:
k[faceCellI] Code:
k[faceI] Now the question, does OpenFOAM automatically interpolate in these cases? I wonder if the same also works for volVectorFields, when retrieving a value from the interface between two neighboring cells (through a label) that it then interpolates. |
Both faceI and faceCellI in your example are labels (this pretty much is equal to a integer). Suppose faceI = 1, and faceCelli = 1, how would the code you show know if it's supposed to return a interpolated or cell centre value? Keep in mind the code doesn't know the name of your variable, only the location in memory. Thus, from the very brief snippets you show, you should get the cell centre value in both cases.
- Anton |
Quote:
I am using this method http://www.cfd-online.com/Forums/ope...tml#post254946 to find the global indices for the cell interface opposite to the patch on a boundary. With this label I then would like to retrieve the velocity and k. At first I thought this should work very easily by using the interpolated (onto the surface mesh) fields in combination with the label oppFaceI which I retrieve from the mentioned method |
Please post the code as you have implemented it.
|
Quote:
I think I have found my answer, however, here comes the code Code:
// get access to the mesh for opposite faces Code:
const surfaceScalarField& kSurface = fvc::interpolate(k) |
All times are GMT -4. The time now is 05:20. |