|
[Sponsors] | |||||
write out nusselt number (gradient of T, respectively) for timesteps |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
|
#1 |
|
Member
Sven Winkler
Join Date: May 2009
Posts: 70
Rep Power: 5 ![]() |
I need to calculate a nusselt number for a body in a crossflow for different time steps. Does OpenFOAM provide a function which can do that? If not, can I somehow use the probing function to write out a temperature gradient at a wall, like I can write out fields at certain points? Has anyone ever done something like this? Thanks a lot!
|
|
|
|
|
|
|
|
|
#2 |
|
Senior Member
|
Hi Sven,
You can see how I modified simpleFoam and turbFoam (now its pisoFoam) for determination of Sherwood number: http://openfoamwiki.net/index.php/Co...mpleScalarFoam http://openfoamwiki.net/index.php/Co...turbScalarFoam There is some coding and recompilation involved, but not too difficult. Just make sure you use the adequate dimensions for temperature in place of mass fraction. Regards, Jose Santos |
|
|
|
|
|
|
|
|
#3 |
|
Member
Sven Winkler
Join Date: May 2009
Posts: 70
Rep Power: 5 ![]() |
Hey Sanots,
thanks for your answer. I had a look at your source Code files, especially at simpleScalarFoam.C. I think, what I need is something similar to the following lines in your code: Code:
// Calculates kc and Sh on each patch
Info<< "Calculating kc and Sh" << endl;
label patchi = mesh.boundaryMesh().findPatchID("electrode1");
label patchj = mesh.boundaryMesh().findPatchID("electrode2");
// kc = 1 / Tb * D * (dT/dy)_wall
kc.boundaryField()[patchi] =
1/Tb.value()*DT.value()*-T.boundaryField()[patchi].snGrad();
kc.boundaryField()[patchj] =
1/Tb.value()*DT.value()*-T.boundaryField()[patchj].snGrad();
Code:
label patchi = mesh.boundaryMesh().findPatchID("myPatch");
gradT.boundaryField()[patchi]=T.boundaryField()[patchi].snGrad();
and at the end of the code I need something like Code:
volScalarField output
(
IOobject
(
"Sh",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
output=gradT
);
runTime.write();
|
|
|
|
|
|
|
|
|
#4 |
|
Senior Member
|
Yes, you are on the right track. Look below for my suggestion. Regards!
Code:
volScalarField gradT
(
IOobject
(
"gradT",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedVector
(
"gradT",
T.dimensions()/dimLength,
0
)
);
label patchi = mesh.boundaryMesh().findPatchID("myPatch");
gradT.boundaryField()[patchi]=T.boundaryField()[patchi].snGrad();
runTime.write();
|
|
|
|
|
|
|
|
|
#5 |
|
Member
Sven Winkler
Join Date: May 2009
Posts: 70
Rep Power: 5 ![]() |
Thanks a lot Santos, I got it working. The solver now writes out the gradT for myPatch in every time directory. However, I want the solver to write all these data only in one file instead of several files. I think I can perhaps use the probe function, but I dont know how to probe on a patch. Do you know how this works or do you have another idea? Thank you very much! I really appreciate your help!
Sven |
|
|
|
|
|
|
|
|
#6 |
|
Senior Member
|
I am not familiar with the probe function, sorry. I normally extract gradT values in one file in other way:
1 - Make your solver write gradT on the screen with the patch name, normally you want an area-averaged value. Look in the solvers I mentioned above for guidance. 2 - Launch the simulation and redirect your output to a log file Code:
simpleScalarFoam > log & Code:
grep <your_patch> <log_file> | awk '{print $8}' > gradTvalues
Regards, Jose Santos |
|
|
|
|
|
|
|
|
#7 |
|
New Member
Nabil
Join Date: Dec 2009
Posts: 7
Rep Power: 5 ![]() |
hi all
i m intersseted by this topic and i will try it to calculate nusselt number, my quastion is how integrate "gradT" over the patch using any intagration method availble or not in openfoam "trapez, simpson, RkX, ..." regards |
|
|
|
|
|
|
|
|
#8 |
|
Member
Goutam Saha
Join Date: Dec 2011
Location: UK
Posts: 91
Rep Power: 3 ![]() |
Dear Santos,
Thanks for your help. I have written the code in the file buoyantBousseinsqSimpleFoam.C. After that when I set wmake, then I am getting error. Is this code is ok? I want to calculate GradT. |
|
|
|
|
|
|
|
|
#9 |
|
New Member
|
Hi Goutam,
Have you solved your problem of calculating GradT in buoyantBousseinsqSimpleFoam? I am also very interested in this case. |
|
|
|
|
|
|
|
|
#10 |
|
Member
Goutam Saha
Join Date: Dec 2011
Location: UK
Posts: 91
Rep Power: 3 ![]() |
No. But I have calculated local and Average Nusselt number. You can see my post on this. I gave the code.
|
|
|
|
|
|
|
|
|
#11 | |
|
New Member
giovanni silva
Join Date: Jul 2010
Posts: 14
Rep Power: 4 ![]() |
Quote:
Did you finally find a solution to your problem? Unfortunately, I`m not an expert in C++. So, It is too difficult for me. I would like to calculate the average Nusselt number. I am working on a 2D laterally and volumetrically heated square cavity. I have seen your discussion here. Could you help me? Thanks in advance! |
||
|
|
|
||
|
|
|
#12 |
|
New Member
刘朝福
Join Date: May 2013
Posts: 8
Rep Power: 2 ![]() |
Hi Goutam.Can you tell me how to calculated local and Average Nusselt number.Thank you .
|
|
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem with decomposePar tool | vinz | OpenFOAM Pre-Processing | 18 | January 26, 2011 02:17 |
| UDF for Nusselt Number | preibie | FLUENT | 1 | November 16, 2010 21:28 |
| DecomposePar unequal number of shared faces | maka | OpenFOAM Pre-Processing | 6 | August 12, 2010 09:01 |
| BlockMeshmergePatchPairs | hjasak | OpenFOAM Native Meshers: blockMesh | 11 | August 15, 2008 07:36 |
| Trimmed cell and embedded refinement mesh conversion issues | michele | OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... | 2 | July 15, 2005 04:15 |