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

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

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

Reply
 
LinkBack Thread Tools Display Modes
Old   November 6, 2015, 17:52
Default OpenFoam c++ syntax for min(... ) equation ?
  #1
Member
 
Klaus
Join Date: Mar 2009
Posts: 82
Rep Power: 8
klausb is on a distinguished road
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,304
Rep Power: 23
alexeym will become famous soon enoughalexeym will become famous soon enough
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 online now   Reply With Quote

Reply

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
effect of mass transfer on pressure equation in OpenFoam rapierrz OpenFOAM Running, Solving & CFD 0 October 10, 2015 12:54
OpenFOAM Training, London, Chicago, Munich, Sep-Oct 2015 cfd.direct OpenFOAM Announcements from Other Sources 2 August 31, 2015 13:36
OpenFOAM file syntax amtri OpenFOAM 5 August 28, 2010 07:19
Hentalpy equation openfoam - miss a term lions85 OpenFOAM 2 August 18, 2010 12: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 06:20.