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

Difference between codes and representations

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 2, 2009, 11:59
Default Difference between codes and representations
  #1
Senior Member
 
Antonio Martins
Join Date: Mar 2009
Location: Porto, Porto, Portugal
Posts: 112
Rep Power: 8
titio is on a distinguished road
Send a message via MSN to titio Send a message via Skype™ to titio
Hi Foamers,

I have a small question concerning relaxation. Is there any difference, when writting the code, between the
following forms of relaxation, when solving the Navier stokes equation for laminar flow of newtonian fluids.

Form 1

fvVector UEqn
(
fvm::ddt(U)
+ fvm::div(phi,U)
- fvm::laplacian(nu,U)
);

UEqn.relax();

solve (UEqn == -fvc:: grad(p));

Form 2

fvVector UEqn()
(
fvm::ddt(U)
+ fvm::div(phi,U)
- fvm::laplacian(nu,U)
);

UEqn().relax();

solve (UEqn() == -fvc:: grad(p));

Is there any significant difference between the two formulations.

Thanks,

Titio
titio is offline   Reply With Quote

Old   July 2, 2009, 14:10
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
No. The second UEqn is probably a autoPtr of a fvMatrix.
gschaider is offline   Reply With Quote

Old   July 3, 2009, 03:32
Default
  #3
Senior Member
 
Henrik Rusche
Join Date: Mar 2009
Location: Braunschweig, Niedersachsen, Germany
Posts: 275
Rep Power: 9
henrik is on a distinguished road
Hi Titio,

Bernhard is absolutely right.

Form 2 (and Form 1) are quoted incorrectly. Form 2 should read:

tmp<fvVectorMatrix> UEqn
(
fvm::ddt(U)
+ fvm::div(phi,U)
- fvm::laplacian(nu,U)
);

(see simpleFoam)

By using tmp (or alternatively autoPtr) one is able throw away the U-Matrix before solving the p-equation. This way, you can save some peak-memory in steady-state solvers.

Regards, Henrik
henrik is offline   Reply With Quote

Old   July 3, 2009, 07:58
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by henrik View Post
Bernhard is absolutely right.
... and to short to be understood. I planned to add a second sentence "This is only an 'administrative' construct and doesn't change the physical meaning of the equation" and obviously forgot that.

But Henrik's answer is better anyway
gschaider 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



All times are GMT -4. The time now is 18:39.