|
[Sponsors] |
February 13, 2012, 20:02 |
|
#21 |
Member
Guifan Li
Join Date: Apr 2011
Location: New York City, U.S.
Posts: 96
Rep Power: 15 |
Can you post your bifurcation geometry as well as how you measure the WSS?
|
|
February 14, 2012, 11:24 |
|
#22 | |
Senior Member
Join Date: Jan 2012
Posts: 197
Rep Power: 14 |
Quote:
I'm not sure how to measure WSS I just created a scalar plot and then selected wall in parts and WSS in function Appreciate any useful suggestion Thanks |
||
February 14, 2012, 19:50 |
|
#23 |
Member
Guifan Li
Join Date: Apr 2011
Location: New York City, U.S.
Posts: 96
Rep Power: 15 |
I think there is tool under filter is plot over intersection curve.
1) In property inspection field, choose the wall object (whoever the name you named it). 2) Use "Clip" to get rid of the part you do not want to measure. 3) Use "Plot over intersection curve" to plot the wall shear stress over the line which is the intersection of a plane and the wall. |
|
August 13, 2012, 10:11 |
|
#24 |
New Member
Tian Coulsting
Join Date: Jun 2012
Posts: 19
Rep Power: 14 |
Hi guys,
Is there any way that you can output the wall shear stress at every calculated time step (to use this as a measure of convergence to a steady state)? I would like to incorporate it into the solver but not quite sure what the script would look like. Any help would be greatly appreciated. Cheers, Tian |
|
August 13, 2012, 14:42 |
|
#26 | |
New Member
Tian Coulsting
Join Date: Jun 2012
Posts: 19
Rep Power: 14 |
Quote:
// Print out average wall shear stress over topSurface // // find the identification number (e.g. label) for our boundary of interest. label topSurfacePatch = mesh.boundaryMesh().findPatchID("topSurface"); // if we don't have such a patch, warn the user // if (topSurfacePatch==-1) { Info << "Failure to find patch named topSurface for average wall shear stress calc." << endl; } else // calculate the result and do output { // the sum operator implicity loops over the boundary faces and stores the result in avgWSS scalar avgWSS = 0.0; avgWSS = sum(wallShearStress.boundaryField()[topSurfacePatch]); reduce(avgWSS,sumOp<scalar>()); Info << "Monitor: at Time = " << runTime.timeName() << " -- Average wall shear stress over top surface= " << avgWSS <<" [kg/(m*s^2)] " ; } When compiling with wmake, the following message appears: Making dependency list for source file mypisoFoam1.C SOURCE=mypisoFoam1.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/hpcwarwick/openfoam/2.1.0/OpenFOAM-2.1.0/src/turbulenceModels/incompressible/turbulenceModel -I/hpcwarwick/openfoam/2.1.0/OpenFOAM-2.1.0/src/transportModels -I/hpcwarwick/openfoam/2.1.0/OpenFOAM-2.1.0/src/transportModels/incompressible/singlePhaseTransportModel -I/hpcwarwick/openfoam/2.1.0/OpenFOAM-2.1.0/src/finiteVolume/lnInclude -IlnInclude -I. -I/hpcwarwick/openfoam/2.1.0/OpenFOAM-2.1.0/src/OpenFOAM/lnInclude -I/hpcwarwick/openfoam/2.1.0/OpenFOAM-2.1.0/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/mypisoFoam1.o mypisoFoam1.C: In function ‘int main(int, char**)’: mypisoFoam1.C:175: error: ‘wallShearStress’ was not declared in this scope /hpcwarwick/openfoam/2.1.0/OpenFOAM-2.1.0/src/finiteVolume/lnInclude/readPISOControls.H:3: warning: unused variable ‘nOuterCorr’ /hpcwarwick/openfoam/2.1.0/OpenFOAM-2.1.0/src/finiteVolume/lnInclude/readPISOControls.H:15: warning: unused variable ‘transonic’ make: *** [Make/linux64GccDPOpt/mypisoFoam1.o] Error 1 The problem appears to be that it can't find wallShearStress as a variable. How do I make it calculate/read this? Cheers Tian |
||
August 13, 2012, 15:37 |
|
#27 |
Senior Member
|
Oh, sorry about previous post, that was a forum conflict!
But in openFoam it seems that the original utility compute wall traction instead of wall shear stress and I posted the revised form you can easily embed it in your solver and assess its changing. (note that it's a revised utility now which can be used in this form as a utility or you can put in your desired code with few manipulation) see the attachment ... (the error of your code is that you haven't defined wall shear stress yet)
__________________
Amir |
|
August 13, 2012, 19:04 |
|
#28 |
New Member
Tian Coulsting
Join Date: Jun 2012
Posts: 19
Rep Power: 14 |
Thanks a lot for your reply Amir. Does the old wallShearStress function not actually give wall shear stress then? In your utility it requires a tau file in the 0 directory and therefore gives the resulting error message:
--> FOAM FATAL IO ERROR: cannot find file file: /gpfs/home/eng/mauiie/OpenFOAM/mauiie-2.1.0/run/project/cavity2D/solverTest/0/tau at line 0. From function regIOobject::readStream() in file db/regIOobject/regIOobjectRead.C at line 73. FOAM exiting Is this a file used by the RAS solvers? It appears that this utility is designed for RAS not LES. With the old utility it was possible to make some alterations to the script (mainly changing RAS to LES wherever it occurred) and the utility would just as well with an LES case. Is this possible also with this solver? Also, how would you embed the function into the solver? Would you simply copy and paste it in? Or would you do something more a long the lines I started with? Sorry for all the questions, I am a bit new to OpenFOAM. Please bear with me |
|
August 14, 2012, 07:26 |
|
#29 | |||
Senior Member
|
Quote:
Quote:
Quote:
Sure, I did it for a simple code which uses moving reference frame; but note that according to the code, there must be initializing files additional to the current one in 0 folder where you can change them according to your purpose from IOobject control .... (see the attachment) it's just a template; you can change the IOobject.
__________________
Amir |
||||
August 15, 2012, 08:23 |
|
#30 |
New Member
Tian Coulsting
Join Date: Jun 2012
Posts: 19
Rep Power: 14 |
Thank you again for your help so far.
I've managed to incorporate the wall shear stress into my solver now (after some modifications to createFields.H). Ideally what I want is to output an average of wall shear stress over the top surface of my simulation into a log file (for every deltaT). I have put this script in at the end of my script: // Print out average wall shear stress over topSurface // // find the identification number (e.g. label) for our boundary of interest. label topSurfacePatch = mesh.boundaryMesh().findPatchID("topSurface"); // if we don't have such a patch, warn the user // if (topSurfacePatch==-1) { Info << "Failure to find patch named topSurface for average wall shear stress calc." << endl; } else // calculate the result and do output { // the sum operator implicity loops over the boundary faces and stores the result in avgWSS scalar avgWSS = 0.0; avgWSS = sum(mag(shear.boundaryField()[topSurfacePatch])); reduce(avgWSS,sumOp<scalar>()); Info << "Monitor: at Time = " << runTime.timeName() << " -- Average wall shear stress over top surface= " << avgWSS <<" [kg/(m*s^2)] " ; } It is now outputting the sum of over all of that patch. The only thing I need to know is how to say divide by the total number of points on that face??(this is because I need the average not the sum) Cheers Tian |
|
August 15, 2012, 08:31 |
|
#31 |
New Member
Tian Coulsting
Join Date: Jun 2012
Posts: 19
Rep Power: 14 |
Also, the script that gives a line break would be very useful
|
|
August 15, 2012, 09:55 |
|
#32 | |
Senior Member
|
Quote:
As you can see; you'll need to compute patch area there (not the numbers!): scalar area = gSum(mesh.magSf().boundaryField()[patchI]); use endl (see the above utility (patchAverage)) Bests,
__________________
Amir |
||
August 15, 2012, 10:53 |
|
#33 | |
New Member
Tian Coulsting
Join Date: Jun 2012
Posts: 19
Rep Power: 14 |
Quote:
Why should it be over the patch area rather than the number of points on that patch? Since the shear utility outputs a vector at every point on the patch, surely the more points you have (i.e. a finer resolution of mesh) the greater the sum of these vectors will be. So it is by dividing by the number of points that you would achieve the average. Cheers, Tian |
||
August 15, 2012, 11:47 |
|
#34 | |
Senior Member
|
Quote:
- your formulation: (1/N)*sum(shear) - The correct formulation: (1/area)*sum(shear*area) Bests,
__________________
Amir |
||
August 15, 2012, 12:25 |
|
#35 |
New Member
Tian Coulsting
Join Date: Jun 2012
Posts: 19
Rep Power: 14 |
Ah, I see... I did not realise the calculated values were weighted by the size of the cells!
Looking over the script I have an understanding of all aspects except, why do you write this: volTensorField T=mu*(gradU+gradU.T()); T you say is the stress tensor which is the Jacobian of the velocity (i.e. gradU) and I assume you multiply by mu because it's as good a stage as any to do so. However, why the "+gradU.T()"? Cheers Tian |
|
August 15, 2012, 15:43 |
|
#36 | |
Senior Member
|
Quote:
(T=2*mu*D) for incompressible flow D : symmetric part of grad(U) Bests,
__________________
Amir |
||
August 26, 2012, 06:02 |
|
#37 |
New Member
Tian Coulsting
Join Date: Jun 2012
Posts: 19
Rep Power: 14 |
Hi again!
I seem to be getting far too high values out for wall shear stress. I have implemented a monitor in my solver, so that it outputs average wall shear stress over the top surface of my simulation. The code looks as follows: volTensorField gradU=fvc::grad(U); volTensorField T=mu*(gradU+gradU.T()); volVectorField nn ( IOobject ( "nn", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), mesh, vector::zero ); forAll(nn.boundaryField(), patchI) { nn.boundaryField()[patchI] = ( -mesh.Sf().boundaryField()[patchI] /mesh.magSf().boundaryField()[patchI] ); } forAll(wallShearStress.boundaryField(), patchI) { wallShearStress.boundaryField()[patchI] = nn.boundaryField()[patchI] & T.boundaryField()[patchI]; } forAll(normal.boundaryField(), patchI) { normal.boundaryField()[patchI] = (nn.boundaryField()[patchI] & wallShearStress.boundaryField()[patchI]) *nn.boundaryField()[patchI]; } forAll(shear.boundaryField(), patchI) { shear.boundaryField()[patchI] = wallShearStress.boundaryField()[patchI]-normal.boundaryField()[patchI]; } // Print out average wall shear stress over topSurface // find the identification number (e.g. label) for our boundary of interest. label topSurfacePatch = mesh.boundaryMesh().findPatchID("topSurface"); // if we don't have such a patch, warn the user if (topSurfacePatch==-1) { Info << "Failure to find patch named topSurface for average wall shear stress calc." << endl; } else // calculate the result and do output { // the sum operator implicity loops over the boundary faces and stores the result in avgWSS scalar area = gSum(mesh.magSf().boundaryField()[topSurfacePatch]); scalar avgWSS = gSum(mag(shear.boundaryField()[topSurfacePatch]))/area; // reduce(avgWSS,sumOp<scalar>()); Info << "Monitor: at Time = " << runTime.timeName() << " -- Average wall shear stress over top surface= " << avgWSS <<" [kg/(m*s^2)] " << "Area = " << area << " [m^2] "; } The values I am getting out are far too high for my simulation, for example average wall shear stress of 40 where mean velocity is magnitude 1. I have searched through the code trying to work out where the issue is occurring. Do you have any suggestions please? Cheers, Tian |
|
August 26, 2012, 06:21 |
|
#38 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37 |
Hi Tian,
I think (am certain) that the error is in the following line: Code:
scalar avgWSS = gSum(mag(shear.boundaryField()[topSurfacePatch]))/area; Code:
scalar avgWSS = gSum(mag(shear.boundaryField()[topSurfacePatch]) * mesh.magSf().boundaryField()[topSurfacePatch])/area; Niels |
|
August 26, 2012, 06:40 |
|
#39 |
New Member
Tian Coulsting
Join Date: Jun 2012
Posts: 19
Rep Power: 14 |
Ahhh... That is so much better.
Thank you Niels you're a life saver! Tian |
|
August 26, 2012, 06:47 |
|
#40 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37 |
No problem.
BTW: In stead of making the stress tensor yourself, you could benefit from the turbulence model by calling devReff(). The only thing to remember is that this tensor is also non-tangential with the wall, so you have to perform the same projection (as you already do) onto the boundary face. The upside of using the turbulence model is that you do not have to implement turbulence model specific shear stress methods, because the turbulence model itself tells, how the shear stress is defined. / Niels |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Water subcooled boiling | Attesz | CFX | 7 | January 5, 2013 04:32 |
2D wall shear stress | yossarian88 | STAR-CCM+ | 0 | February 21, 2011 14:12 |
relationship between wall shear stress and TKE | winter | FLUENT | 0 | December 11, 2007 18:11 |
Macro to set Wall Shear Stress | Satish | FLUENT | 4 | November 26, 2003 15:46 |
WALL SHEAR STRESS | Min-Hua Wang | CFX | 0 | April 3, 2002 18:40 |