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

Problem with transport properties depending on Temperature

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 24, 2005, 03:35
Default Hello everybody, I'm actual
  #1
galaad
Guest
 
Posts: n/a
Hello everybody,

I'm actually modifying the buoyantSimpleFoam solver in order to introduce transport coefficients depending on temperature. But I'm encountering a problem. The energy conservation is solved with the enthalpy value and I want to access to the temperature value in order to interpolate transport coefficients - like the viscosity - with the temperature. The viscosity I used is written in an external file "mu.txt" and it's tabulated with the temperature all the 100K. I've written the code like that:

f=fopen("/home/fvm/OpenFOAM/fvm-1.2/run/tutorials/buoyantSimpleFoam/test/0/mu.tx t","r");
fscanf(f,"%d",&Nmu); // Reading if the total number of the value Nmu
for (int i=0; i<Nmu; i++)
{
fscanf(f,"%lf",&TT_temp[i]); // Reading of the temperature values
}
for (int i=0; i<Nmu; i++)
{
fscanf(f,"%lf",&Tmu_temp[i]); // Reading of the viscosity values
}
fclose(f);

(sorry for using C programming but I'm not easy with C++ programming)

scalarField& muInternal = mu.internalField();
const scalarField& TInternal = T.internalField(); (or T_.internalField();)

forAll (muInternal, cellI)
{
muInternal[cellI] = Interpolate(TInternal[cellI], Tmu_temp, TT_temp, Nmu);
}

But errors appears when I compiled the code: with T, there is not enough information and with T_, T_ it's not declared in this code.

The way I'm using is it wrong or just the programming is incomplete?

Thank you for your answers or comments.

F. LAGO
  Reply With Quote

Old   November 24, 2005, 06:25
Default Thats because T is not declare
  #2
Senior Member
 
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 21
eugene is on a distinguished road
Thats because T is not declared in the top level code. Try thermo->T()
eugene is offline   Reply With Quote

Old   November 24, 2005, 07:18
Default Thank you Eugene: it's work we
  #3
galaad
Guest
 
Posts: n/a
Thank you Eugene: it's work well.
  Reply With Quote

Old   December 5, 2005, 12:03
Default Dear Frédéric LAGO: Could
  #4
Senior Member
 
Guoxiang
Join Date: Mar 2009
Posts: 109
Rep Power: 17
liugx212 is on a distinguished road
Dear Frédéric LAGO:

Could you help me see my code and errors. I think maybe, I miss some header files. 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   December 6, 2005, 02:59
Default Dear Guoxiang, line 116 try
  #5
galaad
Guest
 
Posts: n/a
Dear Guoxiang,

line 116 try:
const scalarField& nuInternal = nu.internalField();
instead of:
volScalarField& nuInternal = nu.internalField();
Try the same thing line 125.
Line 134 your value E is not declared or not solved in your code...

Frédéric LAGO
  Reply With Quote

Old   December 6, 2005, 12:51
Default Dear Frédéric LAGO: Thanks
  #6
Senior Member
 
Guoxiang
Join Date: Mar 2009
Posts: 109
Rep Power: 17
liugx212 is on a distinguished road
Dear Frédéric LAGO:

Thanks for your help. But I was also same errors. I will try again and ask for you.

Thanks a lot.
Guoxiang
liugx212 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
ReactingFoam Laminar flame simulation transport properties gbansal OpenFOAM Running, Solving & CFD 3 November 23, 2012 16:03
Transport properties with PPDF combustion Erik Siemens 0 February 18, 2009 05:18
Laminar diffusion flames and reactingFoam Transport properties jgaricano OpenFOAM Running, Solving & CFD 0 June 4, 2008 16:58
the material parameters depending on temperature Jason CFX 4 December 22, 2006 19:54
transport properties of gases cfd sutdent Main CFD Forum 2 April 29, 2004 09:41


All times are GMT -4. The time now is 18:43.