CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

fixedGradient boundary condition

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 17, 2009, 20:44
Default fixedGradient boundary condition
  #1
Senior Member
 
Senthil Kabilan
Join Date: Mar 2009
Posts: 113
Rep Power: 17
skabilan is on a distinguished road
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
skabilan is offline   Reply With Quote

Old   November 18, 2009, 14:43
Default
  #2
Senior Member
 
Senthil Kabilan
Join Date: Mar 2009
Posts: 113
Rep Power: 17
skabilan is on a distinguished road
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
skabilan is offline   Reply With Quote

Old   December 3, 2009, 13:55
Default
  #3
Senior Member
 
Senthil Kabilan
Join Date: Mar 2009
Posts: 113
Rep Power: 17
skabilan is on a distinguished road
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.
skabilan is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Boundary Conditions Thomas P. Abraham Main CFD Forum 20 July 7, 2013 05:05
Axis Boundary Condition..what is it? CFDtoy FLUENT 6 February 13, 2007 05:51
How to set boundary condition in Fluent for the fo Peiyong FLUENT 1 November 10, 2006 11:44
1 and 2 Order Boundary condition at the same place CFD_Flo Main CFD Forum 4 July 11, 2005 11:57
How to resolve boundary condition problem? sam FLUENT 2 July 20, 2003 02:19


All times are GMT -4. The time now is 03:30.