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

timeVaryingUniformFixedValue BC questions

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 13, 2009, 23:10
Default timeVaryingUniformFixedValue BC questions
  #1
Senior Member
 
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 334
Rep Power: 18
phsieh2005 is on a distinguished road
Dear OpenFOAM experts:

I am trying to modify timeVaryingUniformFixedValue BC so that it can handle time varying with cycles.

Can someone explaim what "fvPatchField<Type>:perator== " means?

why I cannot do fvPatchField<Type>:perator== 1?

I can read in t1, t2, and tPeriod into the code, then, I want to

1. calculate cycle number: nCycle = int(runTime.value()/tPeriod)
2. localTime = runTime.value() - nCycle * tPeriod;
if(localTime >= 0 && localTime < t1)
operator == 0;
else if (localTime >= t1 && localTime < t2)
operator == 1;
else if(localTime <= tPeriod)
operator = 0;

----
my problem with 1 above is that, OpenFOAM gave type cast error. If I use floor() function, it is not support in foam name space.
in 2 above, how to assign the patch value to either 0 or 1?

Can someone shed some light on this?

Pei
phsieh2005 is offline   Reply With Quote

Old   August 17, 2009, 04:51
Default
  #2
Senior Member
 
Henrik Rusche
Join Date: Mar 2009
Location: Wernigerode, Sachsen-Anhalt, Germany
Posts: 281
Rep Power: 18
henrik is on a distinguished road
Dear phsieh2005,

Quote:
why I cannot do fvPatchField<Type>perator== 1?
Because it's templated and 1 is not valid for a vector or tensor. Use

Code:
 fvPatchField<Type>:operator== pTraits<Type>::one;
timeVaryingUniformFixedValue also has an option "repeat" which already does what you are looking for.

Henrik
henrik is offline   Reply With Quote

Old   August 17, 2009, 08:07
Smile
  #3
Senior Member
 
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 334
Rep Power: 18
phsieh2005 is on a distinguished road
Thanks a lot for the answer, Henrik!

I was about to give up on this.

Pei
phsieh2005 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
[Other] Some perhaps stupid questions about calculix lynx OpenFOAM Meshing & Mesh Conversion 11 May 17, 2010 07:48
So many questions in DPM & UDF - Help! URGENT! Prashanth FLUENT 0 March 3, 2009 23:26
Fluent FAQ Started - Fill it With Questions Jonas Larsson FLUENT 0 September 12, 2005 11:41
Few questions phi FLUENT 0 March 4, 2005 10:23
turbulence modeling questions llowen Main CFD Forum 3 September 11, 1998 05:24


All times are GMT -4. The time now is 21:22.