CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   undefined reference_ linking error (https://www.cfd-online.com/Forums/main/229621-undefined-reference_-linking-error.html)

nikhil108 August 17, 2020 12:19

undefined reference_ linking error
 
1 Attachment(s)
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:confused:. 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.

agd August 17, 2020 13:12

Is the programming language case-sensitive? You use two different variables in your post if so.

nikhil108 August 17, 2020 13:25

my mistake (in the post). yah! prog language is case senstitive. But in the code, there is nothing wrong with the variable case.


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