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

Difference between forAll(boundary...) and operator==(..) in custom boundary

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   March 31, 2022, 11:33
Default Difference between forAll(boundary...) and operator==(..) in custom boundary
  #1
Senior Member
 
TWB
Join Date: Mar 2009
Posts: 402
Rep Power: 19
quarkz is on a distinguished road
Hi,

I wanted to create a custom inlet U BC which changes with time and I'm trying to use the codedFixedValue method.

I come across 2 ways to modifly the inlet U:

1.

Code:
time = this->db().time().value();
const fvPatch& boundaryPatch = patch(); 
vectorField& field = *this;

forAll(boundaryPatch, faceI) {
					
	field[faceI] =  vector( starting_incoming_vel*time, 0,0);
			   
	}
2.

Code:
cur_incoming_vel = vector( starting_incoming_vel*time, 0,0);
					
operator==( cur_incoming_vel );
So are they the same? Can I use either mtd?

Thanks
quarkz is offline   Reply With Quote

 


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



All times are GMT -4. The time now is 09:05.