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

Problem with creation of new BC fixing it to a patch using refCast

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 26, 2014, 11:44
Default Problem with creation of new BC fixing it to a patch using refCast
  #1
Member
 
Join Date: Feb 2012
Posts: 35
Rep Power: 14
Matt_B is on a distinguished road
Hi guys,
I already opened a post talking about my problems in setting a new BC to a patch, using refCast method; the post is located here: http://www.cfd-online.com/Forums/ope...m-refcast.html
I did some new steps further, but now I have troubles to compile the library.
As I explained in the previous post, I thought the possible solution to the problem of lack in identification of my new Boundary Condition also as a new type to be used by refCast method, could be in the macros written at the end of fvPatchField.H.
Therefore I tried to use these macros in some ways, taking inspiration by reading other already compiled BCs. I looked at calculatedFvPatchField as an example and I tried to reproduce same code arrangement; in 'calculated' folder I find the following headers:

calculatedFvPatchField.C
calculatedFvPatchField.H
calculatedFvPatchFields.C
calculatedFvPatchFields.H
calculatedFvPatchFieldsFwd.H

I did the same for my headers:

myGradientEnthalpyFvPatchScalarField.C
myGradientEnthalpyFvPatchScalarField.H
myGradientEnthalpyFvPatchScalarFields.C
myGradientEnthalpyFvPatchScalarFields.H
myGradientEnthalpyFvPatchScalarFieldsFwd.H

The content of the headers in which are called the macros are the following:

myGradientEnthalpyFvPatchScalarFields.C
Code:
namespace Foam
{

// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

makePatchTypeField
(
    fvPatchScalarField,
    myGradientEnthalpyFvPatchScalarField
);

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

} // End namespace Foam
myGradientEnthalpyFvPatchScalarFields.H

Code:
#ifndef myGradientEnthalpyFvPatchFields_H
#define myGradientEnthalpyFvPatchFields_H

#include "myGradientEnthalpyFvPatchScalarField.H"
#include "fieldTypes.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

namespace Foam
{

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

template<class Scalar> class myGradientEnthalpyFvPatchField;

makePatchTypeFieldTypedefs(myGradientEnthalpy);

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

} // End namespace Foam

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#endif
myGradientEnthalpyFvPatchScalarFieldsFwd.H

Code:
#ifndef myGradientEnthalpyFvPatchFieldsFwd_H
#define myGradientEnthalpyFvPatchFieldsFwd_H

#include "fieldTypes.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

namespace Foam
{

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

template<class Scalar> class myGradientEnthalpyFvPatchField;

makePatchTypeFieldTypedefs(myGradientEnthalpy);

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

} // End namespace Foam

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#endif
The error that comes out after making an attempt to compile the library is as here attached:
Code:
Making dependency list for source file myGradientEnthalpyFvPatchScalarField/myGradientEnthalpyFvPatchScalarFields.C
SOURCE=myGradientEnthalpyFvPatchScalarField/myGradientEnthalpyFvPatchScalarFields.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O0 -fdefault-inline -ggdb3 -DFULLDEBUG -DNoRepository -ftemplate-depth-100 -I/opt/OpenFOAM/OpenFOAM-2.1.1/src/finiteVolume/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.1.1/src/meshTools/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.1.1/src/turbulenceModels/compressible/turbulenceModel/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.1.1/src/turbulenceModels/compressible/matteoBC/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.1.1/src/thermophysicalModels/basic/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.1.1/src/thermophysicalModels/specie/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.1.1/src/thermophysicalModels/basicSolidThermo/lnInclude  -IlnInclude -I. -I/opt/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.1.1/src/OSspecific/POSIX/lnInclude   -fPIC -c $SOURCE -o Make/linux64GccDPDebug/myGradientEnthalpyFvPatchScalarFields.o
In file included from /opt/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/Field.H:360:0,
                 from /opt/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/labelField.H:39,
                 from /opt/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/primitiveFields.H:37,
                 from /opt/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/pointField.H:36,
                 from /opt/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/edge.H:40,
                 from /opt/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/edgeList.H:32,
                 from /opt/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/PrimitivePatch.H:56,
                 from /opt/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/primitivePatch.H:35,
                 from /opt/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/polyPatch.H:43,
                 from /opt/OpenFOAM/OpenFOAM-2.1.1/src/finiteVolume/lnInclude/fvPatch.H:39,
                 from /opt/OpenFOAM/OpenFOAM-2.1.1/src/finiteVolume/lnInclude/fvPatchField.H:47,
                 from /opt/OpenFOAM/OpenFOAM-2.1.1/src/finiteVolume/lnInclude/fixedGradientFvPatchField.H:38,
                 from /opt/OpenFOAM/OpenFOAM-2.1.1/src/finiteVolume/lnInclude/fixedGradientFvPatchFields.H:29,
                 from /opt/OpenFOAM/OpenFOAM-2.1.1/src/thermophysicalModels/basic/lnInclude/gradientEnthalpyFvPatchScalarField.H:38,
                 from myGradientEnthalpyFvPatchScalarField/myGradientEnthalpyFvPatchScalarField.H:52,
                 from myGradientEnthalpyFvPatchScalarField/myGradientEnthalpyFvPatchScalarFields.H:29,
                 from myGradientEnthalpyFvPatchScalarField/myGradientEnthalpyFvPatchScalarFields.C:26:
/opt/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/Field.C: In member function ‘void Foam::Field<Type>::operator=(const Foam::VectorSpace<Form, Cmpt, nCmpt>&)’:
/opt/OpenFOAM/OpenFOAM-2.1.1/src/OpenFOAM/lnInclude/Field.C:680:42: warning: typedef ‘VSType’ locally defined but not used [-Wunused-local-typedefs]
     typedef VectorSpace<Form,Cmpt,nCmpt> VSType;
                                          ^
In file included from /opt/OpenFOAM/OpenFOAM-2.1.1/src/finiteVolume/lnInclude/fixedGradientFvPatchField.H:38:0,
                 from /opt/OpenFOAM/OpenFOAM-2.1.1/src/finiteVolume/lnInclude/fixedGradientFvPatchFields.H:29,
                 from /opt/OpenFOAM/OpenFOAM-2.1.1/src/thermophysicalModels/basic/lnInclude/gradientEnthalpyFvPatchScalarField.H:38,
                 from myGradientEnthalpyFvPatchScalarField/myGradientEnthalpyFvPatchScalarField.H:52,
                 from myGradientEnthalpyFvPatchScalarField/myGradientEnthalpyFvPatchScalarFields.H:29,
                 from myGradientEnthalpyFvPatchScalarField/myGradientEnthalpyFvPatchScalarFields.C:26:
myGradientEnthalpyFvPatchScalarField/myGradientEnthalpyFvPatchScalarFields.H: At global scope:
myGradientEnthalpyFvPatchScalarField/myGradientEnthalpyFvPatchScalarFields.H:43:28: error: conflicting declaration ‘typedef class Foam::myGradientEnthalpyFvPatchField<double> Foam::myGradientEnthalpyFvPatchScalarField’
 makePatchTypeFieldTypedefs(myGradientEnthalpy);
                            ^
/opt/OpenFOAM/OpenFOAM-2.1.1/src/finiteVolume/lnInclude/fvPatchField.H:597:40: note: in definition of macro ‘makePatchTypeFieldTypedefs’
     typedef type##FvPatchField<scalar> type##FvPatchScalarField;              \
                                        ^
In file included from myGradientEnthalpyFvPatchScalarField/myGradientEnthalpyFvPatchScalarFields.H:29:0,
                 from myGradientEnthalpyFvPatchScalarField/myGradientEnthalpyFvPatchScalarFields.C:26:
myGradientEnthalpyFvPatchScalarField/myGradientEnthalpyFvPatchScalarField.H:66:7: error: ‘class Foam::myGradientEnthalpyFvPatchScalarField’ has a previous declaration as ‘class Foam::myGradientEnthalpyFvPatchScalarField’
 class myGradientEnthalpyFvPatchScalarField
       ^
make: *** [Make/linux64GccDPDebug/myGradientEnthalpyFvPatchScalarFields.o] Error 1
I'm sure I didn't use in a proper way the macros supplied by openFoam.
Could someone tell me how to do it better?

Thank you all.

Matteo
Matt_B is offline   Reply With Quote

Reply

Tags
refcast, typedef

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
[Other] Cyclic patch problem! SMartella OpenFOAM Meshing & Mesh Conversion 6 July 26, 2023 17:00
AMI speed performance danny123 OpenFOAM 21 October 24, 2020 05:13
problem with surface creation in ICEM from multiple curves dialolema ANSYS Meshing & Geometry 2 October 27, 2014 14:14
[Gmsh] Single volume Mesh gmsh PeteH OpenFOAM Meshing & Mesh Conversion 9 August 6, 2013 09:54
Multicomponent fluid Andrea CFX 2 October 11, 2004 06:12


All times are GMT -4. The time now is 16:02.