|
[Sponsors] |
September 25, 2018, 06:14 |
Unknown viscosityModel type temppowerLaw
|
#1 |
New Member
shivani gupta
Join Date: Sep 2018
Posts: 9
Rep Power: 8 |
I have modified the viscosity model giving viscosity variation with temperature. It has been compiled successfully but while running a case with transportModel mentioned as temppowerLaw, it is unable to identify it.The error is
--> FOAM FATAL ERROR: Unknown viscosityModel type temppowerLaw Valid viscosityModels are : 7 ( BirdCarreau Casson CrossPowerLaw HerschelBulkley Newtonian powerLaw strainRateFunction ) From function static Foam::autoPtr<Foam::viscosityModel> Foam::viscosityModel::New(const Foam::word&, const Foam::dictionary&, const volVectorField&, const surfaceScalarField&) in file viscosityModels/viscosityModel/viscosityModelNew.C at line 49. FOAM exiting The code is: #include "temppowerLaw.H" #include "addToRunTimeSelectionTable.H" #include "surfaceFields.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { namespace viscosityModels { defineTypeNameAndDebug(temppowerLaw, 0); addToRunTimeSelectionTable ( viscosityModel, temppowerLaw, dictionary ); } } // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // Foam::tmp<Foam::volScalarField> Foam::viscosityModels::temppowerLaw::calcNu() const { const volScalarField& T=U_.mesh().lookupObject<volScalarField>("T"); // added return max ( nuMin_, min ( nuMax_, //k_*pow (k_-kslope_*(T-Tbase_))*pow //added ( max ( dimensionedScalar("one", dimTime, 1.0)*strainRate(), dimensionedScalar("small", dimless, small) ), n_.value() - scalar(1) ) ) ); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::viscosityModels::temppowerLaw::temppowerLaw ( const word& name, const dictionary& viscosityProperties, const volVectorField& U, const surfaceScalarField& phi ) : viscosityModel(name, viscosityProperties, U, phi), temppowerLawCoeffs_(viscosityProperties.optionalSu bDict(typeName + "Coeffs")), k_("k", dimViscosity, temppowerLawCoeffs_), n_("n", dimless, temppowerLawCoeffs_), kslope_(temppowerLawCoeffs_.lookup("kslope")), //added Tbase_(temppowerLawCoeffs_.lookup("Tbase")), nuMin_("nuMin", dimViscosity, temppowerLawCoeffs_), nuMax_("nuMax", dimViscosity, temppowerLawCoeffs_), nu_ ( IOobject ( name, U_.time().timeName(), U_.db(), IOobject::NO_READ, IOobject::AUTO_WRITE ), calcNu() ) {} // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // bool Foam::viscosityModels::temppowerLaw::read ( const dictionary& viscosityProperties ) { viscosityModel::read(viscosityProperties); temppowerLawCoeffs_ = viscosityProperties.optionalSubDict(typeName + "Coeffs"); temppowerLawCoeffs_.lookup("k") >> k_; temppowerLawCoeffs_.lookup("n") >> n_; temppowerLawCoeffs_.lookup("kslope") >> kslope_; //added temppowerLawCoeffs_.lookup("Tbase") >> Tbase_; temppowerLawCoeffs_.lookup("nuMin") >> nuMin_; temppowerLawCoeffs_.lookup("nuMax") >> nuMax_; return true; } Please help! |
|
September 25, 2018, 06:57 |
|
#2 |
Senior Member
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16 |
Did you include the path of the library you compiled in the controlDict like:
libs("path/yourlib.so") |
|
September 25, 2018, 07:21 |
|
#3 |
New Member
shivani gupta
Join Date: Sep 2018
Posts: 9
Rep Power: 8 |
In controlDict it is required to write solver name right?, in transportproperties of constant folder the transportModel is mentioned
controlDict: FoamFile { version 2.0; format ascii; class dictionary; location "system"; object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application temperaturesimpleFoam; startFrom startTime; startTime 0; stopAt endTime; endTime 2000; deltaT 1; writeControl timeStep; writeInterval 100; purgeWrite 0; writeFormat ascii; writePrecision 6; writeCompression off; timeFormat general; timePrecision 6; runTimeModifiable true; functions { #includeFunc streamlines } transportProperties: FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object transportProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // transportModel temppowerLaw; nu [0 2 -1 0 0 0 0] 1e-05; temppowerLawCoeffs { k [0 2 -1 0 0 0 0] 2800; n [0 0 0 0 0 0 0] 0.64; kslope [0 2 -1 -1 0 0 0] 0.5; Tbase [0 0 0 1 0 0 0] 300; nuMin [0 2 -1 0 0 0 0] 0.1; nuMax [0 2 -1 0 0 0 0] 10000000; } TempD [ 0 2 -1 0 0 0 0] 1e-8; |
|
September 25, 2018, 08:06 |
|
#4 |
New Member
shivani gupta
Join Date: Sep 2018
Posts: 9
Rep Power: 8 |
I changed in controlDict file as:My library is in /src/transportModels/incompressible/viscosityModels/temppowerLaw
FoamFile { version 2.0; format ascii; class dictionary; location "system"; object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // libs ("src/transportModels/incompressible/viscosityModels/temppowerLaw.so"); application temperaturesimpleFoam; startFrom startTime; startTime 0; stopAt endTime; endTime 2000; deltaT 1; writeControl timeStep; writeInterval 100; purgeWrite 0; writeFormat ascii; writePrecision 6; writeCompression off; timeFormat general; timePrecision 6; runTimeModifiable true; functions { #includeFunc streamlines } Tried with 1.libs ("src/transportModels/incompressible/viscosityModels/temppowerLaw/temppowerLaw.so"); 2. libs ("libtemppowerLaw.so"); |
|
September 25, 2018, 08:22 |
|
#5 |
New Member
shivani gupta
Join Date: Sep 2018
Posts: 9
Rep Power: 8 |
While compiling .so file is not created in linux64GccDPInt32Opt
msg displayed after compiling wmake libso . wmakeLnInclude: linking include files to ./lnInclude Making dependency list for source file temppowerLaw.C g++ -std=c++11 -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 -Wno-attributes -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam6/src/transportModels/incompressible/lnInclude -I/opt/openfoam6/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam6/src/OpenFOAM/lnInclude -I/opt/openfoam6/src/OSspecific/POSIX/lnInclude -fPIC -c temppowerLaw.C -o Make/linux64GccDPInt32Opt/temppowerLaw.o g++ -std=c++11 -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 -Wno-attributes -O3 -DNoRepository -ftemplate-depth-100 -I/opt/openfoam6/src/transportModels/incompressible/lnInclude -I/opt/openfoam6/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam6/src/OpenFOAM/lnInclude -I/opt/openfoam6/src/OSspecific/POSIX/lnInclude -fPIC -shared -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPInt32Opt/temppowerLaw.o -L/opt/openfoam6/platforms/linux64GccDPInt32Opt/lib \ -lfiniteVolume -o /home/shivani/OpenFOAM/root-6/platforms/linux64GccDPInt32Opt/lib/temppowerLaw.so |
|
September 25, 2018, 08:56 |
|
#6 |
Senior Member
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16 |
It is probably created in /home/shivani/OpenFOAM/root-6/platforms/linux64GccDPInt32Opt/lib/temppowerLaw.so
|
|
September 28, 2018, 09:01 |
|
#7 |
New Member
shivani gupta
Join Date: Sep 2018
Posts: 9
Rep Power: 8 |
Thank You !! So much. I wrote the path in controlDict file and it has identified the new library
|
|
October 31, 2021, 15:18 |
|
#8 |
New Member
Abbas
Join Date: Dec 2019
Posts: 3
Rep Power: 7 |
Hello.
I have the same problem, and I wrote in the controlDict the libs with the correct path to it, but unfortunately the problem was not solved, and I am getting the following message again: --> FOAM FATAL ERROR: Unknown viscosityModel type tempdeppowerLaw Valid viscosityModels are : 7 ( BirdCarreau Casson CrossPowerLaw HerschelBulkley Newtonian powerLaw strainRateFunction ) From function static Foam::autoPtr<Foam::viscosityModel> Foam::viscosityModel::New(const Foam::word&, const Foam::dictionary&, const volVectorField&, const surfaceScalarField&) in file viscosityModels/viscosityModel/viscosityModelNew.C at line 49. FOAM exiting can you please help me discover the problem? Thank you in advance |
|
November 4, 2024, 23:00 |
|
#9 |
New Member
Join Date: Jun 2024
Posts: 7
Rep Power: 2 |
Could you please tell me how did you write the path correctly? thank you
|
|
November 5, 2024, 03:43 |
|
#10 | |
New Member
Join Date: Jun 2024
Posts: 7
Rep Power: 2 |
Quote:
|
||
Tags |
modifying model |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with continuity simpleFoam kkl omega airfoils | ibelunatic | OpenFOAM Running, Solving & CFD | 0 | March 20, 2018 12:48 |
Time step continuity error | lpz_michele | OpenFOAM Running, Solving & CFD | 0 | October 12, 2015 07:05 |
Strange high velocity in centrifugal pump simulation | huangxianbei | OpenFOAM Running, Solving & CFD | 26 | August 15, 2014 03:27 |
[OpenFOAM] Saving ParaFoam views and case | sail | ParaView | 9 | November 25, 2011 16:46 |
compressible two phase flow in CFX4.4 | youngan | CFX | 0 | July 2, 2003 00:32 |