|
[Sponsors] |
How to implement reconCentral in Openfoam1812 |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 22, 2020, 05:10 |
How to implement reconCentral in Openfoam1812
|
#1 |
Member
Join Date: Dec 2018
Posts: 75
Rep Power: 7 |
I tried to implement a limitedscheme reconCentral from foam extend 4.0 (foam40/src/finiteVolume/interpolation/surfaceInterpolation/limitedScheme) to openFoam v1812. But when i tried to compile the code i get this error :
Code:
Making dependency list for source file reconCentral.C g++ -std=c++11 -m64 -DOPENFOAM=1812 -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 -Wno-unknown-pragmas -O3 -DNoRepository -ftemplate-depth-100 -I/opt/apps/OpenFOAM/OpenFOAM-v1812/src/finiteVolume/lnInclude -I/opt/apps/OpenFOAM/OpenFOAM-v1812/src/meshTools/lnInclude -IlnInclude -I. -I/opt/apps/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude -I/opt/apps/OpenFOAM/OpenFOAM-v1812/src/OSspecific/POSIX/lnInclude -fPIC -c reconCentral.C -o Make/linux64GccDPInt32Opt/reconCentral.o reconCentral.C: In member function âvirtual Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> > Foam::reconCentral<Type>::interpolate(const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&) constâ: reconCentral.C:97:15: error: âunallocLabelListâ does not name a type const unallocLabelList& pOwner = p.faceCells(); ^ In file included from /opt/apps/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude/UList.H:51:0, from /opt/apps/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude/List.H:43, from /opt/apps/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude/wordList.H:48, from /opt/apps/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude/Enum.H:40, from /opt/apps/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude/IOobject.H:79, from /opt/apps/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude/regIOobject.H:41, from /opt/apps/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude/GeometricField.H:42, from /opt/apps/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude/GeometricScalarField.H:38, from /opt/apps/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude/GeometricFields.H:34, from /opt/apps/OpenFOAM/OpenFOAM-v1812/src/finiteVolume/lnInclude/volFields.H:37, from reconCentral.C:25: reconCentral.C:114:20: error: âpOwnerâ was not declared in this scope forAll(pOwner, facei) ^ /opt/apps/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude/stdFoam.H:285:30: note: in definition of macro âforAllâ for (Foam::label i=0; i<(list).size(); ++i) ^ reconCentral.C:143:20: error: âpOwnerâ was not declared in this scope forAll(pOwner, facei) ^ /opt/apps/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude/stdFoam.H:285:30: note: in definition of macro âforAllâ for (Foam::label i=0; i<(list).size(); ++i) ^ reconCentral.C: In instantiation of âFoam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> > Foam::reconCentral<Type>::interpolate(const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&) const [with Type = Foam::Vector<double>]â: reconCentral.C:200:1: required from here reconCentral.C:58:64: error: invalid initialization of reference of type âFoam::GeometricField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh>&â from expression of type âconst Foam::GeometricField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh>â GeometricField<Type, fvsPatchField, surfaceMesh>& sf = tsf(); ^ reconCentral.C:74:42: error: invalid initialization of reference of type âFoam::Field<Foam::Vector<double> >&â from expression of type âconst Internal {aka const Foam::DimensionedField<Foam::Vector<double>, Foam::surfaceMesh>}â Field<Type>& sfIn = sf.internalField(); ^ reconCentral.C:89:33: error: no type named âGeometricBoundaryFieldâ in âclass Foam::GeometricField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh>â GeometricBoundaryField& bSf = sf.boundaryField(); ^ reconCentral.C:89:33: error: no type named âGeometricBoundaryFieldâ in âclass Foam::GeometricField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh>â reconCentral.C:89:33: error: no type named âGeometricBoundaryFieldâ in âclass Foam::GeometricField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh>â reconCentral.C: In instantiation of âFoam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> > Foam::reconCentral<Type>::interpolate(const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&) const [with Type = double]â: reconCentral.C:200:1: required from here reconCentral.C:58:64: error: invalid initialization of reference of type âFoam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>&â from expression of type âconst Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>â GeometricField<Type, fvsPatchField, surfaceMesh>& sf = tsf(); ^ reconCentral.C:74:42: error: invalid initialization of reference of type âFoam::Field<double>&â from expression of type âconst Internal {aka const Foam::DimensionedField<double, Foam::surfaceMesh>}â Field<Type>& sfIn = sf.internalField(); ^ reconCentral.C:89:33: error: no type named âGeometricBoundaryFieldâ in âclass Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>â GeometricBoundaryField& bSf = sf.boundaryField(); ^ reconCentral.C:89:33: error: no type named âGeometricBoundaryFieldâ in âclass Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>â reconCentral.C:89:33: error: no type named âGeometricBoundaryFieldâ in âclass Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>â make: *** [Make/linux64GccDPInt32Opt/reconCentral.o] Error 1 Thanks for every response ! |
|
June 22, 2020, 07:18 |
|
#2 |
Senior Member
Join Date: Dec 2019
Location: Cologne, Germany
Posts: 369
Rep Power: 8 |
read the error code:
reconCentral.C:97:15: error: âunallocLabelListâ does not name a type const unallocLabelList& pOwner = p.faceCells(); obviously, openfoam v1812 doesn't recognize unallocLabelList. replace it with labelUList&. |
|
June 22, 2020, 10:31 |
|
#3 |
Member
Join Date: Dec 2018
Posts: 75
Rep Power: 7 |
Thanks for your response, i fixed some of the wrong parts, thanks to you!
But now, i got the error at the below. Since i dont know c++, i cant figure out. Could you help me with this too ? Error message : Code:
wmakeLnInclude: linking include files to ./lnInclude Making dependency list for source file reconCentral.C g++ -std=c++11 -m64 -DOPENFOAM=1812 -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 -Wno-unknown-pragmas -O3 -DNoRepository -ftemplate-depth-100 -I/opt/apps/OpenFOAM/OpenFOAM-v1812/src/finiteVolume/lnInclude -I/opt/apps/OpenFOAM/OpenFOAM-v1812/src/meshTools/lnInclude -IlnInclude -I. -I/opt/apps/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude -I/opt/apps/OpenFOAM/OpenFOAM-v1812/src/OSspecific/POSIX/lnInclude -fPIC -c reconCentral.C -o Make/linux64GccDPInt32Opt/reconCentral.o In file included from reconCentral.C:25:0: reconCentral.H:149:73: error: expected â;â at end of member declaration interpolate(const GeometricField<Type, fvPatchField, volMesh>&) const ^ reconCentral.C:36:1: error: prototype for âFoam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> > Foam::reconCentral<Type>::interpolate(const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)â does not match any in class âFoam::reconCentral<Type>â Foam::reconCentral<Type>::interpolate ^ In file included from reconCentral.C:25:0: reconCentral.H:149:9: error: candidate is: virtual Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> > Foam::reconCentral<Type>::interpolate(const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&) const interpolate(const GeometricField<Type, fvPatchField, volMesh>&) const ^ make: *** [Make/linux64GccDPInt32Opt/reconCentral.o] Error 1 Code:
// Member Functions //- Return the face-interpolate of the given cell field // with explicit correction virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh>> interpolate(const GeometricField<Type, fvPatchField, volMesh>&) const //- Return true if this scheme uses an explicit correction virtual bool corrected() const { return true; } //- Return the explicit correction to the face-interpolate virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh>> correction ( const GeometricField<Type, fvPatchField, volMesh>& vf ) const; }; Code:
template<class Type> Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh>> Foam::reconCentral<Type>::interpolate |
|
June 23, 2020, 06:24 |
|
#4 |
Senior Member
Join Date: Dec 2019
Location: Cologne, Germany
Posts: 369
Rep Power: 8 |
related part in .H:
Code:
// Member Functions //- Return the face-interpolate of the given cell field // with explicit correction virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh>> interpolate(const GeometricField<Type, fvPatchField, volMesh>&) const; //- Return true if this scheme uses an explicit correction virtual bool corrected() const { return true; } //- Return the explicit correction to the face-interpolate virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh>> correction ( const GeometricField<Type, fvPatchField, volMesh>& vf ) const; }; please check the code above. |
|
June 24, 2020, 04:19 |
|
#5 | |
Member
Join Date: Dec 2018
Posts: 75
Rep Power: 7 |
Quote:
What i was trying to say , Do you see anything that makes no sense in C++ because it is still not compiled. I attached the .C and .H files if you might check. |
||
June 24, 2020, 05:44 |
|
#6 |
Senior Member
Join Date: Dec 2019
Location: Cologne, Germany
Posts: 369
Rep Power: 8 |
i can't really judge if everything is ok, bc openFOAM is a really large library and i don't know each class and function.
when i try to modify something in OF, i usually try to fix every error code output in the terminal. it can be really time consuming. in your case, you try to implement something from OF extend to OF v1812. as you already posted earlier, there was a class in the extend version which was named differently in v1812. so it would be wise if you would follow each error output and fix everything step by step instead of looking at each code line. why does it not compile? is there any error-message? what is the terminal output? |
|
June 24, 2020, 07:19 |
|
#7 | |
Member
Join Date: Dec 2018
Posts: 75
Rep Power: 7 |
Quote:
Here is what the terminal gave : Code:
wmakeLnInclude: linking include files to ./lnInclude Making dependency list for source file reconCentral.C g++ -std=c++11 -m64 -DOPENFOAM=1812 -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 -Wno-unknown-pragmas -O3 -DNoRepository -ftemplate-depth-100 -I/opt/apps/OpenFOAM/OpenFOAM-v1812/src/finiteVolume/lnInclude -I/opt/apps/OpenFOAM/OpenFOAM-v1812/src/meshTools/lnInclude -IlnInclude -I. -I/opt/apps/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude -I/opt/apps/OpenFOAM/OpenFOAM-v1812/src/OSspecific/POSIX/lnInclude -fPIC -c reconCentral.C -o Make/linux64GccDPInt32Opt/reconCentral.o reconCentral.C:36:1: error: prototype for âFoam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> > Foam::reconCentral<Type>::interpolate(const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&)â does not match any in class âFoam::reconCentral<Type>â Foam::reconCentral<Type>::interpolate ^ In file included from reconCentral.C:25:0: reconCentral.H:150:9: error: candidate is: virtual Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> > Foam::reconCentral<Type>::interpolate(const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&) const interpolate(const GeometricField<Type, fvPatchField, volMesh>&) const; ^ make: *** [Make/linux64GccDPInt32Opt/reconCentral.o] Error 1 |
||
June 25, 2020, 04:02 |
|
#8 |
Senior Member
Join Date: Dec 2019
Location: Cologne, Germany
Posts: 369
Rep Power: 8 |
your .H-file lines 149-150:
Code:
virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh>> interpolate(const GeometricField<Type, fvPatchField, volMesh>&) const; Code:
template<class Type> Foam::tmp<Foam::reconCentral<Type>> //Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh>> Foam::reconCentral<Type>::New ( const GeometricField<Type, fvPatchField, surfaceMesh>&, const GeometricField<Type, fvPatchField, volMesh>& vf ) the correct substitution should be: Code:
template<class Type> Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> > Foam::reconCentral<Type>::interpolate ( const GeometricField<Type, fvPatchField, volMesh>& vf ) const |
|
June 25, 2020, 09:17 |
|
#9 | |
Member
Join Date: Dec 2018
Posts: 75
Rep Power: 7 |
Quote:
|
||
June 26, 2020, 06:33 |
|
#10 |
Senior Member
Join Date: Dec 2019
Location: Cologne, Germany
Posts: 369
Rep Power: 8 |
can you please upload your correct .H and .C files.
|
|
June 29, 2020, 03:35 |
|
#11 |
Member
Join Date: Dec 2018
Posts: 75
Rep Power: 7 |
Sorry for late return. Here it goes, thanks a lot.
|
|
July 1, 2020, 04:51 |
|
#12 |
Member
Join Date: Dec 2018
Posts: 75
Rep Power: 7 |
Does this question really hard that much
|
|
July 1, 2020, 10:23 |
|
#13 |
Senior Member
Join Date: Dec 2019
Location: Cologne, Germany
Posts: 369
Rep Power: 8 |
i checked also the original source code and don't really know what the problem is. the code looks fine to me.
|
|
July 2, 2020, 09:30 |
|
#14 |
Member
Join Date: Dec 2018
Posts: 75
Rep Power: 7 |
Thanks for your all effort. I gave you repetition point as return .
I really stucked with this problem. Is there anyone who can help? Thanks for every response! |
|
July 2, 2020, 09:52 |
|
#15 |
Senior Member
Join Date: Dec 2019
Location: Cologne, Germany
Posts: 369
Rep Power: 8 |
ok, lets try one more time
your .C-File from line 34 onwards: Code:
template<class Type> Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh>> Foam::reconCentral<Type>::interpolate //Foam::tmp<Foam::reconCentral<Type>> //Foam::reconCentral<Type>::New ( // const GeometricField<Type, fvPatchField, surfaceMesh>&, const GeometricField<Type, fvPatchField, volMesh>& vf // const tmp<surfaceScalarField>& tsf, // const tmp<surfaceScalarField>& pSf ) const //adjust this { //code ... } |
|
July 3, 2020, 02:33 |
|
#16 | |
Member
Join Date: Dec 2018
Posts: 75
Rep Power: 7 |
Quote:
Were you be succesful with this change ? |
||
July 3, 2020, 03:32 |
|
#17 |
Senior Member
Join Date: Dec 2019
Location: Cologne, Germany
Posts: 369
Rep Power: 8 |
i just checked the code once more and saw that this part was missing
|
|
November 25, 2020, 02:41 |
|
#18 |
Member
Join Date: Dec 2018
Posts: 75
Rep Power: 7 |
Is there any code developer for Foam Extend or OpenFoam to help this little but hard problem for me?
|
|
November 25, 2020, 13:25 |
|
#19 |
Senior Member
Join Date: Aug 2015
Posts: 494
Rep Power: 15 |
A long time ago I ported the limiter to Openfoam 7. I don't know how this compares to v1812, but it may be closer than foam-extend.
Caelan |
|
November 27, 2020, 04:15 |
|
#20 |
Member
Join Date: Dec 2018
Posts: 75
Rep Power: 7 |
Thanks a lot, i can make some modification from your codes, then it compiled. I wmake in src/finiteVolume/interpolation/limitedSchemes as reconCentral file with required Make files. However, when i try to run with this fvSchemes, it says Unknown discretisation scheme reconCentral :
ddtSchemes { default steadyState; } gradSchemes { default cellLimited leastSquares 1.0; } divSchemes { default none; div(phi,U) Gauss reconCentral cellLimited leastSquares 1.0; div(phi,k) Gauss vanLeerDC; div(phi,omega) Gauss vanLeerDC; div(R) Gauss linear; div((nuEff*dev(grad(U).T()))) Gauss linear; } laplacianSchemes { default none; laplacian(nuEff,U) Gauss linear limited 0.5; laplacian((1|A(U)),p) Gauss linear limited 0.5; laplacian(DkEff,k) Gauss linear limited 0.5; laplacian(DomegaEff,omega) Gauss linear limited 0.5; laplacian(1,p) Gauss linear corrected; } interpolationSchemes { default reconCentral phi leastSquares; interpolate(U) reconCentral phi leastSquares; } snGradSchemes { default limited 0.5; } fluxRequired { default no; p ; } Do you have any idea why it gives this error ? EDIT I solved the problem, you have to add libs("linreconCentral.so") at the bottom of controlDict file because i did not compile at top level of src. Last edited by hbulus; November 27, 2020 at 07:09. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to implement a rigid lid aproximation for a 2d flow? | Jaydi_21 | Main CFD Forum | 0 | August 1, 2018 14:40 |
Implement swirl as "internal" BC with calculated u_axial | lentschi | CFX | 6 | November 2, 2011 05:58 |
Problems to implement a coordinate change | mateusps | OpenFOAM | 3 | September 22, 2011 14:20 |
How to implement implicit TVD limiter? | Kmlin | Main CFD Forum | 3 | March 28, 2010 09:52 |
how to implement this kind of equation | keishawillstone | OpenFOAM Running, Solving & CFD | 2 | August 11, 2009 07:01 |