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

help needed for programming

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

Reply
 
LinkBack Thread Tools Display Modes
Old   October 23, 2013, 02:33
Default help needed for programming
  #1
New Member
 
christy issac
Join Date: Oct 2013
Posts: 5
Rep Power: 3
chrisnitk is on a distinguished road
hi
iam christy, persuiing my mtech in thermal engg,Iam new here. For my mini project i have to solve Coutte flow using pressure correction technique.

i made my programme in C using staggered grid and used finite difference method.

when iam calculating my pressure value (i used float value) , since the values are too small it goes to a value of zero and in iterations it gives garbage value ....

how can i tackle too fine small values in cfd ??? is there any methodes or tools for that ...????

plz do help me
(u can send reply's to my mail also, issac_christy@yahoo.in)
chrisnitk is offline   Reply With Quote

Old   October 23, 2013, 12:44
Default
  #2
Member
 
Jace
Join Date: Oct 2012
Posts: 77
Rep Power: 5
zhengzh5 is on a distinguished road
Quote:
Originally Posted by chrisnitk View Post
hi
iam christy, persuiing my mtech in thermal engg,Iam new here. For my mini project i have to solve Coutte flow using pressure correction technique.

i made my programme in C using staggered grid and used finite difference method.

when iam calculating my pressure value (i used float value) , since the values are too small it goes to a value of zero and in iterations it gives garbage value ....

how can i tackle too fine small values in cfd ??? is there any methodes or tools for that ...????

plz do help me
(u can send reply's to my mail also, issac_christy@yahoo.in)
hey, usually you would set a global constant (1e-15 used for OpenFOAM's "SMALL" constant) and compare this constant to your floats, such that if your float is smaller than the constant, the constant is used instead. Else if float is larger, use the float. that way you avoid division by very tiny numbers.

hope that helps.
zhengzh5 is offline   Reply With Quote

Old   October 28, 2013, 05:09
Default
  #3
New Member
 
christy issac
Join Date: Oct 2013
Posts: 5
Rep Power: 3
chrisnitk is on a distinguished road
sir

i changed my float declaration in to double . nw iam getting the values ... iam solving couette flow problem in anderson text book by pressure correction method ...

nw only i see ur reply . thanks for helping me .. i will try dat ..

iam uploading my program here .. it wil b greatful if u can find any errors in that...

iam sory, if iam bothering u ... bt this is my first program , and iam very nervous abt it ............. thanking you
couettenew2.c
chrisnitk is offline   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
Waves2Foam Related Topics ngj OpenFOAM Running, Solving & CFD 1031 Yesterday 23:19
Installing swak4Foam to OpenFOAM in mac Kaquesang OpenFOAM Installation on Windows, Mac and other Unsupported Platforms 22 January 21, 2013 12:51
compiling firefoam Farshad_Noravesh OpenFOAM 27 December 24, 2012 05:21
libscotch-5.1.so needed for DPOpt flowris OpenFOAM Installation 6 May 2, 2012 16:46
a dissertation in ETD needed very much LiQiang Main CFD Forum 0 March 11, 2005 04:09


All times are GMT -4. The time now is 00:58.