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

Help plz

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 28, 2013, 15:44
Default Help plz
  #1
New Member
 
Aria
Join Date: Nov 2012
Posts: 5
Rep Power: 13
ariaballack is on a distinguished road
hi everybody
I am writing a solver which needs two dependent parameters to be solver parallel. Actually c=f(D) and then D must be solved using already solved c. in other words, c and D have to be solved after ther one.but there is something wrong with the term "dimensionedScalar"
here is an abstract of the solver:


fvScalarMatrix cEqn
(
fvm::ddt(c)
+ fvm::div(phi, c)
- fvm::laplacian(Dc, c)
);

cEqn.relax();

cEqn.solve();



// Diffusionskoeffizient D(c,T)

dimensionedScalar g = 1.0/(1.0 + Rho1/Rho2 * (1.0/c - 1.0) );

Info << "g=" << f.value() << " " << f.dimensions() << endl;

Dc = D0 * g * ................

---------------------
in which, g at each time step is a function of c that has been already calculated in previous time step.
how should I loop them?
thanks
ariaballack is offline   Reply With Quote

Old   March 28, 2013, 17:35
Default
  #2
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 22
Lieven will become famous soon enough
Hi Ariaballack,

You try to convert a volScalarField (I presume) c into a dimensionedScalar g. This is simply not possible. If c is a field, g must be as well. So change dimensionedScalar in
Code:
volScalarField g("g",1.0/(1.0 + Rho1/Rho2 * (1.0/c - 1.0) ));
Just two more remarks:
* I don't really know what 'c' exactly represents but it seams to me that in principle 'c' can be 0 locally. If this is the case 1/c might result in a floating point error. But this is quite easy to solve by writing c in the numerator
* From dimensional point of view, the expression for g is kind of strange because you subtract a dimensionless field (1.0) from a dimensioned field (1/c) (I'm pretty sure this will give an error when you run the code).

Cheers,

L
Lieven is offline   Reply With Quote

Reply


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
[GAMBIT] Gambit Start Up error .... HELP PLZ! Abhya ANSYS Meshing & Geometry 2 July 12, 2012 01:40
plz help me! saha2122 FLUENT 4 September 21, 2010 08:17
plz help its urgent garima chaudhary FLUENT 0 September 25, 2007 06:28
plz ......help me out.....************************ krishna FLUENT 2 January 10, 2007 03:53
Doubt - while running iteration, plz help sak FLUENT 0 September 7, 2005 00:16


All times are GMT -4. The time now is 12:48.