|
[Sponsors] |
Compilation Issues with CavitatingFluid FSI Code |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#1 |
New Member
Tom
Join Date: Nov 2018
Posts: 23
Rep Power: 7 ![]() |
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 ) ^ 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_ ) ) {} 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(); 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; } https://github.com/Unofficial-Extend...bleCourantNo.H Thank you in advance for any help! |
|
![]() |
![]() |
Tags |
compilation error, fluidsolidinteraction, foam_extend, fsifoam |
|
|
![]() |
||||
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 |