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

Where I am wronG

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

Reply
 
LinkBack Thread Tools Display Modes
Old   August 6, 2007, 12:20
Default Hi Hrvoje, Sorry to not rep
  #1
lam
Member
 
Hoang-Lam
Join Date: Mar 2009
Location: Lausanne, Switzerland
Posts: 60
Rep Power: 8
lam is on a distinguished road
Hi Hrvoje,

Sorry to not replying you for the last time (about a_N coefficients. I re-read your thesys, but it stil not ok for me), but in emmergency, I want to know where I'm wrong in the implementation of a Stokes solver:
I begin with the simpleFOam.C file: so I just removed the div(phi,U) and changed some "minus" by "plus", according to he discretisation of Navier-Stokes, explained in your thesys.
(in my simulation, I put turbulence OFF)
****************************
tmp<fvvectormatrix> UEqn
(turbulence->divR(U));
UEqn().relax();
solve(UEqn() == -fvc::grad(p));
p.boundaryField().updateCoeffs();
volScalarField AU = UEqn().A();
U = UEqn().H()/AU;
UEqn.clear();
phi = fvc::interpolate(U) & mesh.Sf();
adjustPhi(phi, U, p);

for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
(
// I put a "minus" here, because now: Up=[H(U)+grad(p)]/ap, so the discretisation of div(U)=0 gives me the equation of pressure below:
fvm::laplacian(1.0/AU, p) == -fvc::div(phi));
pEqn.setReference(pRefCell, pRefValue); pEqn.solve();
if (nonOrth == nNonOrthCorr)
{
// "+=" instead of "-=" because F = S.Uf = S.[H(U)/ap]f + S.[grad(p)/ap]f
phi += pEqn.flux();
}
}

# include "continuityErrs.H"

p.relax();
// "+=" instead of "-=" because Up=[H(U)+grad(p)]/ap
U += fvc::grad(p)/AU;
U.correctBoundaryConditions();
}

********************
the end of the program is the same.
It seems so easy, but I can't get by myself.
I just need your patience to tell me where I'm wrong.

Thanks in advance,

Lam
lam is offline   Reply With Quote

Old   August 7, 2007, 12:15
Default just take a little look please
  #2
lam
Member
 
Hoang-Lam
Join Date: Mar 2009
Location: Lausanne, Switzerland
Posts: 60
Rep Power: 8
lam is on a distinguished road
just take a little look please
lam is offline   Reply With Quote

Old   August 7, 2007, 13:06
Default ? You have messed up the signs
  #3
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,758
Rep Power: 21
hjasak will become famous soon enough
? You have messed up the signs: just delete the convection terms and use a symmetric solver for the momentum equation.

I haven't got time to go through this in detail, but it should really be as simple as that.

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   August 8, 2007, 03:56
Default Hi Hrvoje, Thanks to reply
  #4
lam
Member
 
Hoang-Lam
Join Date: Mar 2009
Location: Lausanne, Switzerland
Posts: 60
Rep Power: 8
lam is on a distinguished road
Hi Hrvoje,

Thanks to reply me.
Ok, I'm going to delete the convection term...
even if I don't understand why the signs are wrong.
Hope that you will explain me when you get more time.

Cheers,

Lam
lam 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
anything wrong in this udf brusly FLUENT 0 November 26, 2007 07:02
what's wrong with my UDF??? lk zhu FLUENT 2 June 16, 2006 02:52
what's wrong with 3.2 F.K. CD-adapco 8 August 9, 2004 02:44
What's wrong with my UDF? olivia FLUENT 1 June 23, 2001 17:06
wrong y+ jurek Main CFD Forum 1 August 26, 2000 21:01


All times are GMT -4. The time now is 19:37.