|
[Sponsors] |
Problem with transport properties depending on Temperature |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 24, 2005, 04:35 |
Hello everybody,
I'm actual
|
#1 |
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 |
|
November 24, 2005, 07:25 |
Thats because T is not declare
|
#2 |
Senior Member
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 21 |
Thats because T is not declared in the top level code. Try thermo->T()
|
|
November 24, 2005, 08:18 |
Thank you Eugene: it's work we
|
#3 |
Guest
Posts: n/a
|
Thank you Eugene: it's work well.
|
|
December 5, 2005, 13:03 |
Dear Frédéric LAGO:
Could
|
#4 |
Senior Member
Guoxiang
Join Date: Mar 2009
Posts: 109
Rep Power: 17 |
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 |
|
December 6, 2005, 03:59 |
Dear Guoxiang,
line 116 try
|
#5 |
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 |
|
December 6, 2005, 13:51 |
Dear Frédéric LAGO:
Thanks
|
#6 |
Senior Member
Guoxiang
Join Date: Mar 2009
Posts: 109
Rep Power: 17 |
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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ReactingFoam Laminar flame simulation transport properties | gbansal | OpenFOAM Running, Solving & CFD | 3 | November 23, 2012 17:03 |
Transport properties with PPDF combustion | Erik | Siemens | 0 | February 18, 2009 06:18 |
Laminar diffusion flames and reactingFoam Transport properties | jgaricano | OpenFOAM Running, Solving & CFD | 0 | June 4, 2008 17:58 |
the material parameters depending on temperature | Jason | CFX | 4 | December 22, 2006 20:54 |
transport properties of gases | cfd sutdent | Main CFD Forum | 2 | April 29, 2004 10:41 |