|
[Sponsors] |
April 12, 2022, 09:31 |
Compiling waves2Foam for OF8
|
#1 |
New Member
Kai Siebo
Join Date: Mar 2022
Posts: 12
Rep Power: 4 |
Hey everyone,
the Institute I work at wants to use the waves2Foam toolbox for wave generation together with OpenFOAM 8, and it is my duty to do it. Has anyone done this before? My approach is to just try to compile waves2Foam and then go through the output of the terminal to find the errors and correct them. Currently I'm stuck on this error: Code:
waveTheories/externalWaveForcing/oceanWave3D/oceanWave3D.C:511:53: error: passing ‘const Internal’ {aka ‘const Foam::DimensionedField<double, Foam::surfaceMesh>’} as ‘this’ argument discards qualifiers [-fpermissive] 511 | phi.internalField() = phiTemp.internalField(); | ^ In file included from /opt/openfoam8/src/OpenFOAM/lnInclude/DimensionedField.H:389, from /opt/openfoam8/src/finiteVolume/lnInclude/fvMesh.H:58, from lnInclude/externalWaveForcing.H:44, from waveTheories/externalWaveForcing/oceanWave3D/oceanWave3D.H:43, from waveTheories/externalWaveForcing/oceanWave3D/oceanWave3D.C:27: Code:
find $WM_PROJECT_DIR oceanWave3D.C The second problem is that I don't fully understand this error. I looked up the API guide ( https://www.openfoam.com/documentati...onedField.html ) and my explanation for this error so far is that some function tries to change a variable that was declared as constant. Since I can't find the filde oceanWave3D.C I can't see which function that is... So I'm a little bit lost here. Kind regards Siebo |
|
April 13, 2022, 06:37 |
|
#2 |
New Member
Kai Siebo
Join Date: Mar 2022
Posts: 12
Rep Power: 4 |
Today I finally managed to find the file oceanWave3D.C in the $WAVES_DIR/applications/utilties/.../externalWaveForcing directory. The fix is way more simpler than I thought. Following the code snippet from oceanWave3D.C from line 500 to 515
Code:
// Map the phiTemp -> phi #if EXTBRANCH==1 phi.internalField() = phiTemp.internalField(); #elif OFPLUSBRANCH==1 #if OFVERSION<1706 phi.internalField() = phiTemp.internalField(); #else phi.ref() = phiTemp.internalField(); #endif #else #if OFVERSION<400 phi.internalField() = phiTemp.internalField(); #else phi.ref() = phiTemp.internalField(); #endif #endif Code:
#if OFVERSION<400 I think I will try out the bashrc solution first and will edit this post once done. EDIT: I changed the bashrc file in $WAVES_DIR/bin/ as follows: I deleted lines 26 to 31 and replaced it with the following code: Code:
# The vers_check part is for OpenFOAM versions 5 and later. At the time I implemented this it was done for OpenFOAM 8. vers_check=`echo $WM_PROJECT_VERSION` if [ $vers_check -ge 5 ] then if [ `uname` = "Darwin" ] then version=`echo $WM_PROJECT_VERSION"-0-0" | sed -e 's/\.x/-0/' -e 's/\./\'$'\n/g' -e 's/[v+-]/\'$'\n/g' | grep "[0-9]" | head -3 | tr -d '\n'` else version=`echo $WM_PROJECT_VERSION"-0-0" | sed -e 's/\.x/-0/' -e 's/\./\n/g' -e 's/[v+-]/\n/g' | grep "[0-9]" | head -3 | tr -d '\n'` fi else if [ `uname` = "Darwin" ] then version=`echo $WM_PROJECT_VERSION"-0" | sed -e 's/\.x/-0/' -e 's/\./\'$'\n/g' -e 's/[v+-]/\'$'\n/g' | grep "[0-9]" | head -3 | tr -d '\n'` else version=`echo $WM_PROJECT_VERSION"-0" | sed -e 's/\.x/-0/' -e 's/\./\n/g' -e 's/[v+-]/\n/g' | grep "[0-9]" | head -3 | tr -d '\n'` fi fi Last edited by Siebo; April 13, 2022 at 11:24. |
|
April 28, 2022, 13:43 |
|
#3 |
New Member
Kai Siebo
Join Date: Mar 2022
Posts: 12
Rep Power: 4 |
I decided to just document my proceedings on this project here, for other people that have similar problems or want to do the same.
The next error line that was generated when compiling with the new changes to the bashrc was as follows: Code:
waveTheories/externalWaveForcing/oceanWave3D/oceanWave3D.C: In member function ‘void Foam::waveTheories::oceanWave3D::updatePhi()’: waveTheories/externalWaveForcing/oceanWave3D/oceanWave3D.C:527:32: error: no match for ‘operator==’ (operand types are const Foam::fvsPatchField<double>’ and ‘const Foam::fvsPatchField<double>’) 527 | phi.boundaryField()[patchi] == phiTemp.boundaryField()[patchi]; In file included from /opt/openfoam8/src/finiteVolume/lnInclude/fvsPatchFields.H:34, from /opt/openfoam8/src/finiteVolume/lnInclude/surfaceFields.H:41, from /opt/openfoam8/src/finiteVolume/lnInclude/surfaceInterpolationScheme.C:28, from /opt/openfoam8/src/finiteVolume/lnInclude/surfaceInterpolationScheme.H:308, from /opt/openfoam8/src/finiteVolume/lnInclude/surfaceInterpolate.H:41, from /opt/openfoam8/src/finiteVolume/lnInclude/fvc.H:39, from /opt/openfoam8/src/finiteVolume/lnInclude/fvCFD.H:8, from lnInclude/crossVersionCompatibility.H:41, from lnInclude/externalWaveForcing.H:52, from waveTheories/externalWaveForcing/oceanWave3D/oceanWave3D.H:43, from waveTheories/externalWaveForcing/oceanWave3D/oceanWave3D.C:27: Code:
phi.boundaryField()[patchi] == phiTemp.boundaryField()[patchi]; Code:
phi.boundaryFieldRef()[patchi] == phiTemp.boundaryField()[patchi]; |
|
April 28, 2022, 13:49 |
|
#4 |
New Member
Kai Siebo
Join Date: Mar 2022
Posts: 12
Rep Power: 4 |
The next error was the following:
Code:
fvPatchFields/waveAlpha/waveAlphaFvPatchScalarField.C: In member function ‘virtual void Foam::waveAlphaFvPatchScalarField::write(Foam::Ostream&) const’: fvPatchFields/waveAlpha/waveAlphaFvPatchScalarField.C:325:22: error: ‘const class Foam::Field<double>’ has no member named ‘writeEntry’ 325 | this->refValue().writeEntry("refValue", os); | ^~~~~~~~~~ This was resolved by adopting the changed write syntax that was changed from OF6 to OF7. Together with a version comparison the following code was implemented in waveAlphaFvPatchScalarField.C from line 321 onwards Code:
// Write // Original Code //void waveAlphaFvPatchScalarField::write(Ostream& os) const //{ // fvPatchField<scalar>::write(os); // this->refValue().writeEntry("refValue", os); // this->refGrad().writeEntry("refGradient", os); // this->valueFraction().writeEntry("valueFraction", os); // this->writeEntry("value", os); //} //335 to 384 work in progress code for new syntax of OF8 #if EXTBRANCH==1 void waveAlphaFvPatchScalarField::write(Ostream& os) const { fvPatchField<scalar>::write(os); this->refValue().writeEntry("refValue", os); this->refGrad().writeEntry("refGradient", os); this->valueFraction().writeEntry("valueFraction", os); this->writeEntry("value", os); } #elif OFPLUSBRANCH==1 #if OFVERSION<1706 void waveAlphaFvPatchScalarField::write(Ostream& os) const { fvPatchField<scalar>::write(os); this->refValue().writeEntry("refValue", os); this->refGrad().writeEntry("refGradient", os); this->valueFraction().writeEntry("valueFraction", os); this->writeEntry("value", os); } #else void waveAlphaFvPatchScalarField::write(Ostream& os) const { fvPatchField<scalar>::write(os); this->refValue().writeEntry("refValue", os); this->refGrad().writeEntry("refGradient", os); this->valueFraction().writeEntry("valueFraction", os); this->writeEntry("value", os); } #endif #else #if OFVERSION>699 void waveAlphaFvPatchScalarField::write(Ostream& os) const { fvPatchField<scalar>::write(os); writeEntry(os,"refValue",refValue()); writeEntry(os,"refGradient",refGrad()); writeEntry(os,"valueFraction",valueFraction()); writeEntry(os,"value",*this); } #else void waveAlphaFvPatchScalarField::write(Ostream& os) const { fvPatchField<scalar>::write(os); this->refValue().writeEntry("refValue", os); this->refGrad().writeEntry("refGradient", os); this->valueFraction().writeEntry("valueFraction", os); this->writeEntry("value", os); } #endif #endif EDIT: Another error of the same kind occured, so for completeness of this thread I'm adding the fix here as well. The error: Code:
preProcessing/setWaveProperties/irregular/waveSpectra/waveSpectra.C: In member function ‘void Foam::waveSpectra::writeSpectrum(Foam::Ostream&, const scalarField&, const scalarField&) const’: preProcessing/setWaveProperties/irregular/waveSpectra/waveSpectra.C:102:11: error: ‘const scalarField’ {aka ‘const class Foam::Field<double>’} has no member named ‘writeEntry’ 102 | S.writeEntry("spectramValues", os); | ^~~~~~~~~~ preProcessing/setWaveProperties/irregular/waveSpectra/waveSpectra.C:105:14: error: ‘const scalarField’ {aka ‘const class Foam::Field<double>’} has no member named ‘writeEntry’ 105 | freq.writeEntry("fspectrum", os); | ^~~~~~~~~~ make: *** [/opt/openfoam8/wmake/rules/General/transform:26: Make/linux64GccDPInt32Opt/preProcessing/setWaveProperties/irregular/waveSpectra/waveSpectra.o] Error 1 Code:
//Original Code //S.writeEntry("spectramValues", os); //os << nl; //freq.writeEntry("fspectrum", os); //os << nl; #if EXTBRANCH==1 S.writeEntry("spectramValues", os); os << nl; freq.writeEntry("fspectrum", os); os << nl; #elif OFPLUSBRANCH==1 #if OFVERSION<1706 S.writeEntry("spectramValues", os); os << nl; freq.writeEntry("fspectrum", os); os << nl; #else S.writeEntry("spectramValues", os); os << nl; freq.writeEntry("fspectrum", os); os << nl; #endif #else #if OFVERSION>699 writeEntry(os,"spectramValues",S); os << nl; writeEntry(os,"fspectrum",freq); os << nl; #else S.writeEntry("spectramValues", os); os << nl; freq.writeEntry("fspectrum", os); os << nl; #endif #endif Last edited by Siebo; April 30, 2022 at 09:45. |
|
April 30, 2022, 11:44 |
|
#5 |
New Member
Kai Siebo
Join Date: Mar 2022
Posts: 12
Rep Power: 4 |
I also got this warning:
Code:
g++ -std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 -DNoRepository -ftemplate-depth-100 -DOFVERSION=800 -DEXTBRANCH=0 -DXVERSION=0 -DOFPLUSBRANCH=0 -I/opt/openfoam8/src/finiteVolume/lnInclude -I/opt/openfoam8/src/meshTools/lnInclude -I/opt/openfoam8/src/sampling/lnInclude -I/opt/openfoam8/src/lagrangian/basic/lnInclude -I/opt/openfoam8/src/fileFormats/lnInclude -I/home/kaihi/OpenFOAM/kaihi-8/applications/utilities/waves2Foam/src/waves2Foam/lnInclude -I/usr/include -IlnInclude -I. -I/opt/openfoam8/src/OpenFOAM/lnInclude -I/opt/openfoam8/src/OSspecific/POSIX/lnInclude -fPIC -c preProcessing/probes/pointDistributions/concatenatedDistribution/concatenatedDistribution.C -o Make/linux64GccDPInt32Opt/preProcessing/probes/pointDistributions/concatenatedDistribution/concatenatedDistribution.o In file included from preProcessing/probes/pointDistributions/concatenatedDistribution/concatenatedDistribution.C:27: preProcessing/probes/pointDistributions/concatenatedDistribution/concatenatedDistribution.H: In constructor ‘Foam::concatenatedDistribution::concatenatedDistribution(const Foam::dictionary&)’: preProcessing/probes/pointDistributions/concatenatedDistribution/concatenatedDistribution.H:63:20: warning: ‘Foam::concatenatedDistribution::ppS_’ will be initialized after [-Wreorder] 63 | pointField ppS_; | ^~~~ preProcessing/probes/pointDistributions/concatenatedDistribution/concatenatedDistribution.H:62:20: warning: ‘Foam::pointField Foam::concatenatedDistribution::ppE_’ [-Wreorder] 62 | pointField ppE_; | ^~~~ preProcessing/probes/pointDistributions/concatenatedDistribution/concatenatedDistribution.C:48:1: warning: when initialized here [-Wreorder] 48 | concatenatedDistribution::concatenatedDistribution | ^~~~~~~~~~~~~~~~~~~~~~~~ Code:
pointField ppS_; //original ppE_ pointField ppE_; //original ppS_ |
|
April 30, 2022, 12:54 |
|
#6 |
New Member
Kai Siebo
Join Date: Mar 2022
Posts: 12
Rep Power: 4 |
With the documented changes LAPACK-3.3.1, SPARSKIT2, OCEANWAVE3D, FENTON4FOAM and LIBRARY compiles without error. Next I need to fix the solvers and would be grateful for any kind of help. The output when compiling is as follows:
Code:
===================================== COMPILE SOLVERS ===================================== wmakeLnIncludeAll: running wmakeLnInclude on dependent libraries: wmakeLnInclude error: base directory /opt/openfoam8/src/transportModels/twoPhaseMixture/ does not exist wmakeLnInclude error: base directory /opt/openfoam8/src/transportModels/incompressible/ does not exist wmakeLnInclude error: base directory /opt/openfoam8/src/transportModels/interfaceProperties/ does not exist wmakeLnInclude error: base directory /opt/openfoam8/src/TurbulenceModels/turbulenceModels/ does not exist wmakeLnInclude error: base directory /opt/openfoam8/src/TurbulenceModels/incompressible/ does not exist wmakeLnInclude error: base directory /opt/openfoam8/src/transportModels/immiscibleIncompressibleTwoPhaseMixture/ does not exist g++ -std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam8/src/transportModels/twoPhaseMixture/lnInclude -I/opt/openfoam8/src/transportModels -I/opt/openfoam8/src/transportModels/incompressible/lnInclude -I/opt/openfoam8/src/transportModels/interfaceProperties/lnInclude -I/opt/openfoam8/src/TurbulenceModels/turbulenceModels/lnInclude -I/opt/openfoam8/src/TurbulenceModels/incompressible/lnInclude -I/opt/openfoam8/src/transportModels/immiscibleIncompressibleTwoPhaseMixture/lnInclude -I/opt/openfoam8/src/finiteVolume/lnInclude -I/opt/openfoam8/src/meshTools/lnInclude -I/opt/openfoam8/src/sampling/lnInclude -DOFVERSION=400 -DEXTBRANCH=0 -DXVERSION=0 -DOFPLUSBRANCH=0 -I/home/kaihi/OpenFOAM/kaihi-8/applications/utilities/waves2Foam/src/waves2Foam/lnInclude -I/usr/include -IlnInclude -I. -I/opt/openfoam8/src/OpenFOAM/lnInclude -I/opt/openfoam8/src/OSspecific/POSIX/lnInclude -fPIC -c waveFoam.C -o Make/linux64GccDPInt32Opt/waveFoam.o waveFoam.C:46:10: fatal error: immiscibleIncompressibleTwoPhaseMixture.H: No such file or directory 46 | #include "immiscibleIncompressibleTwoPhaseMixture.H" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. make: *** [/opt/openfoam8/wmake/rules/General/transform:26: Make/linux64GccDPInt32Opt/waveFoam.o] Error 1 The relinking of libraries is done so far, the complete options file in $WAVES_DIR/applications/solvers/solvers800/waveFoam/Make/options now looks like this Code:
EXE_INC = \ -I$(LIB_SRC)/twoPhaseModels/twoPhaseMixture/lnInclude \ -I$(LIB_SRC)/transportModels/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/incompressibleTwoPhaseMixture/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/interfaceProperties/lnInclude \ -I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \ -I$(LIB_SRC)/MomentumTransportModels/incompressible/lnInclude \ -I$(LIB_SRC)/twoPhaseModels/immiscibleIncompressibleTwoPhaseMixture/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude \ -DOFVERSION=800 \ -DEXTBRANCH=0 \ -DXVERSION=$(WAVES_XVERSION) \ -DOFPLUSBRANCH=0 \ -I$(WAVES_SRC)/waves2Foam/lnInclude \ -I$(WAVES_GSL_INCLUDE) EXE_LIBS = \ -limmiscibleIncompressibleTwoPhaseMixture \ -lturbulenceModels \ -lincompressibleTurbulenceModels \ -lfiniteVolume \ -lfvOptions \ -lmeshTools \ -lsampling \ -L$(WAVES_LIBBIN) \ -lwaves2Foam \ -L$(WAVES_GSL_LIB) \ -lgsl \ -lgslcblas Last edited by Siebo; May 4, 2022 at 07:58. |
|
May 12, 2022, 07:59 |
|
#7 |
New Member
Kai Siebo
Join Date: Mar 2022
Posts: 12
Rep Power: 4 |
Hey everyone, the next errors were mainly syntax problems or version updates of code files.
First the following error occured: Code:
waveFoam.C:47:10: fatal error: turbulentTransportModel.H: No such file or directory 47 | #include "turbulentTransportModel.H" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ Code:
#include "momentumTransportModel.H" After fixing that, I got a series of errors from createFields.H Code:
In file included from /opt/openfoam8/src/OpenFOAM/lnInclude/postProcess.H:105, from waveFoam.C:61: ./createFields.H: In function ‘int main(int, char**)’: ./createFields.H:77:9: error: ‘incompressible’ was not declared in this scope 77 | autoPtr<incompressible::turbulenceModel> turbulence | ^~~~~~~~~~~~~~ in createFields.H line 47: Code:
autoPtr<incompressible::momentumTransportModel> turbulence Code:
#include "kinematicMomentumTransportModel.H" After that a series of errors with correctPhi.H occured Code:
In file included from waveFoam.C:74: correctPhi.H: In function ‘int main(int, char**)’: correctPhi.H:9:1: error: no matching function for call to ‘CorrectPhi(Foam::volVectorField&, Foam::surfaceScalarField&, Foam::volScalarField&, Foam::dimensionedScalar, Foam::geometricZeroField, Foam::pimpleControl&)’ 9 | ); | ^ Code:
#include "CorrectPhi.H" //originally #include "correctPhi.H" Code:
alphaEqn.H:48:37: error: ‘class Foam::immiscibleIncompressibleTwoPhaseMixture’ has no member named ‘cAlpha’ 48 | surfaceScalarField phic(mixture.cAlpha()*mag(phi/mesh.magSf())); | ^~~~~~ alphaEqn.H:51:9: error: ‘icAlpha’ was not declared in this scope; did you mean ‘isalpha’? 51 | if (icAlpha > 0) | ^~~~~~~ | isalpha Code:
cp /opt/openfoam8/applications/solvers/multiphase/interFoam/alphaEqn.H /home/kaihi/OpenFOAM/kaihi-8/applications/utilities/waves2Foam/applications/solvers/solvers800/waveFoam/ cp /opt/openfoam8/applications/solvers/multiphase/interFoam/alphaEqnSubCycle.H /home/kaihi/OpenFOAM/kaihi-8/applications/utilities/waves2Foam/applications/solvers/solvers800/waveFoam/ cp /opt/openfoam8/applications/solvers/multiphase/interFoam/alphaSuSp.H /home/kaihi/OpenFOAM/kaihi-8/applications/utilities/waves2Foam/applications/solvers/solvers800/waveFoam/ cp /opt/openfoam8/applications/solvers/multiphase/interFoam/rhofs.H /home/kaihi/OpenFOAM/kaihi-8/applications/utilities/waves2Foam/applications/solvers/solvers800/waveFoam/ cp /opt/openfoam8/src/twoPhaseModels/twoPhaseMixture/VoF/createAlphaFluxes.H /home/kaihi/OpenFOAM/kaihi-8/applications/utilities/waves2Foam/applications/solvers/solvers800/waveFoam/ Code:
#include "createAlphaFluxes.H" The next error was the following: Code:
In file included from waveFoam.C:121: UEqn.H: In function ‘int main(int, char**)’: UEqn.H:7:21: error: ‘class Foam::IncompressibleMomentumTransportModel<Foam::transportModel>’ has no member named ‘divDevRhoReff’ 7 | + turbulence->divDevRhoReff(rho, U) | ^~~~~~~~~~~~~ Code:
+ turbulence->divDevTau(rho, U) After that an error with the pressure equation occured as well: Code:
In file included from waveFoam.C:126: pEqn.H: In function ‘int main(int, char**)’: pEqn.H:38:29: error: ‘class Foam::fvMesh’ has no member named ‘solver’; did you mean ‘Foam::dictionary Foam::solution::solvers_’? (not accessible from this context) 38 | p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter()))); | ^~~~~~ In file included from /opt/openfoam8/src/finiteVolume/lnInclude/fvSolution.H:37, from /opt/openfoam8/src/finiteVolume/lnInclude/fvMesh.H:56, from /opt/openfoam8/src/finiteVolume/lnInclude/fvCFD.H:7, from waveFoam.C:40: Code:
p_rghEqn.solve(); // originally p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter()))); |
|
May 12, 2022, 08:06 |
|
#8 |
New Member
Kai Siebo
Join Date: Mar 2022
Posts: 12
Rep Power: 4 |
The current error I am stuck with is the following:
Code:
g++ -std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam8/src/twoPhaseModels/twoPhaseMixture/lnInclude -I/opt/openfoam8/src/transportModels/lnInclude -I/opt/openfoam8/src/twoPhaseModels/incompressibleTwoPhaseMixture/lnInclude -I/opt/openfoam8/src/twoPhaseModels/interfaceProperties/lnInclude -I/opt/openfoam8/src/MomentumTransportModels/momentumTransportModels/lnInclude -I/opt/openfoam8/src/MomentumTransportModels/incompressible/lnInclude -I/opt/openfoam8/src/twoPhaseModels/immiscibleIncompressibleTwoPhaseMixture/lnInclude -I/opt/openfoam8/src/finiteVolume/lnInclude -I/opt/openfoam8/src/meshTools/lnInclude -I/opt/openfoam8/src/sampling/lnInclude -DOFVERSION=800 -DEXTBRANCH=0 -DXVERSION=0 -DOFPLUSBRANCH=0 -I/home/kaihi/OpenFOAM/kaihi-8/applications/utilities/waves2Foam/src/waves2Foam/lnInclude -I/usr/include -IlnInclude -I. -I/opt/openfoam8/src/OpenFOAM/lnInclude -I/opt/openfoam8/src/OSspecific/POSIX/lnInclude -fPIC -fuse-ld=bfd -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPInt32Opt/waveFoam.o -L/opt/openfoam8/platforms/linux64GccDPInt32Opt/lib \ -limmiscibleIncompressibleTwoPhaseMixture -lturbulenceModels -lincompressibleTurbulenceModels -lfiniteVolume -lfvOptions -lmeshTools -lsampling -L/home/kaihi/OpenFOAM/kaihi-8/platforms/linux64GccDPInt32Opt/lib -lwaves2Foam -L/usr/lib64 -lgsl -lgslcblas -lOpenFOAM -ldl \ -lm -o /home/kaihi/OpenFOAM/kaihi-8/platforms/linux64GccDPInt32Opt/bin/waveFoam /usr/bin/ld.bfd: cannot find -lturbulenceModels /usr/bin/ld.bfd: cannot find -lincompressibleTurbulenceModels collect2: error: ld returned 1 exit status make: *** [/opt/openfoam8/wmake/makefiles/general:142: /home/kaihi/OpenFOAM/kaihi-8/platforms/linux64GccDPInt32Opt/bin/waveFoam] Error 1 fixed by changing line 21 and line 22 of file /home/kaihi/OpenFOAM/kaihi-8/applications/utilities/waves2Foam/applications/solvers/solvers800/waveFoam/Make/options Code:
-lmomentumTransportModels \ -lincompressibleMomentumTransportModels \ Last edited by Siebo; May 16, 2022 at 12:06. |
|
May 16, 2022, 12:50 |
|
#9 |
New Member
Kai Siebo
Join Date: Mar 2022
Posts: 12
Rep Power: 4 |
So with the steps documented above, wave2foam compiles without error messages. Next I will try to get a wave2foam tutorial case to work on OF8. For that I will use the simplest case of a standing wave which is found in $WAVES_DIR/tutorials/waveFoam/standingWave
just trying to run this from scratch yields the following: Code:
> blockMesh Code:
> setWaveParameters Code:
> setWaveField Code:
kaihi@DESKTOP-LRQENFN:~/OpenFOAM/kaihi-8/run/standingWave$ setWaves /*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 8 \\/ M anipulation | \*---------------------------------------------------------------------------*/ Build : 8-1c9b5879390b Exec : setWaves Date : May 16 2022 Time : 17:18:20 Host : "DESKTOP-LRQENFN" PID : 5212 I/O : uncollated Case : /home/kaihi/OpenFOAM/kaihi-8/run/standingWave nProcs : 1 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10) allowSystemOperations : Allowing user-supplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0 --> FOAM FATAL ERROR: cannot find file "/home/kaihi/OpenFOAM/kaihi-8/run/standingWave/system/fvSchemes" From function virtual Foam::autoPtr<Foam::ISstream> Foam::fileOperations::uncollatedFileOperation::readStream(Foam::regIOobject&, const Foam::fileName&, const Foam::word&, bool) const in file global/fileOperations/uncollatedFileOperation/uncollatedFileOperation.C at line 538. FOAM exiting Code:
U { solver PBiCG; preconditioner DILU; tolerance 1e-09; relTol 0; }; Now I can use setWaveField without errors. The waveFoam command starts the calculation and runs just fine So now we are finally done with porting waves2foam to OF8, I hope me documenting the steps will help someone in the future Last edited by Siebo; May 18, 2022 at 08:04. |
|
November 26, 2022, 11:06 |
|
#10 |
New Member
Lige Zhao
Join Date: Nov 2022
Posts: 2
Rep Power: 0 |
hello,Siebo, thanks for your sharing.
I also met errors when complied waves2Foam with OpenFOAM1912 using Ubuntu virtual system on Windows. when I complie the "OceanWav3D" in "ThirdParty" folder, I met the error: Type mismatch between actual argument at (1) and actual argument at (2) (INTEGER(4)/REAL(8)). make: *** [makefile:138:ORDERINGS/ccn.o] error 1 mv:'libskit_gfortran.a' folder state (stat): No such file or directory Do you have any idea of this error? really appreciate any suggestions. |
|
January 4, 2023, 06:07 |
|
#11 | |
New Member
Kai Siebo
Join Date: Mar 2022
Posts: 12
Rep Power: 4 |
Quote:
Hey Lige, sorry for the late reply. If you still have problems with compiling waves2Foam check out this post: waves2Foam on an Ubuntu 18.04 with OpenFOAM 1712 I hope it helps. Kind regards Siebo |
||
Tags |
of8, openfoam 8, waves2foam |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[foam-extend.org] Error in Compiling waves2foam with foam-extend4.0 | sayed786 | OpenFOAM Installation | 0 | March 14, 2020 04:06 |
[waves2Foam] Compiling Waves2Foam r2137 error: no matching function for call to ‘exp(Foam::complex | Marc_H | OpenFOAM Community Contributions | 0 | March 5, 2020 11:54 |
[waves2Foam] stuck in compiling the waves2Foam library for OF-v1712 due to MA41 | Ya_Squall2010 | OpenFOAM Community Contributions | 3 | April 16, 2019 09:21 |
waves2foam compiling | yapalparvi | OpenFOAM Running, Solving & CFD | 0 | May 9, 2015 22:02 |
[waves2Foam] Compiling problem for waveDyMFoam of waves2Foam in OF 2.3.0 | ashkan | OpenFOAM Community Contributions | 3 | December 13, 2014 01:31 |