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

Crank Nicholson scheme for Laplacian failed

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 29, 2010, 12:22
Default Crank Nicholson scheme for Laplacian failed
  #1
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18
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, 12:12
Default
  #2
New Member
 
Michael B Martell Jr
Join Date: Feb 2010
Location: Amherst, MA
Posts: 18
Rep Power: 16
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, 08:36
Default
  #3
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18
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, 08:58
Default
  #4
New Member
 
Michael B Martell Jr
Join Date: Feb 2010
Location: Amherst, MA
Posts: 18
Rep Power: 16
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


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
About the Use of Crank Nicholson scheme And OpenFOAM 1 November 14, 2017 13:25
Transient boundary conditions Jarrod Sinclair (Sinclair) OpenFOAM Running, Solving & CFD 133 May 6, 2015 07:21
user subroutine error CFDUSER CFX 2 December 9, 2006 07:31
user defined function cfduser CFX 0 April 29, 2006 11:58
Crank Nicholson noName Main CFD Forum 3 September 15, 2004 10:10


All times are GMT -4. The time now is 20:10.