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

overloaded function type in div

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 15, 2013, 04:45
Default overloaded function type in div
  #1
Member
 
shiv
Join Date: Jun 2012
Location: Lucknow, IN
Posts: 51
Rep Power: 13
shash is on a distinguished road
hi foamers,

I am a newbie to openfoam, i am trying to implement a species transfer eq. on interfoam solver but i am getting errors while compiling my solver:

Quote:
cEqn.H:23:104: error: no matching function for call to ‘div(Foam::surfaceScalarField&, Foam::volScalarField&, <unresolved overloaded function type>)’
cEqn.H:23:104: note: candidates are:
/home/shash/OpenFOAM/OpenFOAM-2.1.1/src/finiteVolume/lnInclude/fvmDiv.C:45:1: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::fvm::div(const surfaceScalarField&, const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&, const Foam::word&)
snippet from cEqn.H

surfaceScalarField cPhi=
(
fvc::interpolate((D1 - D2/He)/(alpha1 +(1-alpha1)/He))*fvc::snGrad(alpha1)
)*mesh.magSf();

surfaceScalarField DPhi=
(
fvc::snGrad(Di)
)*mesh.magSf();

fvScalarMatrix Eqn
(
fvm::ddt(C) +fvm::div(phi,C) -fvm::laplacian(fvc::interpolate(Di),C) -fvm::div(DPhi,C,Foam::fvc::scheme) +fvm::div(cPhi,C,Foam::fvc::scheme)
);
Eqn.solve();
shash is offline   Reply With Quote

Old   June 16, 2013, 16:04
Default
  #2
Member
 
shiv
Join Date: Jun 2012
Location: Lucknow, IN
Posts: 51
Rep Power: 13
shash is on a distinguished road
Can someone plz reply to my query, i m stuck
shash is offline   Reply With Quote

Old   June 16, 2013, 16:23
Default
  #3
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings shash,

I think the problem is this part of the code:
Code:
fvm::div(DPhi,C,Foam::fvc::scheme) +fvm::div(cPhi,C,Foam::fvc::scheme)
"Foam::fvc::scheme" doesn't make much sense... and I have not seen this in the solvers of OpenFOAM.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   June 16, 2013, 16:28
Default
  #4
Member
 
shiv
Join Date: Jun 2012
Location: Lucknow, IN
Posts: 51
Rep Power: 13
shash is on a distinguished road
Hi bruno,

Thanks for the reply, ya you are correct , this part of the code is giving me lots of problems.
first i tried fvm::div(DPhi,C,scheme) but it didn't work so i modified to fvm::div(DPhi,C,Foam::fvc::scheme) , Can you please suggest what modification should i make .

shash is offline   Reply With Quote

Old   June 16, 2013, 16:30
Default
  #5
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Why aren't you simply using:
Code:
fvm::div(DPhi,C)


The scheme is meant to be configured in the case folder, namely in file "system/fvSchemes"!
__________________
wyldckat is offline   Reply With Quote

Old   June 16, 2013, 16:40
Default
  #6
Member
 
shiv
Join Date: Jun 2012
Location: Lucknow, IN
Posts: 51
Rep Power: 13
shash is on a distinguished road
hi bruno I tried that , thou i was able to successfully compile my solver but when i ran my case i got following errors and i assumed probably its b'coz i haven't specified the third parameter.
Quote:
Starting time loop

Courant Number mean: 0 max: 0
Interface Courant Number mean: 0 max: 0
deltaT = 0.00119047619
Time = 0.00119048

MULES: Solving for alpha1
Phase-1 volume fraction = 0 Min(alpha1) = 0 Max(alpha1) = 0
MULES: Solving for alpha1
Phase-1 volume fraction = 0 Min(alpha1) = 0 Max(alpha1) = 0


--> FOAM FATAL IO ERROR:
keyword div(((interpolate(((rho-(rho|rho))|(alpha1+((1-alpha1)|rho))))*snGrad(alpha1))*magSf),C) is undefined in dictionary "/home/shash/OpenFOAM/shash-2.1.1/run/arbit/abhijit-case/damBreak/system/fvSchemes::divSchemes"

file: /home/shash/OpenFOAM/shash-2.1.1/run/arbit/abhijit-case/damBreak/system/fvSchemes::divSchemes from line 30 to line 33.

From function dictionary::lookupEntry(const word&, bool, bool) const
in file db/dictionary/dictionary.C at line 400.

FOAM exiting
shash is offline   Reply With Quote

Old   June 17, 2013, 16:52
Default
  #7
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi shash,

But the message says it all!
All you need to do is to edit the file "system/fvSchemes" inside your case folder and find the group "divSchemes" and add this entry or similar:
Code:
div(((interpolate(((rho-(rho|rho))|(alpha1+((1-alpha1)|rho))))*snGrad(alpha1))*magSf),C) Gauss linear;
For example, if you look at this file for the tutorial "multiphase/interFoam/ras/damBreak", you'll see this:
Code:
divSchemes
{
    div(rho*phi,U) Gauss linear;
    div(phi,alpha) Gauss vanLeer;
    div(phirb,alpha) Gauss interfaceCompression;
    div(phi,k) Gauss upwind;
    div(phi,epsilon) Gauss upwind;
    div(phi,R) Gauss upwind;
    div(R) Gauss linear;
    div(phi,nuTilda) Gauss upwind;
    div((muEff*dev(T(grad(U))))) Gauss linear;
}
So you simply add the line the solver is asking for:
Code:
divSchemes
{
    div(rho*phi,U) Gauss linear;
    div(phi,alpha) Gauss vanLeer;
    div(phirb,alpha) Gauss interfaceCompression;
    div(phi,k) Gauss upwind;
    div(phi,epsilon) Gauss upwind;
    div(phi,R) Gauss upwind;
    div(R) Gauss linear;
    div(phi,nuTilda) Gauss upwind;
    div((muEff*dev(T(grad(U))))) Gauss linear;
    div(((interpolate(((rho-(rho|rho))|(alpha1+((1-alpha1)|rho))))*snGrad(alpha1))*magSf),C) Gauss linear;
}
Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   June 18, 2013, 12:21
Default
  #8
Member
 
shiv
Join Date: Jun 2012
Location: Lucknow, IN
Posts: 51
Rep Power: 13
shash is on a distinguished road
Hi bruno,

Thanks a very lot it works, I suppose i misinterpreted the errors that were displayed
shash 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
[swak4Foam] GroovyBC the dynamic cousin of funkySetFields that lives on the suburb of the mesh gschaider OpenFOAM Community Contributions 300 October 29, 2014 18:00
interFoam/kOmegaSST tank filling with printStackError/Mules simpomann OpenFOAM Running, Solving & CFD 3 February 17, 2014 17:06
ParaView for OF-1.6-ext Chrisi1984 OpenFOAM Installation 0 December 31, 2010 06:42
Error with Wmake skabilan OpenFOAM Installation 3 July 28, 2009 00:35
Elements that limit the Courant number skabilan OpenFOAM Running, Solving & CFD 9 July 3, 2008 12:07


All times are GMT -4. The time now is 08:03.