|
[Sponsors] |
July 11, 2017, 21:01 |
calculate Nusselt number
|
#1 |
Senior Member
alberto
Join Date: Apr 2016
Location: Mexico
Posts: 119
Rep Power: 10 |
It is possible calculate the nusselt number (local, average) with openFoam or with paraview?
I did my simulation with buoyantSimpleFoam |
|
July 12, 2017, 04:33 |
|
#2 |
Senior Member
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 21 |
I use swak4Foam for that purpose.
I have attached a topoSetDict and a NusseltDict that I have used. topoSet creates several horizontal planes, because I have had my NusseltDict calculate the Nusselt number at 10 different planes in order to see whether they yield the same value. NusseltDict calculates the Nusselt number for each of those planes. Note that NusseltDict requires some physical parameters, like (height of domain) and (thermal diffusivity). Therefore, I use NusseltDict.template to generate NusseltDict using pyFoamFromTemplate.py. Altogether, my prepareCase.sh script looks like (I am only showing the part relevant for the Nusselt number): Code:
## Define variables Wy=2 # Calculate alpha nu=`grep 'nu \[0 2' constant/transportProperties | sed 's/^[^0-9]*[-(0-9) ]*\] //' | sed 's/;//g'` Pr=`grep 'Pr \[0 ' constant/transportProperties | sed 's/^[^0-9]*[-(0-9) ]*\] //' | sed 's/;//g'` nu=`echo ${nu} | sed -e 's/[eE]+*/\\*10\\^/'` Pr=`echo ${Pr} | sed -e 's/[eE]+*/\\*10\\^/'` alpha=`echo "($nu)/($Pr)" | bc -l` # Get temperatures Ts=(`grep 'value' "0/T.org" | sed -e 's/\s*value\s*uniform\s*//' | sed 's/;//'`) Ts=(`echo ${Ts[@]} | sed -e 's/[eE]+*/\\*10\\^/'`) dT=`echo "${Ts[1]}-1*${Ts[0]}" | bc -l | sed 's/-//'` Tm=`echo "(${Ts[1]}+1*${Ts[0]})/2" | bc -l` # PARAMETERS_NUSSELT="{'alpha':$alpha,'dT':$dT,'H':$Wy}" echo "Parameters_Nusselt: $PARAMETERS_NUSSELT" ## Write dictionaries: pyFoamFromTemplate.py ./system/NusseltDict $PARAMETERS_NUSSELT || exit 1 ## Mesh echo "----> blockMesh" blockMesh > ./logs/blockMesh.log || exit 1 ## TopoSet echo "----> topoSet" topoSet > ./logs/topoSet.log || exit 1 Code:
functions { //work-around: otherwise mesh is NULL during construction of FuncObjs. doInit { type initSwakFunctionObject; } #include "NusseltDict" } libs ( "libOpenFOAM.so" "libsimpleFunctionObjects.so" "libsimpleSwakFunctionObjects.so" "libswakFunctionObjects.so" "libswakTopoSources.so" ); If you want to post-process it after the simulation, have a look at OF's "postProcess" tool, which can execute FunctionObjects after runtime. |
|
November 26, 2018, 11:00 |
|
#3 |
New Member
Arthur
Join Date: Oct 2018
Location: Glasgow
Posts: 20
Rep Power: 8 |
Hi,
I'm looking to get this plane creation/Nusselt calculation working using your method, however I get the following error after running topoSet: Code:
--> FOAM FATAL ERROR: Unknown topoSetSource type expressionToFace Valid topoSetSource types : 45 ( boundaryToFace boxToCell boxToFace boxToPoint cellToCell cellToFace cellToPoint cylinderAnnulusToCell cylinderAnnulusToFace cylinderToCell cylinderToFace faceToCell faceToFace faceToPoint faceZoneToCell faceZoneToFaceZone fieldToCell labelToCell labelToFace labelToPoint nbrToCell nearestToCell nearestToPoint normalToFace patchToFace pointToCell pointToFace pointToPoint regionToCell regionToFace rotatedBoxToCell searchableSurfaceToFaceZone setAndNormalToFaceZone setToCellZone setToFaceZone setToPointZone setsToFaceZone shapeToCell sphereToCell surfaceToCell surfaceToPoint targetVolumeToCell zoneToCell zoneToFace zoneToPoint ) From function static Foam::autoPtr<Foam::topoSetSource> Foam::topoSetSource::New(const Foam::word&, const Foam::polyMesh&, const Foam::dictionary&) in file sets/topoSetSource/topoSetSource.C at line 85. FOAM exiting I have also included the libraries in the controlDict that are included in the above post by 'floquation'. I am also using OpenFOAM 6. Any more information required can be supplied. Thanks in advance! Arthur Last edited by amdk136; November 27, 2018 at 05:55. Reason: Adding information |
|
November 28, 2018, 06:26 |
|
#4 |
Senior Member
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 21 |
My guess would be that your swak4Foam is indeed not working, as "expressionToFace" is part of swak, but it is not found.
But if that's the case, I'd expect to see warnings in your log file above the error message you copied. Warnings like "...swak... library not found". Are there any such warnings in your output? I assume you already installed a version compatible with OF-6? Installation Problem with OF 6 version |
|
November 28, 2018, 06:49 |
|
#5 | |
New Member
Arthur
Join Date: Oct 2018
Location: Glasgow
Posts: 20
Rep Power: 8 |
Hi again,
Here is the rest of the log file from the beginning, there doesn't seem to be any mention about not being able to read swak libraries. Quote:
I am quite new to OpenFOAM so this is all a bit overwhelming, but thank you for your reply - it's appreciated. Arthur |
||
November 28, 2018, 11:09 |
|
#6 | ||
Senior Member
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 21 |
Quote:
Quote:
|
|||
November 29, 2018, 09:13 |
|
#7 |
New Member
Arthur
Join Date: Oct 2018
Location: Glasgow
Posts: 20
Rep Power: 8 |
Floquation,
Thank you again for your reply. It turns out that it was an issue with Swak not compiling correctly. My supervisor has corrected the problem just this morning. The planes now generate. With regards to being a beginner, I have only recently begun to use Linux so I am still trying to figure it out, although with your help I've also learned what's wrong and how to rectify it. Small steps at a time. Thank you for your help, it is much appreciated! Arthur |
|
April 24, 2019, 11:16 |
|
#8 |
Member
Farshad
Join Date: Sep 2010
Posts: 36
Rep Power: 16 |
Hi guys;
I have written a function object via swak4FOAM for nusselt number calculation. Is there any cases to verify this code? I know that the best verification is to compare modeling results with analytical solutions. But I need an OpenFOAM case. highly appreciated |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[General] Extracting ParaView Data into Python Arrays | Jeffzda | ParaView | 30 | November 6, 2023 22:00 |
decomposePar pointfield | flying | OpenFOAM Running, Solving & CFD | 28 | December 30, 2013 16:05 |
AMI interDyMFoam for mixer | danny123 | OpenFOAM Running, Solving & CFD | 4 | June 19, 2013 05:49 |
How to calculate Nusselt number | SeRGeiSarov | Main CFD Forum | 4 | May 6, 2009 02:57 |
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues | michele | OpenFOAM Meshing & Mesh Conversion | 2 | July 15, 2005 05:15 |