Modifying boundaryfield of a volscalar field
Hi FOAMERS
Can any one please let me know how can I modify the values of a volscalarfield (say variable) at boundaries? I have tried forAll (variable.boundaryField(), facei) { variable.boundaryField()[facei] = modifiedvalue } but it does not modify all values at the boundary, and It is not clear for me which faces are modified by this loop. |
im curious if it is on boundary, why dont you set it up from dictionary?
|
Hi Mahdi,
You need to tell on which patch you want to change the variables: Code:
forAll (mesh.boundary(), patchI) { Hope it helps greetings |
nimasam: I don't have any boundary condition for some of my variables
nlinder: Thanks for the answer. By the way, do yo know the best way to set the values of a volScalarField (lets say, X) to the values interpolated from the adjacent cell centers? |
however i think, if you define your field to construct from IO dictionay then, you can apply ur BC easier,
However somewhere i saw internalBoundaryField(),i guess it was in geometricField class which return cell values adjacent to BC |
Why not just interpolate(). It will interpolated from the faces which "include" the information of the adjacent cells!? Or did I misunderstood what you are looking for?
|
All times are GMT -4. The time now is 07:47. |