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

Temperaturedependent material properties

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 30, 2005, 09:15
Default Hi, how can I use temperatu
  #1
New Member
 
Juergen Almanstoetter
Join Date: Mar 2009
Posts: 10
Rep Power: 17
almanstoetter is on a distinguished road
Hi,

how can I use temperature-dependent material properties in OpenFOAM given as ASCII data for thermal conductivity, viscosity at specific temperatures ? Is there a simple way to read in this data ?

Thanks,
Juergen
almanstoetter is offline   Reply With Quote

Old   May 30, 2005, 22:04
Default You will need to write some co
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
You will need to write some code for it yourself. If you want to use straight interpolation between your data points, there's the "interpret graph" stuff - should be described in the manual.

However, the thermodynamicalProperties library contains a lot of pre-packaged temperature- and pressure-dependent material properties for liquids and gasses. Unless you're doing something pretty exotic, the chance is that the data (e.g. JANAF tables or similar) is already there, ready to use.

Enjoy,

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   June 6, 2005, 12:55
Default Sorry, but I can't find any "i
  #3
New Member
 
Juergen Almanstoetter
Join Date: Mar 2009
Posts: 10
Rep Power: 17
almanstoetter is on a distinguished road
Sorry, but I can't find any "interpret graph" stuff in the manual.
Actually, I wanted to modify the laplacianFoam/flange example to use a temperature-dependent thermal conductivity for the solid, given as temperature/data pairs.
How can I change the scalar variable DT to represent thermal conductivity which is linear interpolated between the data points:

...
solve
(
fvm::ddt(T) - fvm::laplacian(DT, T)
);
...

Gas or liquid properties are not applicable here.

Thanks,
Juergen
almanstoetter is offline   Reply With Quote

Old   June 7, 2005, 09:50
Default Heya, In that case, you wil
  #4
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
Heya,

In that case, you will need to make a field DT and fill it in yourself using the values form the lookup table.

Two things for you:

An example for the interpolation part from the graph (i.e. you give me a graph and an x and I give you a value) can be found in:

OpenFOAM-1.1/src/engine/engineValve

have a look at: engineValve.C, line 174:

Foam::scalar Foam::engineValve::lift(const scalar theta) const

return interpolateXY
(
adjustCrankAngle(theta),
liftProfile_.x(),
liftProfile_.y()
);


Here, I calculate the crank angle such that it falls between the ends of the graph and then "read off" the graph value using interpolateXY. InterpolateXY lives in the sampling library in src.

Yo can also find examples on how I read in the graph etc in the same class.

The second bit yo need is to make a field and fill it in with values. It's is done like this (below).

In this function I make a temporary field and fill it with values of brick_.cpVapour - instead of this, you will be using interpolateXY. If you wish, you can make and fill in the field straight in the main code, avoiding the function and all this tmp field stuff.

Enjoy,

Hrv


Foam::tmp<foam::volscalarfield> Foam::brickState::cpVapour() const
{
tmp<volscalarfield> tcpVapour
(
new volScalarField
(
IOobject
(
"cpVapourTmp",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_,
dimSpecificHeatCapacity
)
);

volScalarField& cp = tcpVapour();

scalarField& cpInternal = cp.internalField();
const scalarField& TInternal = T_.internalField();

forAll (cpInternal, cellI)
{
cpInternal[cellI] = brick_.cpVapour(TInternal[cellI]);
}

forAll (cp.boundaryField(), patchI)
{
scalarField& patchCp = cp.boundaryField()[patchI];

const scalarField& patchT = T_.boundaryField()[patchI];

forAll (patchCp, faceI)
{
patchCp[faceI] = brick_.cpVapour(patchT[faceI]);
}
}

return tcpVapour;
}
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   December 5, 2005, 14:33
Default Dear All: Could you help me
  #5
Senior Member
 
Guoxiang
Join Date: Mar 2009
Posts: 109
Rep Power: 17
liugx212 is on a distinguished road
Dear All:

Could you help me see my code and errors. I do know what is wrong in it. Please give some advice.

// set the nu for each cell
116: volScalarField& nuInternal = nu.internalField();
forAll (nuInternal, celli)
{
if (componentValue[celli] > 0)
nuInternal[celli] = 0.3;
else nuInternal[celli] = 0.1;
}
// set the rho for each cell
125: volScalarField& rhoInternal = rho.internalField();
forAll (rhoInternal, celli)
{
if (componentValue[celli] > 0)
rhoInternal[celli] = 2000000;
else rhoInternal[celli] = 20000;
}

// set the E for each cell
134: volScalarField& EInternal = E.internalField();
forAll (EInternal, celli)
{
if (componentValue[celli] > 0)
EInternal[celli] = 7854;
else EInternal[celli] = 1000;
}

Error as:

stressedFoam.C:116: error: 'struct Foam::dimensionedScalar' has no member named 'internalField'
stressedFoam.C:125: error: 'struct Foam::dimensionedScalar' has no member named 'internalField'
stressedFoam.C:134: error: 'E' was not declared in this scope
stressedFoam.C:134: error: '<typeprefixerror>E' previously declared here



Thanks deeply,
Guoxiang
liugx212 is offline   Reply With Quote

Old   April 23, 2009, 07:48
Default
  #6
Member
 
Marco Müller
Join Date: Mar 2009
Location: Germany
Posts: 94
Rep Power: 17
marico is on a distinguished road
Hi,

has anyone done something like descibed above? I could need a temperature dependant viscosity (probably also conductivity)! (with topological changes...)

Thanks
Marco
marico is offline   Reply With Quote

Old   June 27, 2012, 08:17
Default
  #7
Member
 
Anja Miehe
Join Date: Dec 2009
Location: Freiberg / Germany
Posts: 48
Rep Power: 16
AnjaMiehe is on a distinguished road
This thread is quite old, I know. For anyone crossing this while looking for "how to implement temperature dependent thermophysical properties and interpolate them on the mesh": the answer is given in this post:

http://www.cfd-online.com/Forums/ope...ies-false.html

Have fun, Anja
AnjaMiehe 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
Material properties Andrew Clarke Main CFD Forum 6 September 16, 2008 13:55
material properties rayy FLUENT 1 March 28, 2007 17:23
Material properties rayy FLUENT 0 February 25, 2007 22:16
Material Properties Ravi FLUENT 3 July 14, 2006 22:54
material properties of NiO sean FLUENT 0 March 26, 2001 11:32


All times are GMT -4. The time now is 22:35.