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

new thermodynamic model

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

Like Tree1Likes
  • 1 Post By Tobi

Reply
 
LinkBack Thread Tools Display Modes
Old   September 6, 2012, 18:30
Default new thermodynamic model
  #1
Senior Member
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,087
Blog Entries: 6
Rep Power: 19
Tobi will become famous soon enough
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi all,

i am working on a new thermodynamic model based on the flamelet solver of alberto cuoci.

I copied the thermodynamic src code into a new folder, called SLFMThermo
and renamed everything in the code to SLFM...

Okay ... after that I compiled the basicThermo and the SLFMThermo and everything worked fine.

After that I removed everything and build the alberto thermodynamicm model again and it worked

Now I added my model to the Make/files file and compiled again.

As I get to the SLFMThermo I ll get the following output:

Code:
SLFMThermo/SLFMThermo.C:32: error: redefinition of ‘Foam::SLFMThermo<MixtureType>::SLFMThermo(const Foam::fvMesh&)’
SLFMThermo/SLFMThermo.C:32: error: ‘Foam::SLFMThermo<MixtureType>::SLFMThermo(const Foam::fvMesh&)’ previously declared here
SLFMThermo/SLFMThermo.C:298: error: redefinition of ‘Foam::SLFMThermo<MixtureType>::~SLFMThermo()’
SLFMThermo/SLFMThermo.C:298: error: ‘virtual Foam::SLFMThermo<MixtureType>::~SLFMThermo()’ previously declared here
SLFMThermo/SLFMThermo.C:305: error: redefinition of ‘void Foam::SLFMThermo<MixtureType>::calculate()’
Why do I get redifinition error ? SLFMThermo is just declared in the SLFMThermo dict. The other thermodynamic is called hPdfThermo ?

Can someone give me an advice?
Tobi
Tobi is offline   Reply With Quote

Old   September 7, 2012, 03:55
Default
  #2
Senior Member
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,087
Blog Entries: 6
Rep Power: 19
Tobi will become famous soon enough
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi all,

today I had a look at the thermodynamic model hRho and hsRho and its the same like I have.

Well I simplyfied my c++ code so that there is just the constructor and deconstructor in the header and source files. I get the same error:

Code:
SLFMThermo/SLFMThermo.C:32: error: redefinition of ‘Foam::SLFMThermo<MixtureType>::SLFMThermo(const Foam::fvMesh&)’
SLFMThermo/SLFMThermo.C:32: error: ‘Foam::SLFMThermo<MixtureType>::SLFMThermo(const Foam::fvMesh&)’ previously declared here
SLFMThermo/SLFMThermo.C:59: error: redefinition of ‘Foam::SLFMThermo<MixtureType>::~SLFMThermo()’
SLFMThermo/SLFMThermo.C:59: error: ‘virtual Foam::SLFMThermo<MixtureType>::~SLFMThermo()’ previously declared here

My source file is:
Code:
\*---------------------------------------------------------------------------*/

#include "SLFMThermo.H"
#include "fixedValueFvPatchFields.H"

// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //

template<class MixtureType>
Foam::SLFMThermo<MixtureType>::SLFMThermo(const fvMesh& mesh)
:
    basicFThermo(mesh),
    MixtureType(*this, mesh),

    h_laminar_
    (
        IOobject
        (
            "h",
            mesh.time().timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::NO_WRITE
        ),
        mesh,
        dimensionSet(0, 2, -2, 0, 0),
        hBoundaryTypes()
    )
{

}


// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //

template<class MixtureType>
Foam::SLFMThermo<MixtureType>::~SLFMThermo()
{}

and my header file is:

Code:
*---------------------------------------------------------------------------*/

#ifndef SLFMThermo_H
#define SLFMThermo_H

#include "basicFThermo.H"
#include "basicMixture.H"

#include "OpenSMOKE_SLFM_NonAdiabaticFlamelet_Library.hpp"

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

namespace Foam
{

/*---------------------------------------------------------------------------*\
                         Class SLFMThermo Declaration
\*---------------------------------------------------------------------------*/

template<class MixtureType>
class SLFMThermo
:
    public basicFThermo,
    public MixtureType
{
private:


        volScalarField h_laminar_;

        OpenSMOKE_SLFM_NonAdiabaticFlamelet_Library     flamelets_library;


private:

        SLFMThermo(const SLFMThermo<MixtureType>&);

public:

    //- Runtime type information
    TypeName("SLFMThermo");


    // Constructors

    //- Construct from mesh
    SLFMThermo(const fvMesh&);


    //- Destructor
    virtual ~SLFMThermo();
};


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

} // End namespace Foam

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

#ifdef NoRepository
#   include "SLFMThermo.C"
#endif

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

#endif
I do not know why the output is "redefinition"? ?
:/

Couse if I just compile my thermo model it works. with both - i get redifinitions
Tobi is offline   Reply With Quote

Old   September 7, 2012, 05:33
Default
  #3
Senior Member
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,087
Blog Entries: 6
Rep Power: 19
Tobi will become famous soon enough
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi all,

I fixed the problem.
I deleted all folders and did the same things again.
Now I can compile everything without any errors and the solvers are working


If the laminarFlameletSolver works good and the validation gives good results I ll share it with you!

Tobi
babakflame likes this.
Tobi is offline   Reply With Quote

Old   June 5, 2014, 15:01
Default
  #4
Senior Member
 
Srivathsan N
Join Date: Jan 2013
Location: India
Posts: 101
Rep Power: 4
Sherlock_1812 is on a distinguished road
Dear Tobias,

Can you tell me what the generic meaning of this error is? I also have an error that reads

Code:
 
myFixedNormalSlip/myFixedNormalSlipFvPatchField.C:33:1: error: redefinition of ‘Foam::myFixedNormalSlipFvPatchField<Type>::myFixedNormalSlipFvPatchField(const Foam::fvPatch&, const Foam::DimensionedField<Type, Foam::volMesh>&)’
myFixedNormalSlip/myFixedNormalSlipFvPatchField.C:33:1: error: ‘Foam::myFixedNormalSlipFvPatchField<Type>::myFixedNormalSlipFvPatchField(const Foam::fvPatch&, const Foam::DimensionedField<Type, Foam::volMesh>&)’ previously declared here
myFixedNormalSlip/myFixedNormalSlipFvPatchField.C:45:1: error: redefinition of ‘Foam::myFixedNormalSlipFvPatchField<Type>::myFixedNormalSlipFvPatchField(const Foam::myFixedNormalSlipFvPatchField<Type>&, const Foam::fvPatch&, const Foam::DimensionedField<Type, Foam::volMesh>&, const Foam::fvPatchFieldMapper&)’
myFixedNormalSlip/myFixedNormalSlipFvPatchField.C:45:1: error: ‘Foam::myFixedNormalSlipFvPatchField<Type>::myFixedNormalSlipFvPatchField(const Foam::myFixedNormalSlipFvPatchField<Type>&, const Foam::fvPatch&, const Foam::DimensionedField<Type, Foam::volMesh>&, const Foam::fvPatchFieldMapper&)’ previously declared here
I have written this BC derived from fixedNormalSlip. What does the 'previously declared here' error mean?
__________________
Regards,

Srivaths
Sherlock_1812 is offline   Reply With Quote

Old   November 3, 2014, 22:18
Default
  #5
New Member
 
Fanglou
Join Date: Oct 2014
Posts: 9
Rep Power: 2
tjucus is on a distinguished road
Hello Tobi:

Recently, I am trying to modify the ConeInjection model to my_ConeInjection, and I put my_ConeInjection.H and my_ConeInjection.C in a folder named my_Coneinjection, which also has a Make folder consists of files and options. All of these are in $WM_PROJECT_USER_DIR/src, when I user wmake libso script to compile it, an error appears,just like:my_ConeInjection.C:139:6: error:' redefinition of void Foam::my_ConeInjection<CloudType>::setFlowType()'. It seems that all the functions in my_ConeInjection.C are redefinitioned and previously declared here.

Do you know how to solve my problems?

Great thanks in advance!
tjucus is offline   Reply With Quote

Old   November 4, 2014, 04:35
Default
  #6
Senior Member
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Leoben (Austria)
Posts: 1,087
Blog Entries: 6
Rep Power: 19
Tobi will become famous soon enough
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hello all,

@Sherlock, sorry I did not notice that you made a post on that thread. The first error message give you the hint that you declare the slipNormal twice. Normally due to included files.


@tjucus: the first steps of doing sth like you are going to do is:
  • copy the model and rename it (like you did)
  • clean it (wclean)
  • rename the *.C file to the new name
  • change the file and lib files in MAKE/files
Then try to compile. This should work. After that go on:
  • sed 's/oldName/newName/g' -i *
Then try to compile again... if this is working you can start modifying your stuff.
__________________
Best regards,
Tobias Holzmann

Some interesting OpenFOAM tutorials and videos on www.Holzmann-cfd.de
Tobi is offline   Reply With Quote

Old   November 4, 2014, 05:23
Default
  #7
New Member
 
Fanglou
Join Date: Oct 2014
Posts: 9
Rep Power: 2
tjucus is on a distinguished road
Hello,Tobi

I have successfully compile my new model-my_ConeInjection,and it is now in libmylagrangianIntermediate.so. To use it in a particular tutorials such as aachenBomb,I have add the line libs ("libmylagrangianIntermediate.so") in the controlDict file of the case, when I run the case,it could not find my_ConeInjection?Do you know why?

Thanks a lot in advance!
tjucus is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reynolds Stress model in CFX vs Fluent Tim CFX 1 October 7, 2009 06:19
help for different between les model (subgrid-scale model) liuyuxuan FLUENT 1 October 2, 2009 15:25
mass flow in is not equal to mass flow out saii CFX 2 September 18, 2009 08:07
2 stage axial turbine model convergence issues sherifkadry CFX 2 September 7, 2009 20:51
Advanced Turbulence Modeling in Fluent, Realizable k-epsilon Model Jonas Larsson FLUENT 5 March 13, 2000 04:27


All times are GMT -4. The time now is 22:43.