We looked for a solution to the problem:

with:

for given . This represents, in nondimensional form, a certain set of viscous boundary conditions for velocity/temperature. In practice, is a wall-function. The solution is given by:

Where, is given by:

and is given by a (typically) straightforward integration:

In practice, given above, the integral in is easily computable for in the form of a polynomial of arbitrary degree. For the sake of conciseness we only considered as constant, the resulting integral being times the following function:

https://www.wolframalpha.com/input/?...Batan(b%2Fc)))

The whole procedure is implemented in the attached MATLAB/Octave script, where the analytical solution above (ta) is compared with the numerical one (tn), obtained by numerically integrating .

The usage should be straightforward:

1) Pick up values for ,, and (lines 8-11).

2) Choose plotting options (lines 5-6)

3) Choose how many points you want to use to integrate numerically (line 7).

4) Run the script.

Note that the constant has been calibrated using as reference the mixing length model with a constant . The relative turbulent mixing length viscosity has been left commented in the script (line 60), so that you can use it to calibrate the model for different values of the constant (line 13). Note that the calibration is always done once using and . After that, any value of those parameters will be taken into account automatically by the formula.

In general, the value is such that at . Hence, it could be also used as a mean to introduce roughness effects in the formulation.

In conclusion, it is worth mentioning what are the limitations of the present wall function with respect to the full solution of the turbulent equations with, say, the SA model:

1) The equations are not in their full form, but in the incompressible TBLE form, with constant RHS.

2) The underlying turbulent viscosity model is not formally sensitized to the pressure gradient.

However, note that the same limitations also apply to, say:

K. Suga et al. / Int. J. Heat and Fluid Flow 27 (2006) 852–866

which provides a relation similar to the present one but with a higher approximation on the turbulent viscosity.

with:

I added all the explicit functional dependencies here because we know ( given by Monkewitz et al. and reported in the previous post), and would be great to use that solution directly. Indeed, while the above integral is still directly solvable by partial fractions (check yourself with Wolfram alpha), the solution is not really appealing, because it involves 3 non trivial roots of a cubic equation.

In order to avoid that, we absorb the ratio in the definition, and multiply both numerator and denumerator by , obtaining:

Note that, if all the instances of were multiplied by we would have done, as the trick would have been to replace with in the Monkewitz solution (that, for example, would happen for the mixing length formulation, but unfortunately it is not integrable).

In order to arrive at this case, we can assume that and , with the value obtained by calibration with the velocity profile (11.489 for us, 10.306 for Monkewitz et al.). Then we request for to be a solution of the following equation:

It turns out that for meaningful values of and the solution is:

with:

So, with the value computed as above, we have that is just the Mokewitz et al. solution given in the previous post. Thus, to complete our solution, we just need an expression for . I won't report it here, as i just got it from Wolfram alpha (sometimes you need to add the last 3 right parentheses to the Wolfram formula, still don't know why):

https://www.wolframalpha.com/input/?...Batan(b%2Fc))))))

This is for the case constant. The fact that this is extendable to in the form of a polynomial can be rapidly checked by integrating the separate terms multiplied by a certain power of x (i used x in place of y in Wolfram)... but i leave this as exercise for the reader :D.

In part 3 of this post (the last one) i'll sum up the steps required to compute the whole solution and give a MATLAB/Octave script that compares it with the numerical one. ]]>

with:

the pressure gradient sensitized formula for the velocity is given by:

where is the nondimensional pressure gradient.

However, while useful for its purpose, this formulation turns out to have at least two drawbacks, both of which depending, somehow, on the fact that Reichardt didn't actually solved the underlying problem exactly. The first one is that the base profile (i.e., even without the pressure gradient effect) does not even reproduce the correct profile derivatives at the wall. Hence, as a main consequence, the formula might not be suitable as toy model for certain theoretical purposes. The second drawback, which is also another consequence of the same fact, is that it can be used as thermal wall function only for , as higher values will tend to amplify the part of the profile which is uncorrect.

To overcome such issues, i follow here the same steps as before but with a different formulation for , using one which can be integrated exactly. We start from the temperature equation, which is more general:

where (constant pressure specific heat), (dynamic viscosity), (Prandtl number), (turbulent Prandtl number) and (defined in the following) are all constant. The fact that this equation correctly represents a large set of velocity/temperature viscous boundary conditions should be self-evident. For example, gives the classical linear relationship for the temperature (which becomes the one for the velocity when ). Also, with leads to the classical wall-function formulation (for certain forms of ). According to the specific equation form, can have different meanings. For example, in the case of the velocity, it can include the wall-parallel pressure gradient (note that y is assumed to be the wall-normal coordinate, x the wall parallel one), the buoyancy term, etc. In general, it can include any of the terms that have been neglected in the LHS for the given equation. The only assumption here is that they are assumed constant along y (as will be shown in the following, it turns out that this can be actually relaxed).

The first step to proceed is integrating the equation above once. This produces (using ):

where (the underscore meaning that it is evaluated at the wall, i.e., for ). Multiplying by and rearranging, we obtain:

where:

The same equation, interpreted for the velocity, would read:

where . This confirms that the temperature solution can also be used for the velocity by a proper interpretation of the terms. Going back to the temperature equation, we then end up with the following equation for the nondimensional temperature derivative:

Then, by a further integration:

Note that i temporarily suspended the hypothesis that is constant. Now, let us also assume that we know the first integral, that is:

is a known function. Then, the solution becomes:

And after integration by parts:

For the sake of conciseness, let us also assume:

so that the full solution is:

While we have just moved the original problem to that of solving the two integrals for and , those will actually turn out to be easier to solve. Note also that the parenthesis in is a polynomial of the same order of (assuming that it is approximated with a certain degree polynomial). Particularly relevant is the case with constant (as is typically assumed). However, note that ,for the that we are going to derive below, a linear approximation is also integrable, as well as any other polynomial of higher degree. Obviously, things rapidly become cumbersome, with the degree of the polynomial, so for the present purposes it is sufficient to go back to the case constant. In this case is simply the integral of times . Note that Popovac and Hanjalic have shown (for the velocity) that this is actually relevant for several practical cases. Nonetheless, is worth remembering that this is not a costriction of the present approach (probably it wasn't neither when was based on the Reichardt profile).

So, at this point we are left with determining . To this end, we need a model for . Note that this is not different from the approach used by Van Driest to determine his velocity profile. It's just that the mixing length hypothesis he used led to a non integrable function. The same also happened to Reichardt, who then started modificating his function until something integrable came out.

To overcome this limit, here we abandon those formulations and use instead the one from Musker:

with being, in its original formulation, a constant (see below). It is worth mentioning that this functional form respects both the behavior for and the behavior for .

Note also that the Spalart-Allmaras model has a simlar behavior near the wall (see Allmaras et al., ICCFD 2012):

which then fails to recover the correct behavior for (However, Spalart and Allmaras explicitly mention in their original 1994 work that thay didn't notice any meaningful difference deriving from using this specific form instead of a correct one, say, the mixing length). This just to say that the Musker form is not only meaningful, but also representative of the near wall behavior of the Spalart-Allmaras model.

To solve for with the Musker turbulent viscosity, we first consider the case , as this already has a known solution, provided in its most general form by Monkewitz et al. (POF 20, 105102, 2008):

where:

The constant is found by calibration with the turbulent velocity profile. Monkewitz et al. use . In contrast, i calibrated the constant using the mixing length model with a constant , resulting in .

Now, the whole point of the procedure is: how to extend such formulation to the case ? See part 2 ]]>

In practice, this is an extension of the Reichardt wall law to pressure gradient effects.

It is semi-analytical because it takes as assumption that the base Reichardt law is an exact solution of the 1D problem (which is not true).

While this might certainly be material for a paper (every work i am aware of uses numerical integration to solve the 1D problem; this, in particular, requires solving a tridiagonal system for every near wall cell), i honestly don't have time for this (life is too short to be spent in review).

Hence, here it is the work: a description in the pdf file and a matlab/octave comparison script in the txt file. If you ever worked on wall function you should fastly get to the point.

Otherwise, i'm open to discussion.

http://hdl.handle.net/10589/89603

I won't spend too much words on promoting it, you can read the abstract for this. I just want to say it possibly provides a fresh view on the matter of implicit/explicit filtering, commutation errors and other evergreen topics in LES. As i put a specific effort on this, i also hope that it might work as a not too heavy introduction on LES in general. Finally, it is developed within Fluent and you can find most of the used routines on this same blog.

Hope it helps someone. ]]>

Still, all the y+ calculators i am aware of rely on a very specific flow condition, namely, a flat plate boundary layer. This is probably the most common practical case but not the only option. For example, the fully developed flow in a pipe is cretainly different and possibly requires a different input for the y+ calculation.

The tool in the attached file is intended to provide an y+ calculator for the three most common equilibrium flows: channel flow, pipe flow and boundary layer. For the latter, a typical input would thus be the depth of the boundary layer and the external velocity. Analogous input are required for the remaining two flows.

All the relations are taken from the Pope's book. You will notice that, as much as in wall function calculations, an iterative loop is required, but i'm not an Excel fan, so i arranged it in a very trivial way over 10 consecutive rows (still, i know is possible to use some Excel feature to do it more elegantly).

Hope it helps someone, at least in clarifying that such y+ calculation is not uniquely done for all flows.

Edit: as for all the recent attachments, remember to rename it correctly instead of the dummy .php extension (i.e., .xlsx in this case).

http://www.cfdlab.polimi.it/Research/LESinItaly.tar.gz ]]>

The attached pdf file contains an explanatory image of the method while the .c routine should be sufficiently commented to be readily usable by anyone who actually knows what i'm talking about. If you don't, then you don't need it.

The routine only works in parallel (a serial version is available on request but its use is pointless in LES) and has been tested on straight circular and square ducts, both with structured and unstructured grids.

When compared with the default methods in Fluent (Vortex Method and Spectral Synthesizer) on the same number of cells, it is found to be around the 18% faster on average (different parallel partitions, load balances and hardware architectures). When the parallel partitioning is optimized the saving is higher.

A preliminary testing of the procedure has been presented here:

http://proceedings2012.caeconference...icoMilano.html

While additional details will be present in my forthcoming Ph.D. thesis, which i will share as soon as i will defend it.

The auxiliary flow is driven by a fixed source term (which nonetheless can be easily modified). An alternative version based on a PID controller to fix the mass flow rate and/or an additional integral parameter (say, the swirl number) is also available on request. However, this PID version has not been toroughly tested and some additional work might be needed.

The models are provided without any kind of warranty; still, no specific problem came up during testing.

For wall bounded turbulent flows in Fluent i strongly suggest the Vreman model due to its specific, theoretically wrong, near wall behavior. The SVD model, in contrast, seems to behave much like the dynamic Smagorinsky model and possibly worst. However, the SVD model is the first one i met that, in Fluent, provides a full y^3 near wall behaviour for the tangential stress, independently from the grid.

I will soon update this post with some plot.

1) output.c: Used to dump an instantaneous field file

2) outputavg.c: Used to dump an averaged field file

More details can be found in the files

1) Custom field function for the Q criterion (q_crit.txt, to be renamed in .scm). Some Fluent versions (12, 13 and maybe 14) only have a "Normalized Q criterion" scalar, while previous ones simply don't have it at all. This custom field function is what i used in those dark days.

2) Several initialization routines (init*.c and scalefield.c) fully described in the files

x(nx,ny,nz): x coordinates of your grid

y(nx,ny,nz): y coordinates of your grid

z(nx,ny,nz): z coordinates of your grid

dudx(nx,ny,nz): x-wise derivative of x-wise velocity component

dudy(nx,ny,nz): y-wise derivative of x-wise velocity component

.

.

.

dwdz(nx,ny,nz): z-wise derivative of z-wise velocity component

This is, more or less, how i would put it down in Matlab the task of plotting Q isosurfaces (tipically used for flow visualization in DNS/LES):

%MATLAB CODE

iso_q=100; %Pick your number here

%Definition of Q

q=-0.5*(dudx.^2+dvdy.^2+dwdz.^2)-dudy.*dvdx-dudz.*dwdx-dvdz.*dwdy;

%Plotting a Q isosurface, Q=iso_q

figure()

p=patch(isosurface(x,y,z,q,iso_q));

set(p,'FaceColor','red','EdgeColor','none');

daspect([1,1,1])

axis tight

ax = -1; ay = 1; az = 1;

view([ax,ay,az]);

camroll(240)

camlight

lighting gouraud

%END OF MATLAB CODE ]]>

http://rapidshare.com/files/1564297057/UFVMOM.rar

there is a basic MATLAB tool to handle unstructured finite volume grids (fluent .msh or .cas files) and to perform basic interpolations, gradient computations, plots etc. No actual FV computation is ever performed or implemented, however, the main structure of the code is clearly there.

GENERAL DESCRIPTION

The tool is actually a collection of functions, grouped by tasks under several folders plus a main test.m file which contains some useful examples.

The following folders are present (in logical order):

This is more or less a description of the several tools available. In the test.m file there are several examples on the different tools and all the subroutines are, in my opinion, heavily commented so you should be able (after a while) to understand how things work.

As you can see, all the material is at a very rough development stage yet so, it goes without saying,

CRITICAL PARTS

I want to collect here the critical points/routines or parts where a full testing is still needed:

- general:

- input\writemsh.m: it actually works and i've been using it for a while now without any problem. Nonetheless, sometimes Fluent launches a warning in reading the meshes written by this file... still, it can work it out without problems.

- fvcomp\fvfilter.m: i never used the routine or even tested it; might also be totally wrong (ok, maybe not that bad...).

- kdtree\...: the whole tool was not developed by me and i know nothing about it.

- vtk\vtkwrite.m: i already said this but i repeat it, there is a lack of support for polyhedral cells. I don't know if polygonal cells (2D) are supported because i didn't have any tool to create them. ]]>

http://www.lamc.ing.unibo.it/aimeta2.../MEM-273-0.pdf ]]>

This is defined as the second (in magnitude) eigenvalue of the matrix:

where:

This requires the construction of the characteristic cubic equation and its resolution in order to obtain lambda2 (that is, lambda2 is the second solution of the cubic characteristic equation).

For coherent structures the matrix above can be related to the opposite of the pressure Hessian matrix. As this matrix is real and symmetric, it has two positive eigenvalues when the pressure is at minimum. As a consequence, the matrix above has two negative eigenvalues and lambda2 is certainly negative (for coherent structures). How much negative you have to pick its isosurfaces is (for what i understand) related to the visual appealing of your images (like for the Q criterion).

A basic routine for Fluent is provided below. The bug reported by the user http://www.cfd-online.com/Forums/mem...icbretzel.html has been fixed.