fixedGradient boundary condition
Hi All,
I am working with scalarTransportFoam. I have specified a fixedGradient boundary condition at one of the boundary patches. inlet { type fixedGradient; gradient uniform 1.5; } I need to change the gradient value (i.e, 1.5) between iterations. Any suggestions? Thanks in advance! Senthil |
Finally, I figured out how to do it...
if(mesh.boundaryField()[patchIMesh1].type() == "fixedGradient") { fixedGradientFvPatchScalarField& bufferMesh1= refCast<fixedgradientfvpatchscalarfield>(T.boundar yField()[patchIMesh1]); scalarField& gradMesh1 = bufferMesh1.gradient(); forAll (bufferMesh1, faceI) { gradMesh1[faceI] = ... } } Dont forget to include fixedGradientFvPatchScalarFields.H file before main() Senthil |
There is an error in the aforementioned code...it should be
if(T.boundaryField()[patchIMesh1].type() == "fixedGradient") not if(mesh.boundaryField()[patchIMesh1].type() == "fixedGradient") Where T is the field that needs to be altered. |
All times are GMT -4. The time now is 18:57. |