CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Running, Solving & CFD

timeVaryingUniformFixedValue BC questions

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

LinkBack Thread Tools Display Modes
Old   August 13, 2009, 22:10
Default timeVaryingUniformFixedValue BC questions
Senior Member
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 314
Rep Power: 11
phsieh2005 is on a distinguished road
Sponsored Links
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?

phsieh2005 is offline   Reply With Quote
Sponsored Links

Old   August 17, 2009, 03:51
Senior Member
Henrik Rusche
Join Date: Mar 2009
Location: Braunschweig, Niedersachsen, Germany
Posts: 277
Rep Power: 11
henrik is on a distinguished road
Dear phsieh2005,

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

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

henrik is offline   Reply With Quote

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

I was about to give up on this.

phsieh2005 is offline   Reply With Quote


Thread Tools
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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Some perhaps stupid questions about calculix lynx Open Source Meshers: Gmsh, Netgen, CGNS, ... 11 May 17, 2010 06: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 10:41
Few questions phi FLUENT 0 March 4, 2005 10:23
turbulence modeling questions llowen Main CFD Forum 3 September 11, 1998 04:24

Sponsored Links

All times are GMT -4. The time now is 13:58.