Draft Version. For personal use. c Copyright 2011 - Máté Márton LOHÁSZ. Tutorial for Channel Flow by LES using Open Source CFD



Similar documents
A simplefoam tutorial

Moving boundary in openfoam

OpenFOAM Tutorial. 4. Units

How To Run A Steady Case On A Creeper

Simple beginning 3D OpenFOAM Tutorial

Open Source Computational Fluid Dynamics

Simulating Wind Over Terrain: How to Build an OpenFOAM Case from GRASS GIS Digital Elevation Models

OpenFOAM. The Open Source CFD Toolbox. User Guide

OpenFOAM Opensource and CFD

OpenFOAM postprocessing and advanced running options

TVM 4155 Numerical modelling and hydraulics 10. March OpenFOAM homework

Set up and solve a transient problem using the pressure-based solver and VOF model.

Grid Engine Basics. Table of Contents. Grid Engine Basics Version 1. (Formerly: Sun Grid Engine)

This offering is not approved or endorsed by OpenCFD Limited, the producer of the OpenFOAM software and owner of the OPENFOAM and OpenCFD trade marks.

Auxiliary Processing swak4foam and PyFoam

Modeling of Earth Surface Dynamics and Related Problems Using OpenFOAM

Getting started with CFD packages. OpenFOAM R and FLUENT R

CFD: What is it good for?

HPC system startup manual (version 1.30)

O.F.Wind Wind Site Assessment Simulation in complex terrain based on OpenFOAM. Darmstadt,

External bluff-body flow-cfd simulation using ANSYS Fluent

Beyond Windows: Using the Linux Servers and the Grid

1. Product Information

Online Backup Client User Manual Linux

Instructions for Accessing the Advanced Computing Facility Supercomputing Cluster at the University of Kansas

Installing IBM Websphere Application Server 7 and 8 on OS4 Enterprise Linux

This offering is not approved or endorsed by OpenCFD Limited, the producer of the OpenFOAM software and owner of the OPENFOAM and OpenCFD trade marks.

Introductory FLUENT Training

RecoveryVault Express Client User Manual

Lab 0: Preparing your laptop for the course OS X

Online Backup Linux Client User Manual

Introduction to Running Hadoop on the High Performance Clusters at the Center for Computational Research

Installing FEAR on Windows, Linux, and Mac Systems

Online Backup Client User Manual

Trace Layer Import for Printed Circuit Boards Under Icepak

Adaptation and validation of OpenFOAM CFD-solvers for nuclear safety related flow simulations

Online Backup Client User Manual

OpenFOAM open source CFD on ANSELM

Single Node Hadoop Cluster Setup

ME6130 An introduction to CFD 1-1

GAMBIT Demo Tutorial

How To Run A Cdef Simulation

PROGRAMMING FOR BIOLOGISTS. BIOL 6297 Monday, Wednesday 10 am -12 pm

OpenFOAM Workshop. Yağmur Gülkanat Res.Assist.

Thermal Simulation of a Power Electronics Cold Plate with a Parametric Design Study

Introduction to Mac OS X

CCTech TM. ICEM-CFD & FLUENT Software Training. Course Brochure. Simulation is The Future

CastNet: Modelling platform for open source solver technology

CFD modelling of floating body response to regular waves

Parallel Debugging with DDT

A Swirl Generator Case Study for OpenFOAM

Cassandra Installation over Ubuntu 1. Installing VMware player:

Customer Training Material. Lecture 2. Introduction to. Methodology ANSYS FLUENT. ANSYS, Inc. Proprietary 2010 ANSYS, Inc. All rights reserved.

Pre-processing in openfoam, mesh generation. OpenFOAM kurs 2013 Håkan Nilsson Olivier Petit

Multiphase Flow - Appendices

Abaqus/CFD Sample Problems. Abaqus 6.10

Tutorial: Using WestGrid. Drew Leske Compute Canada/WestGrid Site Lead University of Victoria

Easy Setup Guide 1&1 CLOUD SERVER. Creating Backups. for Linux

How to Install Multicraft on a VPS or Dedicated Server (Ubuntu bit)

NUMERICAL SIMULATION OF REGULAR WAVES RUN-UP OVER SLOPPING BEACH BY OPEN FOAM

IBM WebSphere Application Server Version 7.0

. Address the following issues in your solution:

Introduction to CFD Analysis

TSM for Windows Installation Instructions: Download the latest TSM Client Using the following link:

GeBro-BACKUP. Die Online-Datensicherung. Manual Pro Backup Client on a NAS

Lecture 6 - Boundary Conditions. Applied Computational Fluid Dynamics

Lab 1 Beginning C Program

stub (Private Switch) Solaris 11 Operating Environment In the Solaris 11 Operating Environment, four zones are created namely:

The UBATSIM software package. Simulates UBAT detector frames from a GRB. and. processes them to trigger and locate the GRB

TWO-DIMENSIONAL FINITE ELEMENT ANALYSIS OF FORCED CONVECTION FLOW AND HEAT TRANSFER IN A LAMINAR CHANNEL FLOW

2.1 CFD PROJECT PLANNING ANSYS, Inc. All rights reserved. ANSYS, Inc. Proprietary

Express Introductory Training in ANSYS Fluent Lecture 1 Introduction to the CFD Methodology

Incorporation of OpenFOAM software into Computational Fluid Dynamics process in Volvo Technology

Using Symantec NetBackup with Symantec Security Information Manager 4.5

Navier-Stokes Equation Solved in Comsol 4.1. Copyright Bruce A. Finlayson, 2010 See also Introduction to Chemical Engineering Computing, Wiley (2006).

The calculation of train slipstreams using Large-Eddy Simulation techniques

Miami University RedHawk Cluster Connecting to the Cluster Using Windows

Configuring High Availability for VMware vcenter in RMS Distributed Setup

Streamline Computing Linux Cluster User Training. ( Nottingham University)

Coupling micro-scale CFD simulations to meso-scale models

Summary. Load and Open GaussView to start example

Computational Modeling of Wind Turbines in OpenFOAM

A. Aiken & K. Olukotun PA3

version 3.0 tutorial - Turbulent mixing in a T-junction with CFDSTUDY in SALOME contact: saturne-support@edf.fr

Installing and Using No Machine to connect to the Redhawk Cluster. Mac version

Steady Flow: Laminar and Turbulent in an S-Bend

A Guide to the free mesh program Discretizer with OpenFOAM for CFD (Computational Fluid Dynamics)

Use of OpenFoam in a CFD analysis of a finger type slug catcher. Dynaflow Conference 2011 January , Rotterdam, the Netherlands

High Performance Computing

AlienVault Unified Security Management (USM) 4.x-5.x. Deploying HIDS Agents to Linux Hosts

Open Source CFD Solver - OpenFOAM

BF2CC Daemon Linux Installation Guide

CastNet: GUI environment for OpenFOAM

A moving piston boundary condition including gap flow in OpenFOAM

COMPARISON OF SOLUTION ALGORITHM FOR FLOW AROUND A SQUARE CYLINDER

Faculty of Science and Technology MASTER S THESIS

CycleServer Grid Engine Support Install Guide. version 1.25

OSKAR Example Revision: 8

Transcription:

Tutorial for Channel Flow by LES using Open Source CFD Máté Márton Lohász February 2011 i

CONTENTS ii Contents 1 Overview 1 2 Set up your environment 1 3 Very short intro to OpenFOAM 1 3.1 Simulation set-up............................ 1 3.1.1 Timestep directories...................... 2 3.1.2 constant directory........................ 2 4 Meshing 2 5 Physical parameters 2 6 Inlet condition 2 7 Model parameters 2 8 Numerical settings 3 9 Time step 3 10 Simulation of the temporal transition 3 11 Time averaging 4 12 Validation 6 13 Using the cluster 7 14 Content of the LESchannel package 9

NOMENCLATURE 1 1 Overview 2 Set up your environment Login to our small cluster. ssh 152.66.21.39 If you login first time, you have to answer some (3) questions by ENTER. Login to a compute node using an interactive job. qlogin -P LEScourse OF17 Set up the OpenFOAM environmental variables Create your working directory: mkdir -p $FOAM_RUN run pwd cd.. Go to your working (run) directory: Check the path of your directory! Download the prepared case data. wget http://www.ara.bme.hu/~lohasz/lescourse/package_post.tar.gz Extract the package. tar -Pxvf package_post.tar.gz 3 Very short intro to OpenFOAM A much better intro can be found on the webpage of the code: http://www.openfoam. org. A course is given every autumn at Chalmers University: http://www.tfd. chalmers.se/~hani/teaching.html. OpenFOAM is a open-source environment for solving PDE s by finite volume techniques. In many aspects is very similar to ANSYS-Fluent. The biggest difference is that is only available for Linux, it is free to use, but it has no GUI. It is written in C++ (Fluent is written in C), so it is object oriented. In some cases the source code can be consider as easy to read. 3.1 Simulation set-up The simulation settings are not saved in some files as in Fluent but in a directory structure.

4 MESHING 2 3.1.1 Timestep directories The 0 directory contains the initial and the boundary conditions. The results of the simulations are also saved in directories named after the actual time. For our case the boundary conditions will be always the same there no further explanation is given. 3.1.2 constant directory This directory contains important settings 4 Meshing run cd LESchannel Modify the mesh if needed: vi constant/polymesh/blockmeshdict Create the mesh blockmesh 5 Physical parameters Check the transport properties vi constant/transportproperties 6 Inlet condition Create the "turbulent" initial condition perturbu 7 Model parameters Edit the LES properties vi constant/lesproperties Check the SGS model //LESModel Smagorinsky; LESModel dynamicsmagorinsky; The first (Smagorinsky) is commented above. Check the evaluation of the filter width: delta dummy; Since the use of dummy you will have an error message, where you will see the available options for delta. This can be used everywhere in OF. Set it to cuberootvol.

8 NUMERICAL SETTINGS 3 8 Numerical settings Set the numerical parameters. Edit (check) the fvschemes file. Time advancement (similar to the second order of Fluent) ddtschemes { default } backward; Momentum convection scheme (corresponds to second order central scheme): divschemes { div(phi,u) } Gauss linear; The solution of the linearised equation system is set in fvsolution, also the parameters of the pressure-velocity coupling (PISO in our case) are defined here. 9 Time step The timestep can be set in the controldict file vi system/controldict deltat 0.2; 10 Simulation of the temporal transition When simulating the temporal laminar-turbulent transition prior to a turbulent LES simulation some quantities needs to be selected to be plotted during the simulation to determine the required simulation time. Since the turbulent kinetic energy (TKE) has specific temporal character during transition it is useful to plot it. But generally TKE is difficult to plot since we are not in the position of the average velocities, i.e. the fluctuations can not be determined. For the channel flow the average velocity in the span-wise and in the wall-normal component is zero, i.e. the corresponding fluctuations can be computed easily. Set the endtime of your simulation for the time you expect transition. During this time there will be no time averaging. Set 500 for the present setting vi system/controldict endtime 500; Run the simulation (in this case interactively) LMchannelFoam >> log & Check the "tail" of the log file to see the progress of the simulation.

11 TIME AVERAGING 4 tail -n20 log Check if transition is finished. For this purpose post-process the log file. foamlog log cd logs gnuplot plot "volavuy2_0", "volavuz2_0" exit cd.. Normally you should see 1 the peak in the two "components" of TKE and than the fluctuation around a value. If this is not the case continue the simulation as required. The plotting (saving the figures in png format) can be done using the provided script: gnuplot trans.gnuplot 11 Time averaging After the temporal transition you should carry out temporal simulation to determine the statistical averages of the flow. In this case the streamwise velocity profile and the profiles of Reynolds stress tensor. Modify the controdict to switch on the averaging. functions { fieldaverage1 { type fieldaverage; functionobjectlibs ( "libfieldfunctionobjects.so" ); enabled false; } } Insert some probes to see the temporal convergence of velocities and the Reynolds stress tensor. The following function should be embedded to the functions section, inside the curly brackets. probes { type probes; functionobjectlibs ("libsampling.so"); 1 If you are not in a graphical session you can not plot obviously, download the files and plot it on your local machine

11 TIME AVERAGING 5 enabled true; outputcontrol timestep; outputinterval 1; probelocations ( ( 1 1 1 ) ( 2 1 1 ) ( 1 0.1 1 ) ); fields ( U UPrime2Mean UMean } ); Modify the endtime variable (in controldict) to a higher value, i.e. 2000. Continue the simulation LMchannelFoam >>log & Plot the convergence of your simulation cd probes/aaaa gnuplot Here AAAA stand for the last time-step of your directory. You can list them by typing ls Use the following commands in gnuplot! First plot the time signal of the wall normal velocity at the three different points. plot "< tr ( < U" using 1:3, "< tr ( < U" \ using 1:6, "< tr ( < U" using 1:9 You can see which signal is at different y position, i.e. wall distance, since the fluctuation close to the wall is higher. Now plot the time average (always until the actual plotted time instance) of these velocities. plot "< tr ( < UMean" using 1:3, "< tr ( \ < UMean" using 1:6, "< tr ( < UMean" using 1:9 It is also very important to plot the Reynolds stress components. The streamwise fluctuation square in the first probe location, (1 1 1) in our example is plotted as follows: plot "< tr ( < UPrime2Mean" using 1:2 The other locations can plotted by adding 6 to the last number:

12 VALIDATION 6 plot "< tr ( < UPrime2Mean" using 1:2, "< tr ( \ < UPrime2Mean" using 1:8 If you plot also the third location, you will more clearly the importance of your variation. plot "< tr ( < UPrime2Mean" using 1:2, "< tr ( \ > < UPrime2Mean" using 1:8, "< tr ( < \ UPrime2Mean" using 1:14 The plotting (saving the figures in png format) can be done using the provided script (you should edit the script if needed): gnuplot conv.gnuplot We should see in any case some type of convergence to an unknown (or known) value. In some cases this value is known to be zero, which facilitates the judgement. If you decide that your simulation is not converged enough, continue it! 12 Validation The results can be validated by comparing them to know profiles. Before doing this a spatial averaging can be carried out to improve the confidence of the statistical convergence. Carry out the spatial averaging and the extraction of the profiles. postchannel -latesttime Enter the latest time-step directory cd AAAA gnuplot Plot the Reynolds stress normal components. plot "u.xy", "v.xy", "w.xy" Plot the logarithmic velocity profile. plot "Uf.xy" set log x plot "Uf.xy" unset log x The plotting (saving the figures in png format) can be done using the provided script (you should edit the script if needed): gnuplot valid.gnuplot

13 USING THE CLUSTER 7 13 Using the cluster For running a long simulation you have to divide your simulation in multiple parts. The cluster management (queuing system) only allows a maximum 24 hours long simulation time. Your simulation is dived into at least two parts, first the simulation of the transition. We estimate the length of the transition to be 1000 sec, and we hope that it will be possible to simulate it in a shorter time than 24 hours. During this part of the simulation nighters the averaging nor the probes are enabled. The second part of the simulation is the time averaging. We can not be sure that this simulation is shorter than 24 hours, so we divide our simulation into some hours (e.g. 3600 sec) of simulation, which will follow each-other, in this case we don not specify the endtime of the simulation explicitly but save our date after e.g. 3600 sec of simulation time. The two steps described before can be efficiently carried out when we comment out the setting for the not used simulation in the controldict file as shown below. application startfrom starttime 0; LMchannelFoam; latesttime; //stopat endtime; stopat nextwrite; endtime 1000; deltat 0.2; //writecontrol timestep; writecontrol clocktime; //writeinterval 200; writeinterval 3600; purgewrite 3; writeformat writeprecision 6; binary; writecompression compressed; timeformat timeprecision 6; general; runtimemodifiable yes; The actual setting corresponds to the averaging.

13 USING THE CLUSTER 8 You can do the simulation by typing the following command (you should be at the simulation directory): qsub LES.run LES.run is is script file, which looks like: #!/bin/bash #$ -cwd #$ -S /bin/bash #$ -m aes #$ -M hbamba@gmail.com #$ -j y #$ -P LEScourse #$ -V. /share/apps/usr/openfoam/openfoam-1.7.1/etc/bashrc LMchannelFoam >> log This file specifies that you want to run the command LMchannelFoam» log. It set up a email address where information will be sent. The previous line set up the environmental variables needed by the code. In the case you are running the averaging, you have to submit more jobs which follow each-other after the previous one finished execution. This can be done easily: [lohasz@kovasznayl LESchannel_DMS]$ qsub LES.run Your job 1492 ("LES.run") has been submitted [lohasz@kovasznayl LESchannel_DMS]$ qsub -hold_jid 1492 LES.run Your job 1493 ("LES.run") has been submitted [lohasz@kovasznayl LESchannel_DMS]$ qsub -hold_jid 1493 LES.run Your job 1498 ("LES.run") has been submitted In this case you specify the previous job by the -hold_jid AAA flag, where AAA is job id of your previous job. So if your job finished the next one will start immediately. You have to specify so many consecutive jobs, that you averaging time is enough, you can also increase the length of the jobs by changing writeinterval 3600; to a higher value below 82800.

14 CONTENT OF THE LESCHANNEL PACKAGE 9 14 Content of the LESchannel package ~/.foamlog.db $FOAM_RUN/LESchannel/ $FOAM_RUN/../src/