CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   wmake error while adding T to icoFoam (http://www.cfd-online.com/Forums/openfoam/91142-wmake-error-while-adding-t-icofoam.html)

boongsin12 August 1, 2011 17:38

wmake error while adding T to icoFoam
 
Hello,

I am trying to modify currently available solver in OpenFoam. http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam So, I found a great tutorial on how to implement temperature into icoFoam, which is currently available.

I am having a little trouble wmake-ing the solver. After following the tutorial in detail, I was not able to compile the solver. Instead, the following came up as error. I only see one error and that is colored in red. I would like some insights from those who have already tried this particular tutorial or have implemented their own solver.

By the way, I am using OpenFoam 2.0, the newest.

Thanks so much for your time.

Code:

root@brad-ThinkPad-X200:/opt/openfoam200/applications/solvers/incompressible/my_icoFoam# wmake
SOURCE=my_icoFoam.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -I/opt/openfoam200/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam200/src/OpenFOAM/lnInclude -I/opt/openfoam200/src/OSspecific/POSIX/lnInclude  -fPIC -c $SOURCE -o Make/linux64GccDPOpt/my_icoFoam.o
my_icoFoam.C: In function ‘int main(int, char**)’:
my_icoFoam.C:104:2: error: no matching function for call to ‘Foam::fvMatrix<double>::fvMatrix(Foam::tmp<Foam::fvMatrix<Foam::Vector<double> > >)’
/opt/openfoam200/src/finiteVolume/lnInclude/fvMatrix.C:418:1: note: candidates are: Foam::fvMatrix<Type>::fvMatrix(const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&, Foam::Istream&) [with Type = double]
/opt/openfoam200/src/finiteVolume/lnInclude/fvMatrix.C:361:1: note:                Foam::fvMatrix<Type>::fvMatrix(const Foam::tmp<Foam::fvMatrix<Type> >&) [with Type = double]
/opt/openfoam200/src/finiteVolume/lnInclude/fvMatrix.C:330:1: note:                Foam::fvMatrix<Type>::fvMatrix(const Foam::fvMatrix<Type>&) [with Type = double]
/opt/openfoam200/src/finiteVolume/lnInclude/fvMatrix.C:273:1: note:                Foam::fvMatrix<Type>::fvMatrix(const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&, const Foam::dimensionSet&) [with Type = double]
/opt/openfoam200/src/finiteVolume/lnInclude/readPISOControls.H:3:15: warning: unused variable ‘nOuterCorr’
/opt/openfoam200/src/finiteVolume/lnInclude/readPISOControls.H:12:16: warning: unused variable ‘momentumPredictor’
/opt/openfoam200/src/finiteVolume/lnInclude/readPISOControls.H:15:16: warning: unused variable ‘transonic’
make: *** [Make/linux64GccDPOpt/my_icoFoam.o] Error 1


boongsin12 August 1, 2011 18:38

Ah ha,

I figured it out. Simple mistake on my part.

Toorop August 10, 2011 03:49

Hi Brad,
same problem here, but can't crack it. Could you please explain the solution!

Toorop August 17, 2011 07:34

To finish this off!
Another freaking blind copy-paste error. In createFields.H:
Code:

volScalarField T
(
    IOobject
    (
        "T",
        runTime.timeName(),
        mesh,
        IOobject::MUST_READ,
        IOobject::AUTO_WRITE
    ),
    mesh
);


falsafioon November 1, 2012 14:13

Hi everybody

I'm new in OpenFOAM and C++ and I'm trying to modify an available solver to solve a cross derivative equation. But unfortunately I'm getting the similar error while wmake-ing the solver:
no matching function for call to ‘Foam::fvMatrix<Foam::Vector<double> >

The modified solver is:

Code:

#include "fvCFD.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

int main(int argc, char *argv[])
{
      #include "setRootCase.H"
      #include "createTime.H"
      #include "createMesh.H"
      #include "createFields.H"

      // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

      Info<< "\nStarting time loop\n" << endl;

      while (runTime.loop())
      {

              Info<< "Time = " << runTime.timeName() << nl << endl;

        fvVectorMatrix TEqn
        (
                  (fvc::grad(phi) & vector(1,0,0)))           
        );

        solve( TEqn ==  -s);

            Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" << nl << endl;

            Info<< "Estimating error in scalar poisson equation" << endl;


        runTime.write();
              Info<< endl;

          } // Fin Error

          Info<< "End-loop\n" << endl;


          return 0;

}

Does anybody know how can I fix the problem?
Please excuse me because of my poor English.
Thank you for your help

nimasam November 2, 2012 07:25

Code:

fvVectorMatrix TEqn
        (
                  (fvc::grad(phi) & vector(1,0,0)))           
        );

at least two errors:
1) extra ")"
2) inner product of two vector is an Scalar, so it should be "fvScalarMatrix"

falsafioon November 2, 2012 14:19

Thank you for your consideration

But unfortunately I'm still receiving the same error message even after correcting the mentioned errors. The new one is:

Code:

fvScalarMatrix TEqn       
(                 
          (fvc::grad(phi) & vector(1,0,0))                 
);

But I think the problem is somewhere else because when I change the code like to the following it works properly:

Code:

fvScalarMatrix TEqn       
(
                  fvm::laplacian(phi)
                - fvm::laplacian(phi)
                (fvc::grad(phi) & vector(1,0,0))                   
);

Any help?

nimasam November 2, 2012 14:45

uhum
thats right, because you use "fvc"
fvc convert a field to another field, it does not make any matrix

falsafioon November 5, 2012 18:03

Thank you Nima
yes , you are right, but it's still supposed to work because both sides are scalar fields. So why doesn't it work?
Let's talk about something simpler. Even following code couldn't be compiled:

Code:


        fvScalarMatrix TEqn
        (
              fvc::grad(phi)
        );
        solve( TEqn ==  -s);

both sides are scalar fields
what's the reason?

nimasam November 6, 2012 03:04

because fvc::grad(phi) does not make the matrix of coefficient, it is a known and definite variable, it is like you put for example a variable T = s , which both T and s has value :)

falsafioon November 6, 2012 14:56

I appreciate your help Nima, I found the problem

Actually I was trying to solve Winslow equation by OpenFOAM:

αxξξ − 2βxξη + γxηη = 0

but it seems that it's impossible.
Does anybody know if there is a way to solve it by OpenFOAM?

falsafioon November 23, 2012 20:34

Hi everybody

any idea to handle cross derivatives (like xξη) in OpenFOAM?


All times are GMT -4. The time now is 21:41.