CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [isoAdvector] Possible to edit src files in openfoam installation (https://www.cfd-online.com/Forums/openfoam-community-contributions/205294-possible-edit-src-files-openfoam-installation.html)

srikrishnan_balasubramani August 14, 2018 08:30

Possible to edit src files in openfoam installation
 
Hi Foamers,


Is it possible to edit the Openfoam-v1806/src/finiteVolume/.... any files inside this directory?


In particular, I want to change the isoAdvector definition to suit my case.



I copied all the files from isoAdvection to the user directory. Then I changed the file names to myisoAdvection (.C,.H ) and also the function names inside them. All these changed files, I have in the user defined solver directory namely myinterIsoFoam.



1. Is it right procedure to do ? Copying src files from the installation folder and changing it.



2. After compiling, I get undefined reference errors. I don't change any function definition. Just the name of functions I change. How to get rid of these errors ?


ex:
myinterIsoFoam.C:(.text._ZNK4Foam14myisoAdvection4 typeEv[_ZNK4Foam14myisoAdvection4typeEv]+0x3): undefined reference to `Foam::myisoAdvection::typeName'
Make/linux64GccDPInt32Opt/myinterIsoFoam.o: In function `main':
myinterIsoFoam.C:(.text.startup+0x2b6e): undefined reference to `Foam::myisoAdvection::myisoAdvection(Foam::Geomet ricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&)'
myinterIsoFoam.C:(.text.startup+0x4626): undefined reference to `Foam::myisoAdvection::myadvect()'
myinterIsoFoam.C:(.text.startup+0x6af1): undefined reference to `Foam::myisoAdvection::myadvect()'
myinterIsoFoam.C:(.text.startup+0x80d3): undefined reference to `Foam::myisoAdvection::myisoAdvection(Foam::Geomet ricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&)'
collect2: error: ld returned 1 exit status



This is what I get after compilation.



Kindly help me to solve this.


Thanks.

srikrishnan_balasubramani August 15, 2018 06:02

Solved.

http://www.tfd.chalmers.se/~hani/kur...ated050118.pdf
The above file from chalmers university explains it.


All times are GMT -4. The time now is 13:09.