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

Error happens when 'scheme' and 'SCheme' are added in fvm::div()

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By Cyp

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 8, 2018, 11:15
Default Error happens when 'scheme' and 'CSheme' are added in fvm::div()
  #1
New Member
 
Pei Li
Join Date: Nov 2015
Posts: 10
Rep Power: 10
HectorLee is on a distinguished road
Hello, everyone,

I am trying to simulate transport phenomena in two-phase flow and find a piece of source code for solving the advection-diffusion equation with the interface. For divergence part, it is written as:

fvm::div(phi, C, scheme) - fvm::div(phiD, C, CScheme)

After compiling the code, I got "error: ‘CScheme’ was not declared in this scope" and "error: 'scheme’ was not declared in this scope."

Although I searched solution using google, no solution is found. Is there anyone knowing how to fix this error? Thanks a lot.

Last edited by HectorLee; May 8, 2018 at 16:58.
HectorLee is offline   Reply With Quote

Old   May 10, 2018, 21:45
Default
  #2
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18
Cyp is on a distinguished road
The compilation error sounds pretty clear to me: the variables scheme and Cscheme you are using as arguments to construct your matrix from the function fvm::div() are not declared.

There are two ways for solving your problem:

1: you don't call the fonction with three arguments but only two (the third one is optional)
Code:
fvm::div(phi, C) - fvm::div(phiD, C)
You will have to specify the discretization scheme for div(phi,C) and div(phiD,C) in system/fvSchemes

2: you declare scheme and CScheme before calling your functions:
Code:
word scheme    "div(phi,C)";
word CScheme "div(phiD,C)";

...

fvm::div(phi, C, scheme) - fvm::div(phiD, C, CScheme)
hjasak and HectorLee like this.

Last edited by Cyp; May 11, 2018 at 08:00.
Cyp is offline   Reply With Quote

Old   May 15, 2018, 00:46
Default
  #3
New Member
 
Pei Li
Join Date: Nov 2015
Posts: 10
Rep Power: 10
HectorLee is on a distinguished road
Thank you very much for your help, Cyprien. Sorry for replying you late, because I was in travel these days. I will try both methods later.
HectorLee 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
how to understand high resolution scheme and high order scheme iilw1314 Main CFD Forum 7 April 12, 2022 12:29
can you tell me best gradient, pressure & momentum order selection in fluent sanjiiv FLUENT 6 February 14, 2020 06:07
2nd order upwind scheme (Fluent and CFX) Far FLUENT 0 May 22, 2011 01:50
Godunov scheme Peter Main CFD Forum 6 November 27, 2009 10:51
extrapolation in MUSCL scheme Chandra Main CFD Forum 6 February 14, 2007 11:21


All times are GMT -4. The time now is 15:07.