implementation of a turbulent inflow boundary condition
play

Implementation of a turbulent inflow boundary condition for LES - PowerPoint PPT Presentation

Background Test case Mean velocity Fluctuations Conlusion Implementation of a turbulent inflow boundary condition for LES based on a vortex method Nina Gall Jrgensen Technical University of Denmark Department of Civil Engineering


  1. Background Test case Mean velocity Fluctuations Conlusion Implementation of a turbulent inflow boundary condition for LES based on a vortex method Nina Gall Jørgensen Technical University of Denmark Department of Civil Engineering 22-10-2012 Nina Gall Jørgensen Implementation of a boundary condition in OpenFOAM 09-09-2012 1 / 21

  2. Background Test case Mean velocity Fluctuations Conlusion Motivation Atmospheric boundary layer flows Nina Gall Jørgensen Implementation of a boundary condition in OpenFOAM 09-09-2012 2 / 21

  3. Background Test case Mean velocity Fluctuations Conlusion Mean flow profile estimations Obtain mean flow data from experiments or RANS simulations Logarithmic law U ( z ) = u ∗ κ ln ( z − d 0 Mean velocity ) z 0 Power law U ( z ) = U 10 ( z 10) α Relation between z 0 and α 1 α = ln ( z ref /z 0 )) Turbulent kinetic energy k = 3 2( UI u ) 2 Nina Gall Jørgensen Implementation of a boundary condition in OpenFOAM 09-09-2012 3 / 21

  4. Background Test case Mean velocity Fluctuations Conlusion Turbulent velocity inlet boundary conditions in OpenFoam (University of Rostock, Germany - inflowGenerator) inflowGenerator mapped tubulentInlet Nina Gall Jørgensen Implementation of a boundary condition in OpenFOAM 09-09-2012 4 / 21

  5. Background Test case Mean velocity Fluctuations Conlusion Test Case - boxPowerLawTurbulentLES (See Report for detailed information on the test case) 0 directory: U, p, k, nuSgs, nuTilda constant: LESProperties - LESModel oneEqEddy system: controlDict - application pisoFoam Nina Gall Jørgensen Implementation of a boundary condition in OpenFOAM 09-09-2012 5 / 21

  6. Background Test case Mean velocity Fluctuations Conlusion Copy and Compile Parabolic Velocity BC Compile guidelines given in course lecture notes: Copy and compile a boundary condition, and a deeper look at parabolicInlet Copy the BC from the OpenFOAM-extend project at SourceForge: OF21x mkdir -p $WM_PROJECT_USER_DIR/src/finiteVolume/fields/fvPatchFields/derived cd $WM_PROJECT_USER_DIR/src/finiteVolume/fields/fvPatchFields/derived svn checkout http://openfoam-extend.svn.sourceforge.net/svnroot/\ openfoam-extend/trunk/Core/OpenFOAM-1.5-dev/src/finiteVolume/\ fields/fvPatchFields/derived/parabolicVelocity/ cd parabolicVelocity Create the Make/files file and include following: parabolicVelocityFvPatchVectorField.C LIB = $(FOAM_USER_LIBBIN)/libmyBCs Create the Make/options file and include following: EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = Compile the dynamic library: wmake libso Nina Gall Jørgensen Implementation of a boundary condition in OpenFOAM 09-09-2012 6 / 21

  7. Background Test case Mean velocity Fluctuations Conlusion Modifications to Parabolic Velocity BC Copy parabolicVelocity to powerLawTurbulentVelocity: cd $WM_PROJECT_USER_DIR/src/finiteVolume/fields/ fvPatchFields/derived cp -r parabolicVelocity powerLawTurbulentVelocity cd powerLawTurbulentVelocity rename .H and .C files: rename parabolic powerLawTurbulent * Modify the Make/files file: powerLawTurbulentVelocityFvPatchVectorField.C LIB = $(FOAM_USER_LIBBIN)/libmypowerLawTurbulent Change class name everywhere in .H and .C files: sed -i s/parabolic/powerLawTurbulent/g powerLawTurbulentVelocityFvPatchVectorField.C sed -i s/parabolic/powerLawTurbulent/g powerLawTurbulentVelocityFvPatchVectorField.H Compile the dynamic library with wmake libso Nina Gall Jørgensen Implementation of a boundary condition in OpenFOAM 09-09-2012 7 / 21

  8. Background Test case Mean velocity Fluctuations Conlusion Modifications to Parabolic Velocity BC Add private data for a and alpha in the .H and .C files in same way as scalar maxValue . Erase everywhere maxValue U ( z ) = az α Change the operator to power law profile scalarField coord = (c & y_); vectorField Uinf = (n_*a_*pow(coord,alpha_)); Compile the dynamic library wclean libso, wmake libso Run boxPowerLawTurbulentLES test case (for this write ::operator instead of Uinf) Nina Gall Jørgensen Implementation of a boundary condition in OpenFOAM 09-09-2012 8 / 21

  9. Background Test case Mean velocity Fluctuations Conlusion Vortex Method Generation of 2D small scale flow structures (Mathey et al., 2006 - Assessment of vortex method for LES inlet conditions) d ¯ ω u + ν ∇ 2 ¯ dt = ¯ ω · ∇ ¯ ω Vorticity equation solved with particle discretisation Velocity at inlet of channel flow N x ) = 1 (¯ x i − ¯ x ) × ¯ z xi | 2 xi | 2 | ¯ x − ¯ | ¯ x − ¯ � u (¯ ¯ Γ i (1 − e ) e 2 σ 2 2 σ 2 2 π | ¯ x − ¯ x i | 2 i =1 Nina Gall Jørgensen Implementation of a boundary condition in OpenFOAM 09-09-2012 9 / 21

  10. Background Test case Mean velocity Fluctuations Conlusion Vortex Method - Application Inflow generation for LES, Embedded LES and Hybrid RANS-LES ANSYS Fluent workshop: Embedded LES of flow over backward facing step Nina Gall Jørgensen Implementation of a boundary condition in OpenFOAM 09-09-2012 10 / 21

  11. Background Test case Mean velocity Fluctuations Conlusion Calculation of tangential fluctuations in OpenFOAM Input: turbulent kinetic energy, k and number of vortex particles, N Calculate sigma and Ap Init number of random vortex particles xi at inlet patch Calculate circulation ghe in all positions xi from k Calculate tangential fluctuations ux at all inlet faces Add ux to mean profile Repeat calculation for each time step Nina Gall Jørgensen Implementation of a boundary condition in OpenFOAM 09-09-2012 11 / 21

  12. Background Test case Mean velocity Fluctuations Conlusion Mean turbulent kinetic energy Add private data zref and N to the .H and .C files as for a and alpha Calculate k scalar z0 = zref_/exp(1/alpha_); scalarField Iu = 1/log(coord/z0); scalarField Uinfx = Uinf.component(0); scalarField k = 1.5*(pow(Uinfx,2)*pow(Iu,2)); Nina Gall Jørgensen Implementation of a boundary condition in OpenFOAM 09-09-2012 12 / 21

  13. Background Test case Mean velocity Fluctuations Conlusion Control of vortex particles with σ Check size of N and calculate sigma and inlet patch area Ap if (N_ >= c.size()) { Info << "Error: N should be less than or equal to " << c.size() << endl; } scalarField Af = patch().magSf(); scalar Ap = sum(Af); vector bbMax = bb.max(); scalar lx = bbMax[1]; scalar ly = bbMax[2]; scalar L = (2*lx*ly)/(lx+ly); scalar sigma = (0.1*L)/2; scalar sigma2 = 2*sqr(sigma); Nina Gall Jørgensen Implementation of a boundary condition in OpenFOAM 09-09-2012 13 / 21

  14. Background Test case Mean velocity Fluctuations Conlusion Store tangential fluctuations for all inlet patch faces Start if statement to execute calculation for each time step const scalar t = this->db().time().timeOutputValue(); if (t >= t) { The tangential fluctuations ux_sum are calculated for all inlet patch faces and stored in a vectorField ux vectorField ux = c*0; forAll(patch(),facei) { vector x1 = c[facei]; scalar x1x = x1[1]; scalar x1y = (x1 & y_); Nina Gall Jørgensen Implementation of a boundary condition in OpenFOAM 09-09-2012 14 / 21

  15. Background Test case Mean velocity Fluctuations Conlusion Circulation Γ i of all vortex particles Generate random positions xi for all vortex positions, i=1..N srand (time(NULL) ); vector ux_sum = vector(0, 0, 0); for (int iter = 1; iter <= N_; iter ++) { int RandIndex = rand() % c.size(); � vector xi = c[RandIndex]; πSk (¯ x i ) Γ t (¯ x ) = 4 if (xi == x1) 3 N (2 ln (3) − 3 ln (2)) { scalar Lxi = sqrt(patch().magSf()[iter]); scalar addxi = 0.1*Lxi; xi[1] = xi[1]+addxi; xi[2] = xi[2]+addxi; } scalar xix = xi[1]; scalar xiy = (xi & y_); Nina Gall Jørgensen Implementation of a boundary condition in OpenFOAM 09-09-2012 15 / 21

  16. Background Test case Mean velocity Fluctuations Conlusion Circulation Γ i of all vortex particles Calculate Γ i in the random vortex positions from local k scalar dist = sqr(x1x-xix)+sqr(x1y-xiy); vector xx = xi-x1; scalar ks = k[RandIndex]; scalar gamma = 4*sqrt((Foam::constant::mathematical::pi*Ap*ks)/ (3*N_*0.117783035656383)); Nina Gall Jørgensen Implementation of a boundary condition in OpenFOAM 09-09-2012 16 / 21

  17. Background Test case Mean velocity Fluctuations Conlusion Calculate and sum up the tangential fluctuations For each inlet face calculate the contribution to the tangential fluctuatins from all vortex particles. The constant sigma is bounded to the local face edge length. N xi | 2 xi | 2 x ) = 1 Γ i (¯ x i − ¯ x ) × ¯ z | ¯ x − ¯ | ¯ x − ¯ � u (¯ ¯ (1 − e ) e 2 σ 2 2 σ 2 2 π | ¯ x − ¯ x i | 2 i =1 scalar delta = sqrt(patch().magSf()[RandIndex]); if (sigma <= delta) { sigma = delta; sigma2 = 2*sqr(sigma); } vector z1 = vector(1,0,0); vector ux1 = (gamma*((xx ^ z1)/dist)*(1-exp(-dist/sigma2))*exp(-dist/sigma2)); ux_sum += ux1; } Nina Gall Jørgensen Implementation of a boundary condition in OpenFOAM 09-09-2012 17 / 21

  18. Background Test case Mean velocity Fluctuations Conlusion Store tangential fluctuations for all inlet patch faces The tangential fluctuations ux_sum are calculated for all inlet patch faces and stored in a vectorField ux . Finally, the mean and fluctuating velocities are summed up in the operator. ux[facei] = (1/(2*Foam::constant::mathematical::pi))*ux_sum; } vectorField::operator=(Uinf+ux); } Compile with wmake libso Nina Gall Jørgensen Implementation of a boundary condition in OpenFOAM 09-09-2012 18 / 21

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend