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

OpenFoam c++ syntax for min(... ) equation ?

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 6, 2015, 17:52
Default OpenFoam c++ syntax for min(... ) equation ?
  #1
Senior Member
 
Klaus
Join Date: Mar 2009
Posts: 250
Rep Power: 22
klausb will become famous soon enough
Hello,

what is the OpenFoam c++ syntax for the following equation:

fynew = min(fy, 1.0, 0.5+0.0025*Rt)

where fy and Rt are known equations.

Klaus
klausb is offline   Reply With Quote

Old   November 6, 2015, 18:01
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

it depends. See http://en.cppreference.com/w/cpp/algorithm/min.

So basically you add one more min:

fynew = min(fy, min(1.0, 0.5+0.0025*Rt))
alexeym 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
effect of mass transfer on pressure equation in OpenFoam rapierrz OpenFOAM Running, Solving & CFD 0 October 10, 2015 13:54
OpenFOAM Training, London, Chicago, Munich, Sep-Oct 2015 cfd.direct OpenFOAM Announcements from Other Sources 2 August 31, 2015 14:36
OpenFOAM file syntax amtri OpenFOAM 5 August 28, 2010 08:19
Hentalpy equation openfoam - miss a term lions85 OpenFOAM 2 August 18, 2010 13:12
error while compiling the USER Sub routine CFD user CFX 3 November 25, 2002 16:16


All times are GMT -4. The time now is 10:23.