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

Custom boundary condition - how to use indices?

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 18, 2014, 13:09
Default Custom boundary condition - how to use indices?
  #1
New Member
 
Mehdi Famouri
Join Date: Jan 2011
Posts: 12
Rep Power: 15
mehdi8619 is on a distinguished road
Hey guys, I'm trying to use indices to define a fixed value boundary conditions but I have no idea how to, check this out:
==========
forAll(*this, i)
{
scalar yy=patch().Cf()[i].component(1);
operator[i]== (n*0);
if (yy < .03)
{
operator[i]= (n*(-0.005));
}
if (yy > .07 )
{
operator[i]= (n*(.005));
}
}
==========
Of course, the use of "[i]" is totally inappropriate. Just wanted to make sure y'all understand what I'm looking for! But I did accomplished a mixed boundary conditions. I basically looking for something like this:
=========
forAll(*this, i)
{
scalar yy=patch().Cf()[i].component(1);
this->refValue()[i]= vector::zero;
this->refGrad()[i] = vector::zero;
this->valueFraction()[i] = 1.0;
if (yy < .03)
{
this->refValue()[i]= n*UUU1;
this->refGrad()[i] = vector::zero;
this->valueFraction()[i] = 1.0;
}
if (yy > .07 )
{
this->refValue()[i]= n*UUU2;
this->refGrad()[i] = vector::zero;
this->valueFraction()[i] = 1.0;
}
}
=========

Thank you for your attention
Mehdi
mehdi8619 is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
sigSEGV error + custom boundary condition in OF 2.3.0 bharat.gmail OpenFOAM Programming & Development 2 December 19, 2014 07:58
conjugate boundary condition Daniel_Khazaei OpenFOAM Programming & Development 0 December 31, 2013 13:11
Question about heat transfer coefficient setting for CFX Anna Tian CFX 1 June 16, 2013 06:28
No-slip condition for non-resolved boundary layer in open channel banks Lupocci Main CFD Forum 1 January 17, 2013 03:11
asking for Boundary condition in FLUENT Destry FLUENT 0 July 27, 2010 00:55


All times are GMT -4. The time now is 01:26.