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

Compilation Issues with CavitatingFluid FSI Code

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By Daniel_Khazaei
  • 1 Post By Daniel_Khazaei
  • 1 Post By Daniel_Khazaei

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   January 4, 2019, 17:24
Default Compilation Issues with CavitatingFluid FSI Code
  #1
New Member
 
Tom
Join Date: Nov 2018
Posts: 23
Rep Power: 7
russel60 is on a distinguished road
Hi all,

I have been working adding the fluid solver cavitatingFoam to the fsiFoam solver from the FluidSolidInteraction toolbox in Foam_extend. I have gotten really close to having the solver compile, but have two persistent issues that I have not been able to resolve. I appreciate any and all help I can get for how to fix these problems.

First: I am getting an 'error: invalid use of void expression' pop up when closing the final parenthesis in the variable declaration section of my code. Error:

Code:
fluidSolvers/cavitatingFluid/cavitatingFluid.C: In constructor ‘Foam::fluidSolvers::cavitatingFluid::cavitatingFluid(const Foam::fvMesh&)’:
fluidSolvers/cavitatingFluid/cavitatingFluid.C:216:5: error: invalid use of void expression
     )
     ^
Related Code:

Code:
    rho_
    (
        IOobject
        (
            "rho",
            runTime().timeName(),
            mesh,
            IOobject::MUST_READ,
            IOobject::AUTO_WRITE
        ),
        max (psi_*p_ + (1.0 - gamma_)*rhol0
                     + ((gamma_*psiv + (1.0 - gamma_)*psil) - psi_)*pSat,
                     rhoMin)
    ),


    turbulence_
    (
        incompressible::turbulenceModel::New
        (
            U_, phi_, twoPhaseProperties_
        )
    )

{}
[The parenthesis causing the error is in bold. It is the last single parenthesis ')' above '{}']

There are no open parenthesis in the code above the excerpt, and I have taken the turbulence_ line directly from an existing code that compiled successfully. I have read on other posts that this is probably due to asking for an output from a void function, but I do not think I am using any void functions. C++ is still new to me, so I may be very wrong.

Second Issue: I am getting a conversion error when calculating the compressible courant number.

Error:

Code:
fluidSolvers/cavitatingFluid/cavitatingFluid.C: In member function ‘virtual void Foam::fluidSolvers::cavitatingFluid::evolve()’:
fluidSolvers/cavitatingFluid/cavitatingFluid.C:412:20: error: cannot convert ‘Foam::tmp<Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> >’ to ‘Foam::scalar {aka double}’ in assignment
             velMag = max(phiOverRho)/mesh.magSf()).value();
Related Code:

Code:
 // CourantNo
        {
        scalar CoNum = 0.0;
        scalar meanCoNum = 0.0;
        scalar velMag = 0.0;

        if (mesh.nInternalFaces())
        {
            surfaceScalarField phiOverRho = mag(phi_)/fvc::interpolate(rho_);

            surfaceScalarField SfUfbyDelta =
                 mesh.surfaceInterpolation::deltaCoeffs()*phiOverRho;

            CoNum = max(SfUfbyDelta/mesh.magSf())
                .value()*runTime().deltaT().value();

            meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
                .value()*runTime().deltaT().value();

            velMag = max(phiOverRho)/mesh.magSf()).value();
        }

        Info<< "Courant Number mean: " << meanCoNum
            << " max: " << CoNum
            << " velocity magnitude: " << velMag << endl;
        }
I copied and pasted this code from this source, but it still does not work.

https://github.com/Unofficial-Extend...bleCourantNo.H


Thank you in advance for any help!
russel60 is offline   Reply With Quote

 

Tags
compilation error, fluidsolidinteraction, foam_extend, fsifoam


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
Issues with EHDFoam Compilation Aicharem OpenFOAM Programming & Development 15 June 28, 2019 00:39
evapVOFHardt code compilation error SKS13 OpenFOAM Programming & Development 5 June 25, 2017 14:13
custom code compilation error: library linking problem nadine OpenFOAM Programming & Development 5 October 10, 2014 09:58
State of the art in CFD technology Juan Carlos GARCIA SALAS Main CFD Forum 39 November 1, 1999 14:34
What kind of Cmmercial CFD code you feel well? Lans Main CFD Forum 13 October 27, 1998 10:20


All times are GMT -4. The time now is 14:35.