|
[Sponsors] |
May 19, 2020, 07:51 |
Error: no match for operator/
|
#1 |
Senior Member
Join Date: Dec 2019
Posts: 215
Rep Power: 7 |
Hello everyone,
I am trying to modify the totalTemperature BC to make it time varying. I am trying to construct the new BC uniformTotalTemperature for that reason. I am getting this error message and I cannot find the reason why it appears: Code:
fields/fvPatchFields/derived/uniformTotalTemperature/uniformTotalTemperatureFvPatchScalarField.C: In member function ‘virtual void Foam::uniformTotalTemperatureFvPatchScalarField::updateCoeffs()’: fields/fvPatchFields/derived/uniformTotalTemperature/uniformTotalTemperatureFvPatchScalarField.C:158:19: error: no match for ‘operator/’ (operand types are ‘Foam::autoPtr<Foam::Function1<double> >’ and ‘Foam::tmp<Foam::Field<double> >’) operator==(T0_/(1.0 + 0.5*psip*gM1ByG*(1.0 - pos(phip))*magSqr(Up))); Code:
void Foam::uniformTotalTemperatureFvPatchScalarField::updateCoeffs() { if (updated()) { return; } scalar T0 = T0_->value(this->db().time().timeOutputValue()); const fvPatchVectorField& Up = patch().lookupPatchField<volVectorField, vector>(UName_); const fvsPatchField<scalar>& phip = patch().lookupPatchField<surfaceScalarField, scalar>(phiName_); const fvPatchField<scalar>& psip = patch().lookupPatchField<volScalarField, scalar>(psiName_); scalar gM1ByG = (gamma_ - 1.0)/gamma_; operator==(T0_/(1.0 + 0.5*psip*gM1ByG*(1.0 - pos(phip))*magSqr(Up))); fixedValueFvPatchScalarField::updateCoeffs(); } scalarField T0_; to autoPtr<Function1<scalar>> T0_; like its done in uniformTotalPressure or uniformFixedValue. The error appeared right after that. Does anyone know what I did wrong? Kind regards, shock77 |
|
May 19, 2020, 10:28 |
|
#2 |
Member
Join Date: Dec 2018
Location: Darmstadt, Germany
Posts: 87
Rep Power: 7 |
Hey,
the problem is that you are using T0_ in your equation, which is an autoPtr to a Function1<scalar> object. Clearly, dividing a scalarField with another field is something that I can imagine would work. Without looking at code, I doubt that the other type (Function1<scalar>) is something that can be used in any mathematical operation. I guess it is just a typo and you would like to have T0 instead of T0_ in your equation. Best regards RP |
|
May 19, 2020, 13:07 |
|
#3 |
Senior Member
Join Date: Dec 2019
Posts: 215
Rep Power: 7 |
Hi raumpolizei,
thank you very much, that was the issue! I have copied it from totalTemperaturefVPatchField.C and didnt change it. After that it compiled without any troubles. Unfortunately I couldnt run a case after that, because I got the error of an "undefined symbol". I have found the symbol, but I dont know how to fix that. Thats why I have deletet my BC and hit wclean and wmake. That didnt solve the error. After that I thought I should recompile the solver, went to opt/openfoam4 and hit ./Allwmake. Unfortunately nothing is workingnow. Not a single solver is recognized anymore. Is there any better way to recompile openfoam, besides deleting the folder and install everything from scratch? Kind regards, shock77 |
|
May 19, 2020, 14:15 |
|
#4 |
Member
Join Date: Dec 2018
Location: Darmstadt, Germany
Posts: 87
Rep Power: 7 |
Feeling with you, most of the people here went through this . Generally, it is a good idea to have a user folder where all your own libraries, applications and utilities are placed so that the original OpenFOAM installation is left unchanged. You can then link your OpenFOAM installation to your own libraries and use them in your own applications. If you search you should be able to findfind a lot of tutorials on that. Good luck!
RP |
|
May 19, 2020, 17:56 |
|
#5 |
Senior Member
Join Date: Dec 2019
Posts: 215
Rep Power: 7 |
Hi RP,
thanks for your kind help and advice! I did like you suggested and actually succeeded. First I have managed to make openfoam run again. After that I have created a folder (myCode) for my modifications in opt/openfoam4/applications/myCode. Here I have created my new boundary condition and compiled it without any errors. If I run wmake libso again, I get that everything is up to date. So far so good. After that I wanted to try to use my BC. Unfortunately it is not recognized: Code:
--> FOAM FATAL IO ERROR: Unknown patchField type uniformTotalTemperature for patch type patch Valid patchField types are : 111 ( advective alphatJayatillekeWallFunction atmBoundaryLayerInletEpsilon atmBoundaryLayerInletK calculated codedFixedValue codedMixed compressible::alphatJayatillekeWallFunction compressible::alphatWallFunction compressible::thermalBaffle1D<hConstSolidThermoPhysics> compressible::thermalBaffle1D<hPowerSolidThermoPhysics> compressible::turbulentHeatFluxTemperature compressible::turbulentTemperatureCoupledBaffleMixed compressible::turbulentTemperatureRadCoupledMixed convectiveHeatTransfer cyclic cyclicACMI cyclicAMI cyclicSlip directionMixed empty energyJump energyJumpAMI epsilonLowReWallFunction epsilonWallFunction externalCoupled externalCoupledTemperature externalWallHeatFluxTemperature extrapolatedCalculated fWallFunction fan fanPressure fixedEnergy fixedFluxExtrapolatedPressure fixedFluxPressure fixedGradient fixedInternalValue fixedJump fixedJumpAMI fixedMean fixedPressureCompressibleDensity fixedProfile fixedRho fixedUnburntEnthalpy fixedValue freestream freestreamPressure gradientEnergy gradientUnburntEnthalpy inletOutlet inletOutletTotalTemperature kLowReWallFunction kqRWallFunction mapped mappedField mappedFixedInternalValue mappedFixedPushedInternalValue mixed mixedEnergy mixedFixedValueSlip mixedUnburntEnthalpy nonuniformTransformCyclic nutLowReWallFunction nutTabulatedWallFunction nutURoughWallFunction nutUSpaldingWallFunction nutUWallFunction nutkAtmRoughWallFunction nutkRoughWallFunction nutkWallFunction omegaWallFunction outletInlet outletMappedUniformInlet partialSlip phaseHydrostaticPressure plenumPressure porousBafflePressure prghPressure prghTotalHydrostaticPressure prghTotalPressure processor processorCyclic rotatingTotalPressure sliced slip smoluchowskiJumpT symmetry symmetryPlane syringePressure timeVaryingMappedFixedValue totalFlowRateAdvectiveDiffusive totalPressure totalTemperature turbulentInlet turbulentIntensityKineticEnergyInlet turbulentMixingLengthDissipationRateInlet turbulentMixingLengthFrequencyInlet uniformDensityHydrostaticPressure uniformFixedGradient uniformFixedValue uniformInletOutlet uniformJump uniformJumpAMI uniformTotalPressure v2WallFunction variableHeightFlowRate wallHeatTransfer waveSurfacePressure waveTransmissive wedge zeroGradient ) file: /home/test2/0/T.boundaryField.inlet from line 26 to line 32. From function static Foam::tmp<Foam::fvPatchField<Type> > Foam::fvPatchField<Type>::New(const Foam::fvPatch&, const Foam::DimensionedField<Type, Foam::volMesh>&, const Foam::dictionary&) [with Type = double] in file /opt/openfoam4/src/finiteVolume/lnInclude/fvPatchFieldNew.C at line 134. FOAM exiting libs ( "libmyBoundaryConditions.so" "libfieldFunctionObjects.so" ); The first one is my new created BC lib. I have a make folder with edited files und options: files: Code:
uniformTotalTemperature/uniformTotalTemperatureFvPatchScalarField.C LIB = $(FOAM_USER_LIBBIN)/libmyBoundaryConditions Code:
EXE_INC = \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude LIB_LIBS = \ -lmeshTools \ -lfiniteVolume Do you have any idea what might be the problem? Kind regards, shock77 |
|
May 20, 2020, 08:52 |
|
#6 |
Senior Member
Join Date: Dec 2019
Posts: 215
Rep Power: 7 |
Hello everyone,
so I have noticed, that the library, which I have added in the controlDict, is not found: Code:
--> FOAM Warning : From function void* Foam::dlOpen(const Foam::fileName&, bool) in file POSIX.C at line 1037 dlopen error : libmyBoundaryConditions.so: cannot open shared object file: No such file or directory --> FOAM Warning : From function bool Foam::dlLibraryTable::open(const Foam::fileName&, bool) in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 97 could not load "libmyBoundaryConditions.so" Create mesh for time = 0 Code:
-I$(FOAM_USER_LIBBIN) \ Code:
echo $FOAM_USER_LIBBIN /root/OpenFOAM/root-4.1/platforms/linux64GccDPInt32Opt/lib Code:
echo $LD_LIBRARY_PATH /opt/ThirdParty-4.1/platforms/linux64Gcc/gperftools-svn/lib:/opt/paraviewopenfoam50/lib/paraview-5.0:/opt/openfoam4/platforms/linux64GccDPInt32Opt/lib/openmpi-system:/opt/ThirdParty-4.1/platforms/linux64GccDPInt32/lib/openmpi-system:/usr/lib/openmpi/lib:/root/OpenFOAM/root-4.1/platforms/linux64GccDPInt32Opt/lib:/opt/site/4.1/platforms/linux64GccDPInt32Opt/lib:/opt/openfoam4/platforms/linux64GccDPInt32Opt/lib:/opt/ThirdParty-4.1/platforms/linux64GccDPInt32/lib:/opt/openfoam4/platforms/linux64GccDPInt32Opt/lib/dummy Does anyone had the same problem or/and know how to solve this? Kind regards, shock77 |
|
May 20, 2020, 16:27 |
|
#7 |
Senior Member
Join Date: Dec 2019
Posts: 215
Rep Power: 7 |
I have found the mistake.
Interestingly I did the mistake in the sourcefile of my new boundary condition uniformTotalTemperature. After resolving it, the library has been found. It was somehow misleading, but in the end it runs. Thanks again for the help. Kind regards, shock77 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Errno = 1 in OpenFOAM | rfiore1 | OpenFOAM Bugs | 2 | November 1, 2022 17:35 |
[ANSYS Meshing] Match Control, is this weird or am I stupid? | Moufle | ANSYS Meshing & Geometry | 2 | November 18, 2015 16:00 |
createPatch Segmentation Fault (CORE DUMPED) | sam.ho | OpenFOAM Pre-Processing | 2 | April 21, 2014 02:01 |
Match Control and Symmetry Boundary Condtions in a quasi 2D calculation | peterputer | ANSYS Meshing & Geometry | 0 | May 15, 2012 08:53 |
gmsh2ToFoam | sarajags_89 | OpenFOAM | 0 | November 24, 2009 22:50 |