|
[Sponsors] |
Adding new temperature dependent viscosity model |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 15, 2015, 11:34 |
Adding new temperature dependent viscosity model
|
#1 |
Member
VA
Join Date: Mar 2015
Location: ON, Canada
Posts: 30
Rep Power: 11 |
Hello FOAMers,
I am trying to add a new viscosity model that is dependent on temperature. I was able to successfully compile the model. It works fine with geometries that have just one domain/region. However, when I try extending it to multi-regions, the model fails. In this case, the viscosity gets updated before the first step (based on my model) but it doesn't get updated after that i.e. during each time-step in the simulation. I have a fluid region surrounded by four solid regions. I have attached a pdf to illustrate this. I ran a test problem with just one region and printed the viscosity values at each time-step, and it does get updated correctly. I am struggling to see what needs to be modified in order to get this model working with multi-region geometry. I have attached the code for the viscosity model. Thanks! Last edited by vabishek; May 15, 2015 at 11:36. Reason: Forgot to attach a file |
|
May 18, 2015, 16:32 |
|
#2 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Greetings vabishek,
I hope you don't mind, but I'll quote some of the PM you sent me, since it provides additional information to your problem: Quote:
I say this because by only looking to the source code, I'm not able to diagnose the problem, since everything looks OK to me. It's possible that the problem is due to how you configured your test case . That's the only thing that comes to mind... namely that the "mesh()" in your boundary condition is not being used for the region where you need it, because you might have one defined it for the main mesh? Best regards, Bruno
__________________
|
||
May 19, 2015, 11:55 |
|
#3 |
Member
VA
Join Date: Mar 2015
Location: ON, Canada
Posts: 30
Rep Power: 11 |
Thanks, Bruno. I was able to resolve the issue. The issue was with the mesh() and region names. I fixed that and my simulation is running just fine. Thanks, again.
Regards, Abishek |
|
May 15, 2016, 22:05 |
|
#4 |
Member
Join Date: Oct 2015
Posts: 63
Rep Power: 11 |
Hey,
I'm trying to create a new viscosity model which calculates the viscosity based on temperature. As a test case, I followed the instructions given in this PDF(Page 12 onwards) (I renamed the model as TempViscosityModel) http://www.tfd.chalmers.se/~hani/kur...nFoam%20v2.pdf However, I'm getting an error when I do wmake libso. This is the error I'm getting *****@****-PC /opt/OpenFOAM/OpenFOAM-2.3.x/src/transportModels/incompressible/viscosityModels/TempViscosityModel $ wmake libso Making dependency files... wmakeLnInclude: linking include files to ./lnInclude In file included from TempViscosityModel.C:26:0: TempViscosityModel.H:38:28: fatal error: viscosityModel.H: No such file or directory #include "viscosityModel.H" ^ compilation terminated. SOURCE=TempViscosityModel.C ; x86_64-w64-mingw32-g++ -m64 -Dcygwin64 -DWM_DP -DMSWIN -DLITTLE_ENDIAN -Wall -Wextra -Wno-unused-parameter -Wnon-virtual-dtor -O3 -DNDEBUG -DNoRepository -ftemplate-depth-100 -I.. -I../twoPhaseMixture/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/OSspecific/MSWindows/lnInclude -c $SOURCE -o Make/cygwin64mingw-w64DPOpt/TempViscosityModel.o In file included from TempViscosityModel.C:26:0: TempViscosityModel.H:38:28: fatal error: viscosityModel.H: No such file or directory #include "viscosityModel.H" ^ compilation terminated. TempViscosityModel.dep:3: recipe for target 'Make/cygwin64mingw-w64DPOpt/TempViscosityModel.o' failed make: *** [Make/cygwin64mingw-w64DPOpt/TempViscosityModel.o] Error 1 Any suggestions on how to resolve this error? I also tried compiling using the method given in http://www.cfd-online.com/Forums/ope...bulkley-c.html (See Post #2) This is what I get when I do ./Allwmake $ ./Allwmake + wmake libso twoPhaseMixture Making dependency files... '/opt/OpenFOAM/OpenFOAM-2.3.x/platforms/cygwin64mingw-w64DPOpt/lib/libtwoPhaseMixture.dll' is up to date. + wmake libso twoPhaseProperties Making dependency files... '/opt/OpenFOAM/OpenFOAM-2.3.x/platforms/cygwin64mingw-w64DPOpt/lib/libtwoPhaseProperties.dll' is up to date. + wmake libso interfaceProperties Making dependency files... '/opt/OpenFOAM/OpenFOAM-2.3.x/platforms/cygwin64mingw-w64DPOpt/lib/libinterfaceProperties.dll' is up to date. + wmake libso incompressible Making dependency files... wmakeLnInclude: linking include files to ./lnInclude SOURCE=viscosityModels/viscosityModel/viscosityModel.C ; x86_64-w64-mingw32-g++ -m64 -Dcygwin64 -DWM_DP -DMSWIN -DLITTLE_ENDIAN -Wall -Wextra -Wno-unused-parameter -Wnon-virtual-dtor -O3 -DNDEBUG -DNoRepository -ftemplate-depth-100 -I.. -I../twoPhaseMixture/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/transportModels/incompressible/lnInclude/ -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/OSspecific/MSWindows/lnInclude -c $SOURCE -o Make/cygwin64mingw-w64DPOpt/viscosityModel.o SOURCE=viscosityModels/viscosityModel/viscosityModelNew.C ; x86_64-w64-mingw32-g++ -m64 -Dcygwin64 -DWM_DP -DMSWIN -DLITTLE_ENDIAN -Wall -Wextra -Wno-unused-parameter -Wnon-virtual-dtor -O3 -DNDEBUG -DNoRepository -ftemplate-depth-100 -I.. -I../twoPhaseMixture/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/transportModels/incompressible/lnInclude/ -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/OSspecific/MSWindows/lnInclude -c $SOURCE -o Make/cygwin64mingw-w64DPOpt/viscosityModelNew.o SOURCE=viscosityModels/Newtonian/Newtonian.C ; x86_64-w64-mingw32-g++ -m64 -Dcygwin64 -DWM_DP -DMSWIN -DLITTLE_ENDIAN -Wall -Wextra -Wno-unused-parameter -Wnon-virtual-dtor -O3 -DNDEBUG -DNoRepository -ftemplate-depth-100 -I.. -I../twoPhaseMixture/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/transportModels/incompressible/lnInclude/ -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/OSspecific/MSWindows/lnInclude -c $SOURCE -o Make/cygwin64mingw-w64DPOpt/Newtonian.o SOURCE=viscosityModels/powerLaw/powerLaw.C ; x86_64-w64-mingw32-g++ -m64 -Dcygwin64 -DWM_DP -DMSWIN -DLITTLE_ENDIAN -Wall -Wextra -Wno-unused-parameter -Wnon-virtual-dtor -O3 -DNDEBUG -DNoRepository -ftemplate-depth-100 -I.. -I../twoPhaseMixture/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/transportModels/incompressible/lnInclude/ -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/OSspecific/MSWindows/lnInclude -c $SOURCE -o Make/cygwin64mingw-w64DPOpt/powerLaw.o SOURCE=viscosityModels/CrossPowerLaw/CrossPowerLaw.C ; x86_64-w64-mingw32-g++ -m64 -Dcygwin64 -DWM_DP -DMSWIN -DLITTLE_ENDIAN -Wall -Wextra -Wno-unused-parameter -Wnon-virtual-dtor -O3 -DNDEBUG -DNoRepository -ftemplate-depth-100 -I.. -I../twoPhaseMixture/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/transportModels/incompressible/lnInclude/ -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/OSspecific/MSWindows/lnInclude -c $SOURCE -o Make/cygwin64mingw-w64DPOpt/CrossPowerLaw.o SOURCE=viscosityModels/BirdCarreau/BirdCarreau.C ; x86_64-w64-mingw32-g++ -m64 -Dcygwin64 -DWM_DP -DMSWIN -DLITTLE_ENDIAN -Wall -Wextra -Wno-unused-parameter -Wnon-virtual-dtor -O3 -DNDEBUG -DNoRepository -ftemplate-depth-100 -I.. -I../twoPhaseMixture/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/transportModels/incompressible/lnInclude/ -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/OSspecific/MSWindows/lnInclude -c $SOURCE -o Make/cygwin64mingw-w64DPOpt/BirdCarreau.o SOURCE=viscosityModels/HerschelBulkley/HerschelBulkley.C ; x86_64-w64-mingw32-g++ -m64 -Dcygwin64 -DWM_DP -DMSWIN -DLITTLE_ENDIAN -Wall -Wextra -Wno-unused-parameter -Wnon-virtual-dtor -O3 -DNDEBUG -DNoRepository -ftemplate-depth-100 -I.. -I../twoPhaseMixture/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/transportModels/incompressible/lnInclude/ -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/OSspecific/MSWindows/lnInclude -c $SOURCE -o Make/cygwin64mingw-w64DPOpt/HerschelBulkley.o SOURCE=viscosityModels/TempViscosityModel/TempViscosityModel.C ; x86_64-w64-mingw32-g++ -m64 -Dcygwin64 -DWM_DP -DMSWIN -DLITTLE_ENDIAN -Wall -Wextra -Wno-unused-parameter -Wnon-virtual-dtor -O3 -DNDEBUG -DNoRepository -ftemplate-depth-100 -I.. -I../twoPhaseMixture/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/transportModels/incompressible/lnInclude/ -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/OSspecific/MSWindows/lnInclude -c $SOURCE -o Make/cygwin64mingw-w64DPOpt/TempViscosityModel.o SOURCE=transportModel/transportModel.C ; x86_64-w64-mingw32-g++ -m64 -Dcygwin64 -DWM_DP -DMSWIN -DLITTLE_ENDIAN -Wall -Wextra -Wno-unused-parameter -Wnon-virtual-dtor -O3 -DNDEBUG -DNoRepository -ftemplate-depth-100 -I.. -I../twoPhaseMixture/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/transportModels/incompressible/lnInclude/ -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/OSspecific/MSWindows/lnInclude -c $SOURCE -o Make/cygwin64mingw-w64DPOpt/transportModel.o SOURCE=singlePhaseTransportModel/singlePhaseTransportModel.C ; x86_64-w64-mingw32-g++ -m64 -Dcygwin64 -DWM_DP -DMSWIN -DLITTLE_ENDIAN -Wall -Wextra -Wno-unused-parameter -Wnon-virtual-dtor -O3 -DNDEBUG -DNoRepository -ftemplate-depth-100 -I.. -I../twoPhaseMixture/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/transportModels/incompressible/lnInclude/ -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/OSspecific/MSWindows/lnInclude -c $SOURCE -o Make/cygwin64mingw-w64DPOpt/singlePhaseTransportModel.o SOURCE=incompressibleTwoPhaseMixture/incompressibleTwoPhaseMixture.C ; x86_64-w64-mingw32-g++ -m64 -Dcygwin64 -DWM_DP -DMSWIN -DLITTLE_ENDIAN -Wall -Wextra -Wno-unused-parameter -Wnon-virtual-dtor -O3 -DNDEBUG -DNoRepository -ftemplate-depth-100 -I.. -I../twoPhaseMixture/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/transportModels/incompressible/lnInclude/ -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/OSspecific/MSWindows/lnInclude -c $SOURCE -o Make/cygwin64mingw-w64DPOpt/incompressibleTwoPhaseMixture.o '/cygdrive/c/OpenFOAM/csriram91-2.3.x/platforms/cygwin64mingw-w64DPOpt/lib/libuserTempViscosityModel.dll' is up to date. + wmake libso compressible Making dependency files... '/opt/OpenFOAM/OpenFOAM-2.3.x/platforms/cygwin64mingw-w64DPOpt/lib/libcompressibleTransportModels.dll' is up to date. + wmake libso immiscibleIncompressibleTwoPhaseMixture Making dependency files... '/opt/OpenFOAM/OpenFOAM-2.3.x/platforms/cygwin64mingw-w64DPOpt/lib/libimmiscibleIncompressibleTwoPhaseMixture.dll' is up to date. But when I try to run the case using nonNewtonianFoam solver, I get this Create time --> FOAM Warning : From function dlOpen(const fileName&, const bool) in file MSwindows.C at line 1314 \ dlopen error : "Error 126: The specified module could not be found. " --> FOAM Warning : From function dlLibraryTable:pen(const fileName&, const bool) in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 100 could not load "TempViscosityModel.so" Create mesh, no clear-out for time = 0 Reading field p Reading field U Reading/calculating face flux field phi Selecting incompressible transport model TempViscosityModel --> FOAM FATAL ERROR: Unknown viscosityModel type TempViscosityModel Valid viscosityModels are : 5 ( BirdCarreau CrossPowerLaw HerschelBulkley Newtonian powerLaw ) Regards, Ram |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[openSmoke] libOpenSMOKE | Tobi | OpenFOAM Community Contributions | 562 | January 25, 2023 10:21 |
whats the cause of error? | immortality | OpenFOAM Running, Solving & CFD | 13 | March 24, 2021 08:15 |
Time and temperature dependent viscosity | sur4j | OpenFOAM | 16 | January 12, 2015 01:56 |
Herschel-Bulkley non-Newtonian viscosity model has term with sign error | pbryant | OpenFOAM Bugs | 5 | June 19, 2013 00:53 |
Regarding Implementation of Hershel Bulkley Model in Viscosity correlation | Pathak | FLOW-3D | 0 | August 24, 2009 07:34 |