CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   changing the boundary conditions values (https://www.cfd-online.com/Forums/openfoam/63801-changing-boundary-conditions-values.html)

gerado April 20, 2009 09:39

changing the boundary conditions values
 
Hi,
I have for example the following code.
BoundaryField{

inlet {
type fixedValue;
value uniform 10;
}
..
....


}

I want to change the value 10.

can someone tell me which method I have to use? I looked in fixedValueFvPatchField.C
but value can t be set there.

best regards.

remi April 27, 2009 10:39

Hello!
 
Dear gerado,

I think you can change the specified value for each cell of your boundary just with:

label boundaryID = mesh.boundaryMesh().findPatchID("boundaryName");
const fvPatch & boundaryPatchName=mesh.boundary()[boundaryID];

forAll (boundaryPatchName, faceI)
{yourVariable.boundaryField()[boundaryID][faceI] = appropriate Value for this face ;}

Goodbye!

henrik April 27, 2009 10:58

Dear Gerado,

label boundaryID = mesh.boundaryMesh().findPatchID("boundaryName");
yourVariable.boundaryField()[boundaryID] == 20;

That's it.

Henrik

gerado April 30, 2009 08:28

hi Henrik ,remi
thanks you for the help

Gerado


All times are GMT -4. The time now is 04:46.