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

Using temperature to modify viscosity

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 19, 2022, 10:46
Exclamation Using temperature to modify viscosity
  #1
New Member
 
Join Date: Mar 2022
Posts: 4
Rep Power: 4
jtei99 is on a distinguished road
Hi! I'm rather new to OpenFoam, and I'm trying to use temperature to define viscosity. What I'd like is for viscosity to remain "normal" (I'm using a polynomial model for it) while temperature is below a certain value. But when temperature is over it, I want the viscosity to be 100 or 1000 times higher so that it acts sort of as a solid particle.

I've tried multiple things I've seen in this forum with no success. I've created a modified polynomial transport file, but whatever I've done to try to modify it to do what I want, it complains when I compile.

The last thing I tried is:
template<class Thermo, int PolySize>
Foam:olynomialSplitTransport<Thermo, PolySize>:olynomialSplitTransport
(
const dictionary& dict
)
:
/* if (Thermo.T()).value() > 293) */
Thermo(dict),
{
if (T.field() > 293)
{
// temperature over soldification temperature
muCoeffs_
(
dict.subDict("transport").lookup
(
"muCoeffs<" + Foam::name(PolySize) + '>'
)
),
kappaCoeffs_
(
dict.subDict("transport").lookup
(
"kappaCoeffs<" + Foam::name(PolySize) + '>'
)
);
}
else
{
// solidification due to temperature below solidification temperature
// here i should change the definition of viscosity so it is 100 o 1000x higher
muCoeffs_
(
dict.subDict("transport").lookup
(
"muCoeffs<" + Foam::name(PolySize) + '>'
)
),
kappaCoeffs_
(
dict.subDict("transport").lookup
(
"kappaCoeffs<" + Foam::name(PolySize) + '>'
)
);
}
}

{}

But I get the following error when compiling:
In file included from lnInclude/polynomialSplitTransport.H:218,
from lnInclude/thermoPhysicsTypes.H:54,
from lnInclude/reactionTypes.H:35,
from reaction/reactions/makeReactions.C:26:
lnInclude/polynomialSplitTransport.C: In constructor ‘Foam:olynomialSplitTransport<Thermo, PolySize>:olynomialSplitTransport(const Foam::dictionary&)’:
lnInclude/polynomialSplitTransport.C:39:5: error: expected identifier before ‘{’ token
39 | {
| ^
lnInclude/polynomialSplitTransport.C:40:11: error: ‘T’ was not declared in this scope
40 | if (T.field() > 293)
| ^
lnInclude/polynomialSplitTransport.C: At global scope:
lnInclude/polynomialSplitTransport.C:78:1: error: expected unqualified-id before ‘{’ token
78 | {}
| ^
make: *** [/opt/openfoam7/wmake/rules/General/transform:26: Make/linux64GccDPInt32Opt/reaction/reactions/makeReactions.o] Error 1


I think if I'm able to "call" the temperature correctly it should work, but i dont know exactly how to call it as to use it in the condition of the if structure.
jtei99 is offline   Reply With Quote

Reply


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
Temperature dependent viscosity QaisKhraisat CFX 11 August 20, 2022 12:50
Time and temperature dependent viscosity sur4j OpenFOAM 16 January 12, 2015 01:56
Calculation of the Governing Equations Mihail CFX 7 September 7, 2014 07:27
viscosity defined by pressure and temperature bleseb FLUENT 1 January 17, 2014 10:31
Viscosity for Granular Temperature Model vagaikwa FLUENT 0 February 24, 2013 04:42


All times are GMT -4. The time now is 01:07.