|
[Sponsors] |
![]() |
![]() |
#1 |
New Member
Bentley Lam
Join Date: Apr 2016
Posts: 5
Rep Power: 11 ![]() |
Hello,
I am doing a project about pipe flow with non newtonian fluid. Apart from the default viscosity model of OpenFOAM, I want to use Quemada model (not in OpenFOAM). The Quemada file contains: Quemada.C, Quemada.H and Quemada.dep. So my question is after I move the Quemada file into viscosityModels directory, what will be the next step? Really appreciated any help! Bentley. |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Member
Akr
Join Date: Apr 2015
Location: India
Posts: 53
Rep Power: 12 ![]() |
Not really been good at this. But i feel that u should make necessary changes in the files/options folders and then introduce these headers in the .C file and then you have to wmake the solver and see if it complies without any error foremost. you could also search in the forum. I guess the below is smthng relating to adding a new viscosity model
Cheers! http://www.cfd-online.com/Forums/ope...ity-model.html |
|
![]() |
![]() |
![]() |
![]() |
#3 |
New Member
Bentley Lam
Join Date: Apr 2016
Posts: 5
Rep Power: 11 ![]() |
Hi all,
I am still unable to build the Quemada viscosity model into my library. And I got some errors as following. Any help will be appreciated! Cheers. Code:
wmake: 'Make' directory does not exist in /opt/openfoam30/src/transportModels/incompressible/viscosityModels/Quemada Searching up directories tree for Make directory Found target directory ./../.. /opt/openfoam30/src/transportModels/incompressible g++ -m64 -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 -O3 -DNoRepository -ftemplate-depth-100 -I.. -I../twoPhaseMixture/lnInclude -I/opt/openfoam30/src/finiteVolume/lnInclude -I/opt/openfoam30/src/meshTools/lnInclude -IlnInclude -I. -I/opt/openfoam30/src/OpenFOAM/lnInclude -I/opt/openfoam30/src/OSspecific/POSIX/lnInclude -fPIC -c viscosityModels/Quemada/Quemada.C -o /opt/openfoam30/platforms/linux64GccDPInt32Opt/src/transportModels/incompressible/viscosityModels/Quemada/Quemada.o In file included from /opt/openfoam30/src/OpenFOAM/lnInclude/token.H:49:0, from /opt/openfoam30/src/OpenFOAM/lnInclude/UILListIO.C:28, from /opt/openfoam30/src/OpenFOAM/lnInclude/UILList.C:92, from /opt/openfoam30/src/OpenFOAM/lnInclude/UILList.H:383, from /opt/openfoam30/src/OpenFOAM/lnInclude/ILList.H:39, from /opt/openfoam30/src/OpenFOAM/lnInclude/IDLList.H:35, from /opt/openfoam30/src/OpenFOAM/lnInclude/entry.H:45, from /opt/openfoam30/src/OpenFOAM/lnInclude/dictionary.H:53, from lnInclude/viscosityModel.H:50, from viscosityModels/Quemada/Quemada.H:38, from viscosityModels/Quemada/Quemada.C:26: lnInclude/viscosityModel.H: In instantiation of ‘static Foam::autoPtr<Foam::viscosityModel> Foam::viscosityModel::adddictionaryConstructorToTable<viscosityModelType>::New(const Foam::word&, const Foam::dictionary&, const volVectorField&, const surfaceScalarField&) [with viscosityModelType = Foam::viscosityModels::Quemada; Foam::volVectorField = Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>; Foam::surfaceScalarField = Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>]’: lnInclude/viscosityModel.H:96:9: required from ‘Foam::viscosityModel::adddictionaryConstructorToTable<viscosityModelType>::adddictionaryConstructorToTable(const Foam::word&) [with viscosityModelType = Foam::viscosityModels::Quemada]’ viscosityModels/Quemada/Quemada.C:37:5: required from here /opt/openfoam30/src/OpenFOAM/lnInclude/runTimeSelectionTables.H:76:66: error: cannot allocate an object of abstract type ‘Foam::viscosityModels::Quemada’ return autoPtr< baseType >(new baseType##Type parList); \ ^ lnInclude/viscosityModel.H:96:9: note: in expansion of macro ‘declareRunTimeSelectionTable’ declareRunTimeSelectionTable ^ In file included from viscosityModels/Quemada/Quemada.C:26:0: viscosityModels/Quemada/Quemada.H:53:7: note: because the following virtual functions are pure within ‘Foam::viscosityModels::Quemada’: class Quemada ^ In file included from viscosityModels/Quemada/Quemada.H:38:0, from viscosityModels/Quemada/Quemada.C:26: lnInclude/viscosityModel.H:155:34: note: virtual Foam::tmp<Foam::Field<double> > Foam::viscosityModel::nu(Foam::label) const virtual tmp<scalarField> nu(const label patchi) const = 0; ^ In file included from /opt/openfoam30/src/OpenFOAM/lnInclude/token.H:49:0, from /opt/openfoam30/src/OpenFOAM/lnInclude/UILListIO.C:28, from /opt/openfoam30/src/OpenFOAM/lnInclude/UILList.C:92, from /opt/openfoam30/src/OpenFOAM/lnInclude/UILList.H:383, from /opt/openfoam30/src/OpenFOAM/lnInclude/ILList.H:39, from /opt/openfoam30/src/OpenFOAM/lnInclude/IDLList.H:35, from /opt/openfoam30/src/OpenFOAM/lnInclude/entry.H:45, from /opt/openfoam30/src/OpenFOAM/lnInclude/dictionary.H:53, from lnInclude/viscosityModel.H:50, from viscosityModels/Quemada/Quemada.H:38, from viscosityModels/Quemada/Quemada.C:26: lnInclude/viscosityModel.H: In static member function ‘static Foam::autoPtr<Foam::viscosityModel> Foam::viscosityModel::adddictionaryConstructorToTable<viscosityModelType>::New(const Foam::word&, const Foam::dictionary&, const volVectorField&, const surfaceScalarField&) [with viscosityModelType = Foam::viscosityModels::Quemada; Foam::volVectorField = Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>; Foam::surfaceScalarField = Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>]’: /opt/openfoam30/src/OpenFOAM/lnInclude/runTimeSelectionTables.H:77:9: warning: control reaches end of non-void function [-Wreturn-type] } \ ^ lnInclude/viscosityModel.H:96:9: note: in expansion of macro ‘declareRunTimeSelectionTable’ declareRunTimeSelectionTable ^ make: *** [/opt/openfoam30/platforms/linux64GccDPInt32Opt/src/transportModels/incompressible/viscosityModels/Quemada/Quemada.o] Error 1 Last edited by yy205001; May 2, 2016 at 02:12. Reason: Upload files |
|
![]() |
![]() |
![]() |
![]() |
#4 |
Member
Join Date: Sep 2014
Location: Germany
Posts: 88
Rep Power: 12 ![]() |
What model did you copy to change into your new model?
|
|
![]() |
![]() |
![]() |
![]() |
#5 |
Senior Member
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 18 ![]() |
Can you post your .H file? It looks like you might not have a nu() function defined in your new class which is required as nu is a virtual function in its base class.
|
|
![]() |
![]() |
![]() |
![]() |
#6 |
Member
Join Date: Oct 2015
Posts: 63
Rep Power: 11 ![]() |
Hello everyone,
I have created a new Viscosity Model in OpenFOAM 3.0.1 based on the link given by Nightwing in post #2. I'm able to compile without any error but I'm not able to see the new model in the Viscosity Model selection table i.e. when I type transportModel bananas in the transportProperties file in the Constant directory, it is showing me the default 5 viscosity models and not the new model that I had just compiled. Any help is greatly appreciated. Thanks!! |
|
![]() |
![]() |
![]() |
![]() |
#7 |
Member
Join Date: Sep 2014
Location: Germany
Posts: 88
Rep Power: 12 ![]() |
Have you included the new library in the controlDict file under libs( "yourlibraryhere.so" ); ?
|
|
![]() |
![]() |
![]() |
![]() |
#8 |
Member
Join Date: Oct 2015
Posts: 63
Rep Power: 11 ![]() |
Hey TobM,
Yes I have included it in my controlDict file. Edit: I just found out why it wasn't showing. Basically, I have a groovy BC inlet condition for my case setup and in groovy BC also you use libs ("libgroovyBC.so" "libsgroovyStandardBCs.so"). So, in my controlDict, I had libs("libusertempModel.so"); libs("libgroovyBC.so" "libsgroovyStandardBCs.so"). When I clubbed both of these together into one libs statement as in libs(" libgroovyBC.so" "libsgroovyStandardBCs.so" "libusertempModel.so"), it started showing the new viscosity model in the selection table. This wasn't the case in OpenFOAM 2.3 x where I could have 2 separate libs statements, one for the groovy BC and one for the viscosity model. In OpenFOAM 3.0.1, however, clubbing the 2 together gives you the desired result. |
|
![]() |
![]() |
![]() |
![]() |
#9 |
Member
Emery
Join Date: Feb 2017
Location: France.
Posts: 33
Rep Power: 10 ![]() |
Hi foamers,
I'am working with simpleFoam, and I have implemented a new Herschel-Bulkley viscosity model integrating the Papanastasiou regularization. - I have created a new folder "RegHerschelBulkley" in "src/transportModels/incompressible/viscosityModels" ; - I have copied my files "RegHerschelBulkley.C", "REgHerschelBulkley.H" and "REgHerschelBulkley.C.dep" into that new folder ; - I have modified "src/transportModels/incompressible/Make/files" by adding the new viscosity model ; - I used the command "wclean" into "src/transportModels/incompressible/" ; - And when I use the command "./Allwmake" into "src/transportModels/", I got the message in the first attachment (which I must admit, I don't really understand...) Now when I try to launch a simulation using my new viscosity model, I got the error message in the second attachment. Can somebody suggest me some adjustments to make? Did I miss something? Any help would be well appreciated. I hope that you will find a couple of minutes to give me an answer. Thanks in advance, and have a nice week. Regards. |
|
![]() |
![]() |
![]() |
![]() |
#10 |
New Member
Join Date: Apr 2014
Location: Germany
Posts: 24
Rep Power: 13 ![]() |
Hi TemC,
I think your first mistake was not to work in your user-folder but instead in the openFOAM installation. A good guide for modifying transport models can be found here: http://www.tfd.chalmers.se/~hani/kur...nFoam%20v2.pdf Best, Moritz |
|
![]() |
![]() |
![]() |
![]() |
#11 |
Member
Emery
Join Date: Feb 2017
Location: France.
Posts: 33
Rep Power: 10 ![]() |
Good morning Moritz,
Thank you very much for your reply. Regards. Last edited by TemC; March 3, 2017 at 03:50. |
|
![]() |
![]() |
![]() |
![]() |
#12 |
New Member
Join Date: Jan 2025
Posts: 2
Rep Power: 0 ![]() |
Thanks, this is very useful.
|
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Viscosity model - error: object is not allocated - C++ beginner | avila.vc | OpenFOAM Programming & Development | 5 | February 14, 2022 02:00 |
Fluid turns into solid at given T (via viscosity UDF or solidifcation model?) | jpina | FLUENT | 1 | April 3, 2016 03:48 |
Viscosity model in the twoPhaseEulerFoam | enoch | OpenFOAM Programming & Development | 3 | March 17, 2016 09:53 |
Implementing new viscosity model | prjohnston | OpenFOAM Running, Solving & CFD | 6 | July 3, 2015 04:26 |
Viscosity ratio in gamma-theta transition model based on k-w sst turb model | Qiaol618 | Main CFD Forum | 8 | June 9, 2012 06:43 |