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

Unknown viscosityModel type temppowerLaw

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By mAlletto

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 25, 2018, 06:14
Default Unknown viscosityModel type temppowerLaw
  #1
New Member
 
shivani gupta
Join Date: Sep 2018
Posts: 9
Rep Power: 8
shivani17 is on a distinguished road
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!
shivani17 is offline   Reply With Quote

Old   September 25, 2018, 06:57
Default
  #2
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16
mAlletto will become famous soon enough
Did you include the path of the library you compiled in the controlDict like:

libs("path/yourlib.so")
mAlletto is offline   Reply With Quote

Old   September 25, 2018, 07:21
Default
  #3
New Member
 
shivani gupta
Join Date: Sep 2018
Posts: 9
Rep Power: 8
shivani17 is on a distinguished road
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;
shivani17 is offline   Reply With Quote

Old   September 25, 2018, 08:06
Default
  #4
New Member
 
shivani gupta
Join Date: Sep 2018
Posts: 9
Rep Power: 8
shivani17 is on a distinguished road
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");
shivani17 is offline   Reply With Quote

Old   September 25, 2018, 08:22
Default
  #5
New Member
 
shivani gupta
Join Date: Sep 2018
Posts: 9
Rep Power: 8
shivani17 is on a distinguished road
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
shivani17 is offline   Reply With Quote

Old   September 25, 2018, 08:56
Default
  #6
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16
mAlletto will become famous soon enough
It is probably created in /home/shivani/OpenFOAM/root-6/platforms/linux64GccDPInt32Opt/lib/temppowerLaw.so
shivani17 likes this.
mAlletto is offline   Reply With Quote

Old   September 28, 2018, 09:01
Default
  #7
New Member
 
shivani gupta
Join Date: Sep 2018
Posts: 9
Rep Power: 8
shivani17 is on a distinguished road
Thank You !! So much. I wrote the path in controlDict file and it has identified the new library
shivani17 is offline   Reply With Quote

Old   October 31, 2021, 15:18
Default
  #8
New Member
 
Abbas
Join Date: Dec 2019
Posts: 3
Rep Power: 6
aa399@aub.edu.lb is on a distinguished road
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
aa399@aub.edu.lb is offline   Reply With Quote

Old   Yesterday, 23:00
Default
  #9
New Member
 
Join Date: Jun 2024
Posts: 7
Rep Power: 2
Huy_Nguyen is on a distinguished road
Could you please tell me how did you write the path correctly? thank you
Huy_Nguyen is online now   Reply With Quote

Old   Today, 03:43
Default
  #10
New Member
 
Join Date: Jun 2024
Posts: 7
Rep Power: 2
Huy_Nguyen is on a distinguished road
Quote:
Originally Posted by aa399@aub.edu.lb View Post
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
hi, did you solve the problem? if yes, could you please tell me how? Thank you and all the best.
Huy_Nguyen is online now   Reply With Quote

Reply

Tags
modifying model


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
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


All times are GMT -4. The time now is 04:25.