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

undefined reference_ linking error

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 17, 2020, 13:19
Question undefined reference_ linking error
  #1
Member
 
nikhil108's Avatar
 
Nikhil
Join Date: May 2020
Location: Freiburg
Posts: 43
Rep Power: 6
nikhil108 is on a distinguished road
Hallo,

I am trying to edit reactingFoam solver, to add porous capability. In the process, i got a error "temporary deallocated error", so, as to clear that error, i did some changes in the code. Now, deallocation error is gone, but getting a new error, which says "undefined reference to `trTU()'". trTU() is a tmp variable created in Ueqn.H. By some research, i came to know its a linker error, but dont know how to resolve it. Please have a look at the UEqn.H code and the error msg, and let me know, your views. Thanks.
Code:
MRF.correctBoundaryVelocity(U);

    tmp<fvVectorMatrix> tUEqn
    (
        fvm::ddt(rho, U) + fvm::div(phi, U)
      + MRF.DDt(rho, U)
      + turbulence->divDevTau(U)
     ==
        fvOptions(rho, U)
    );
    fvVectorMatrix& UEqn = tUEqn.ref();

    UEqn.relax();

    tmp<volScalarField> trAU(); //trAU;
    tmp<volTensorField> trTU(); //trTU;

    if (pressureImplicitPorosity)
    {
    tmp<volTensorField> tTU = tensor(I)*UEqn.A();
    pZones.addResistance(UEqn, tTU.ref());
    trTU() = inv(tTU());
    trTU().ref().rename("rAU");
    fvOptions.constrain(UEqn);
    volVectorField gradp(fvc::reconstruct
            ( (
                  - ghf*fvc::snGrad(rho)
                  - fvc::snGrad(p_rgh)
            )*mesh.magSf()
            ) );
        for (int UCorr=0; UCorr<nUCorr; UCorr++)
        {
         U = trTU() & (UEqn.H() - gradp);
        }
    U.correctBoundaryConditions();
    fvOptions.correct(U);
    K = 0.5*magSqr(U);
    }

   else

   {
   pZones.addResistance(UEqn);
   fvOptions.constrain(UEqn);
        if(pimple.momentumPredictor())
        {
        solve
        (
            UEqn
         ==
            fvc::reconstruct
            (
            (
                  - ghf*fvc::snGrad(rho)
                  - fvc::snGrad(p_rgh)
            )*mesh.magSf()
            )
        );

        fvOptions.correct(U);
        K = 0.5*magSqr(U);
        trAU() = 1.0/UEqn.A();
        trAU().ref().rename("rAU");
"UEqn.H" 88L, 1820C
cheers,
nm.
Attached Images
File Type: jpg Unbenannt.jpg (109.6 KB, 0 views)

Last edited by nikhil108; August 17, 2020 at 14:21. Reason: correction
nikhil108 is offline   Reply With Quote

Old   August 17, 2020, 14:12
Default
  #2
agd
Senior Member
 
Join Date: Jul 2009
Posts: 358
Rep Power: 19
agd is on a distinguished road
Is the programming language case-sensitive? You use two different variables in your post if so.
agd is offline   Reply With Quote

Old   August 17, 2020, 14:25
Default
  #3
Member
 
nikhil108's Avatar
 
Nikhil
Join Date: May 2020
Location: Freiburg
Posts: 43
Rep Power: 6
nikhil108 is on a distinguished road
my mistake (in the post). yah! prog language is case senstitive. But in the code, there is nothing wrong with the variable case.
nikhil108 is offline   Reply With Quote

Reply

Tags
c++, linking, openfoam, solver compilation


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] swak4foam openfoam 7 installation problem Andrea23 OpenFOAM Community Contributions 1 February 17, 2020 19:11
[blockMesh] blockMesh with double grading. spwater OpenFOAM Meshing & Mesh Conversion 92 January 12, 2019 10:00
OpenFOAM 1.6-ext git installation on Ubuntu 11.10 x64 Attesz OpenFOAM Installation 45 January 13, 2012 13:38
How to install CGNS under windows xp? lzgwhy Main CFD Forum 1 January 11, 2011 19:44
checking the system setup and Qt version vivek070176 OpenFOAM Installation 22 June 1, 2010 13:34


All times are GMT -4. The time now is 17:28.