CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Revive old OpenFOAM code

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 14, 2016, 10:16
Default Revive old OpenFOAM code
  #1
New Member
 
Join Date: Nov 2016
Posts: 4
Rep Power: 9
willyblubb is on a distinguished road
Hi,

I'm curretnly trying to use code wirtten for OpenFOAM 1.1 with my OpenFOAM 4.0 istallation.
I get a lot of error messages when I try to compile.
Here is one example:

Code:
In file included from fwd1.C:12:0:
fbcp1-freeBoundary.h: In member function ‘void freeBoundary::store(bool, const scalarField&, Foam::scalar*, Foam::scalar)’:
fbcp1-freeBoundary.h:25:122: error: conversion from ‘const vectorField {aka const Foam::Field<Foam::Vector<double> >}’ to non-scalar type ‘const subField {aka const Foam::SubField<Foam::Vector<double> >}’ requested
  const vectorField::subField bCentres = liquid ? mesh_l->boundary()[fbPatchI_l].Cf() : mesh_s->boundary()[fbPatchI_s].Cf();
                                                                                                                          ^
Where can I find the documentation for functions like boundary() and Cf()? I worked through a few tutorials and used the forums search as well as Google but couldn't find any answers.

Here is another one:

Code:
fbcp1-freeBoundary.h: In constructor ‘freeBoundary::freeBoundary(Foam::fvMesh&, Foam::fvMesh&, bool)’:
fbcp1-freeBoundary.h:97:38: error: ‘class Foam::fvMesh’ has no member named ‘allPoints’
  motion_s = new vectorField( mesh_s->allPoints() );
Please give me some hints where to start. What would you do if you wanted to make an OpemFOAM 1.1 code run again?

Thanks for your help!
willyblubb is offline   Reply With Quote

Old   November 14, 2016, 13:32
Default
  #2
Senior Member
 
Mahdi Hosseinali
Join Date: Apr 2009
Location: NB, Canada
Posts: 273
Rep Power: 18
anishtain4 is on a distinguished road
This is what you're looking for:
http://openfoam.com/documentation/cpp-guide/html/
anishtain4 is offline   Reply With Quote

Old   November 18, 2016, 01:47
Default
  #3
Senior Member
 
Mohammad Shakil Ahmmed
Join Date: Oct 2012
Location: AUS
Posts: 137
Rep Power: 14
ahmmedshakil is on a distinguished road
I guess you have to change some library links to go with the new one.

Cheers
shakil
ahmmedshakil is offline   Reply With Quote

Old   November 21, 2016, 04:59
Default
  #4
New Member
 
Join Date: Nov 2016
Posts: 4
Rep Power: 9
willyblubb is on a distinguished road
Thank you very much for your help!

@anishtain4: the link is very helpful.

Quote:
I guess you have to change some library links to go with the new one.
@shakil: how can I find out which library links I need to change?
So far, the following libraries are linked:

Code:
EXE_LIBS = \
    -lcfdTools \
    -ldynamicMesh \
    -lmeshTools \
    $(WM_DECOMP_LIBS)
However, OpenFOAM 4.0 does not find the library -lcfdTools.
willyblubb is offline   Reply With Quote

Old   November 21, 2016, 12:11
Default
  #5
Senior Member
 
Mahdi Hosseinali
Join Date: Apr 2009
Location: NB, Canada
Posts: 273
Rep Power: 18
anishtain4 is on a distinguished road
To find out libraries you need to link, go to the the files you have (better to go in the order they will be called through Make/files) read every single #include, if it's not in your directory, search for it in OF root directory. You'll always find some in lnInclude directories.
When Openfoam faces a #inlclude, it first checks your local directory, then $FOAM_SRC/OpenFOAM/lnInclude, and finally the links provided. So if you find something in OpenFOAM/lnInclude, you don't need to link it, but anywhere else you gotta link it.

However, it seems based on your errors this is not the case. Some of the classes has been restructured and you should look up the function in your code to see what it does, and then based on your code how can you update it.
anishtain4 is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to contribute to the community of OpenFOAM users and to the OpenFOAM technology wyldckat OpenFOAM 17 November 10, 2017 15:54
OpenFOAM 4.0 Released CFDFoundation OpenFOAM Announcements from OpenFOAM Foundation 2 October 6, 2017 05:40
OpenFOAM Training, London, Chicago, Munich, Houston 2016-2017 cfd.direct OpenFOAM Announcements from Other Sources 0 September 14, 2016 03:19
[OpenFOAM.org] A Mac OS X of23x Development Environment Using Docker rt08 OpenFOAM Installation 1 February 28, 2016 19:00
OpenFOAM Foundation releases OpenFOAM 2.2.2 opencfd OpenFOAM Announcements from ESI-OpenCFD 0 October 14, 2013 07:18


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