manipulating boundaryField of a volScalarField in OpenFOAM
Dear all,
I need to manipulate a volScalarField using some complex expressions that include other volScalarFields and scalars. I have already a library (C++ class library) that operates on scalars and in order to take advantage of this I (note that I need to perform element by element multiplications), I employed a for loop for the internal field: Code:
for (label i=0; i<D.internalField()[i]; ++i) Code:
scalar scalarT; Is there a way to "cast" boundaryField()[i] to a scalar? Is there any other way to manipulate the boundary field using the libraryFunction? I know that boundary condition models employ the == operator to reset them, but I can not figure out how this could work in the boundaryField of a volScalarField variable. I would be grateful for any recommendations/suggestions. |
Howdy!
When referencing the index of an D.internalField[i] <-like that, the i is refering to a cell index. A boundaryField() is different in that it returns not a patch but a list of patches. For example, to access face j on patch i you would have to write D.boundaryField()[i][j] You're most likey meaning to do something like this: Code:
forAll(D.boundaryField(), patchI) Good luck! Kyle |
Thank you Kyle! that was the problem.
|
Hi foamers
I defined a volSymmTensorField and now want to change the values of that in a special boundary: Code:
volSymmTensorField TauT_RT = tauT; Quote:
|
Quote:
|
All times are GMT -4. The time now is 08:00. |