|
[Sponsors] |
December 12, 2009, 13:55 |
How to compile a new utility
|
#1 |
New Member
raul
Join Date: Nov 2009
Posts: 13
Rep Power: 17 |
Hi,
I am new openfoam user and I am not good at programming . I intend to find grad of a scalar variable which is a solution of my computation . Initially I used a function "gradient of unstructured variable" from paraFoam but it is giving me some error.So I am trying to make my own utility to calculate gradient of scalar quantity.Now,I guess if I make a new utility i would have to compile it with my solver and for that I am following instructions given in Userguide.I mentioned utilityFunctionObjects lib name in solver/Make/options and then used wmake command from inside solver dir. I guess it goes on well and ultimately yields a messege that solver is uptodate,but when i use the new utility command name from inside case directory it says command is not found.Can anyone please tell me what exact steps I should take to compile my newly defined utility file with the intended solver. Thanks and regards, rudy. |
|
December 12, 2009, 21:29 |
|
#2 |
Member
Alan Russell
Join Date: Aug 2009
Location: Boise, Idaho USA
Posts: 61
Rep Power: 17 |
Rudy,
Some searching through the OF forums will turn up a number of links to courses, tutorials, etc that cover programming and customizing applications. Here's a link that may be helpful: http://www.openfoamworkshop.org/2009...ngTutorial.pdf. A recent thread has an excellent list of links. http://www.cfd-online.com/Forums/ope...thingelse.html. Learning Foam is challenging, but it's worth the effort. Good luck, Alan |
|
December 13, 2009, 01:42 |
|
#3 | |
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36 |
Quote:
To sum it up
Code:
volVectorField gradT = fvc::grad(T);
Code:
volScalarField gradTx ( IOobject ( "gradTx", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), gradT.component(vector::X) );
Code:
gradT.write(); Code:
wmake I hope this help. Best, Alberto P.S. Simple answers to simple questions! Sometime a "search for it" simply does not work, especially for new users.
__________________
Alberto Passalacqua GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541) OpenQBMM - An open-source implementation of quadrature-based moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. Last edited by alberto; December 13, 2009 at 01:44. Reason: Added notes on build |
||
December 14, 2009, 09:43 |
|
#4 |
New Member
raul
Join Date: Nov 2009
Posts: 13
Rep Power: 17 |
Thanks a lot to both of u, I did develop my own utility to find gradient using ur instructions and it's working now...
regards, rudy |
|
October 1, 2011, 23:48 |
|
#5 |
Senior Member
Join Date: Nov 2009
Location: Michigan
Posts: 135
Rep Power: 17 |
gradT.write(); returns a zeroGradient field for patches. But the field is non-zero in component files like gradTx. Why?
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM | Rizwan | Fluent UDF and Scheme Programming | 40 | March 18, 2018 07:05 |
problem with sampling Utility in openFOAM 1.6 | carmir | OpenFOAM Post-Processing | 10 | February 26, 2014 03:00 |
Error compile file udf | czfluent | Fluent UDF and Scheme Programming | 24 | September 26, 2009 14:24 |
Can someone PLEASE document the development version installation | bernd | OpenFOAM Installation | 76 | November 14, 2008 22:51 |
Help for udf compile error | richard | FLUENT | 3 | October 13, 2003 00:13 |