CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

How to implement power in OpenFoam?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 7, 2010, 02:45
Default How to implement power in OpenFoam?
  #1
Member
 
Mohammad Zakerzadeh
Join Date: Dec 2009
Location: Aachen, Germany
Posts: 40
Rep Power: 17
moh1367 is on a distinguished road
Hello
I want to implement power "m" in a function in openFoam 1.6 and I have an error message that said I have to define m as a "double" while now I have "double&". "m" definition is as follows:

scalar x0=0.5;
double x=centres[celli].x();
double m=pow(x-x0,10)+1;
scalar y0=0.1;
scalar a=0.5;
double b=1-pow((x-x0)/a,2);



what is the bug of my code?
moh1367 is offline   Reply With Quote

Old   August 10, 2010, 04:51
Default
  #2
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25
nimasam is on a distinguished road
hi friend
i guess problem where u subtract an scalar value from double!
so define x0 as double instead of scalar maybe it works
nimasam is offline   Reply With Quote

Reply

Tags
openfoam, power function


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
Superlinear speedup in OpenFOAM 13 msrinath80 OpenFOAM Running, Solving & CFD 18 March 3, 2015 06:36
Modified OpenFOAM Forum Structure and New Mailing-List pete Site News & Announcements 0 June 29, 2009 06:56
64bitrhel5 OF installation instructions mirko OpenFOAM Installation 2 August 12, 2008 19:07
Adventure of fisrst openfoam installation on Ubuntu 710 jussi OpenFOAM Installation 0 April 24, 2008 15:25
OpenFOAM Debian packaging current status problems and TODOs oseen OpenFOAM Installation 9 August 26, 2007 14:50


All times are GMT -4. The time now is 05:45.