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

Crank Nicholson scheme for Laplacian failed

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

Reply
 
LinkBack Thread Tools Display Modes
Old   June 29, 2010, 11:22
Default Crank Nicholson scheme for Laplacian failed
  #1
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: France, Toulouse
Posts: 197
Rep Power: 7
Cyp is on a distinguished road
Hi!

I modify the laplacian discretization scheme into the scalarTransportFoam solver as suggested in the programmer's guide P-43 to implement the crank Nicholson scheme :

Code:
solve
      (
         fvm::ddt(rho,T)
      + fvm::div(phi,T)
      - 0.5*(fvm::laplacian(rho*DT,T)+fvc::laplacian(rho*DT,T))
      == ff
      );
where ff is my source term. The compilation is OK. However during runs, my results are wrong. For instance, if I integrate T over the entire domain, the returning result is half the expected one. It looks as if the fvc::laplacian(rho*DT,T) term is not account for.

In my fvSchemes I specify :
Code:
laplacianSchemes
{
    default    none;
    laplacian ((rho*DT),T) Gauss linear corrected;
}
Do you know how I can solve my problem ?

Regards,
Cyp
Cyp is offline   Reply With Quote

Old   July 16, 2010, 11:12
Default
  #2
New Member
 
Michael B Martell Jr
Join Date: Feb 2010
Location: Amherst, MA
Posts: 18
Rep Power: 6
theory37 is on a distinguished road
Try moving
Code:
0.5*(fvm::laplacian(rho*DT,T)+fvc::laplacian(rho*DT,T))
to the right hand side of == (and changing the sign, of course).
theory37 is offline   Reply With Quote

Old   July 19, 2010, 07:36
Default
  #3
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: France, Toulouse
Posts: 197
Rep Power: 7
Cyp is on a distinguished road
I tried your modification but I still have my problem...

How is your fvSchemes file ??
Cyp is offline   Reply With Quote

Old   July 19, 2010, 07:58
Default
  #4
New Member
 
Michael B Martell Jr
Join Date: Feb 2010
Location: Amherst, MA
Posts: 18
Rep Power: 6
theory37 is on a distinguished road
The relevant part of my fvSchemes dictionary:
Code:
laplacianSchemes
{
    default         Gauss linear corrected;
}
although what you have should work fine. Also, what does your ddtSchemes sub-dictionary look like? I'm fairly certain you need to have
Code:
ddtSchemes
{
    default           CrankNicholson 1;
}
in order for this to work properly, although I'm not sure. If this also doesn't work, perhaps try the exact equation shown in the Programmer's Guide?

Mike
theory37 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
Transient boundary conditions Jarrod Sinclair (Sinclair) OpenFOAM Running, Solving & CFD 132 November 30, 2011 11:06
About the Use of Crank Nicholson scheme And OpenFOAM 0 November 19, 2009 07:11
user subroutine error CFDUSER CFX 2 December 9, 2006 06:31
user defined function cfduser CFX 0 April 29, 2006 10:58
Crank Nicholson noName Main CFD Forum 3 September 15, 2004 09:10


All times are GMT -4. The time now is 16:47.