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

How to limit a variable

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By ash
  • 2 Post By su_junwei

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 26, 2008, 10:43
Default Hi, i wanted to know how to li
  #1
ash
New Member
 
Arun Shourie
Join Date: Mar 2009
Location: Singapore
Posts: 12
Rep Power: 17
ash is on a distinguished road
Hi, i wanted to know how to limit a variable between the limits...

I know that my solution for the differential equation, which i am going to solve is piece wise continuous... or rather i am interested in the variable within the specifed limit....

Lets take for example... Temperature -> is my variable to be limited.... I am interested in solution within some temperature range, say from 300K to 2000K... So what i wanted to do is this.. If my differential equation predicts a temperature above 2000K, i want to limit that to 2000K and if the temperature goes below 300K, i want to limit that to 300K...

So, lets say that, i have incorporated this temperature variable in my differential equation and solved. Moreover I write this variable for each time step.... But before this variable is being used, i want to limit tha values of this variable...

Someone please give me C++ snippet, which openfoam can understand
Luttappy likes this.
ash is offline   Reply With Quote

Old   June 26, 2008, 20:32
Default Hi Arun try Temperature.m
  #2
Senior Member
 
su_junwei's Avatar
 
su junwei
Join Date: Mar 2009
Location: Xi'an China
Posts: 151
Rep Power: 20
su_junwei is on a distinguished road
Send a message via MSN to su_junwei
Hi Arun

try
Temperature.max(dimensionedScalar("t",Temperature. dimensions(),300));

Temperature.min(dimensionedScalar("t",Temperature. dimensions(),2000));

Junwei
mm.abdollahzadeh and Luttappy like this.
su_junwei 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
limit holdup value mohini CFX 2 July 31, 2008 03:58
limit for a variable Luis CFX 5 February 12, 2008 05:55
Adaption limit ? John Deas FLUENT 1 December 6, 2007 05:42
limit of the CFX Eric CFX 7 December 4, 2006 12:42
Limit of CFD mourad Abdelmalek Siemens 2 October 23, 2000 08:27


All times are GMT -4. The time now is 17:34.