OpenFOAMslides-02 (1185932), страница 3
Текст из файла (страница 3)
Volume integrals of the source terms may also require thesevalues. They have to be expressed in terms of the nodal values byinterpolation.How the value ofφand its normal derivative at cell face `e' can beapproximated?Ilias Sibgatullin (Moscow University)OpenFOAM course 1: theory of FVM19 ìàÿ 2016 ã.42 / 89The Algebraic Equation SystemBy summing all the ux approximations and source terms, we produce analgebraic equation which relates the variable value at the center of the CVto the values at several neighbor CVs.The numbers of equations and unknowns are both equal to the number ofCVs so the system is well-posed.This is true only for structured grids with quadrilateral or hexahedral CVs;for other geometries, the matrix structure will be more complex but it willalways be sparse.The maximum number of elements in any row is equal to the number ofnear neighbors for second order approximations.For higher-order approximations, it depends on the number of neighborsused in the scheme.Ilias Sibgatullin (Moscow University)OpenFOAM course 1: theory of FVM19 ìàÿ 2016 ã.43 / 89Client server modelThe providers of a resource or service are called servers and servicerequesters are called clients.Ilias Sibgatullin (Moscow University)OpenFOAM course 1: theory of FVM19 ìàÿ 2016 ã.44 / 89What is relationship of Client Server to Client Patron in Rome (clientela)?Question asked by Mech.
& Math. faculty auditorium obviously it is not Cibernetics faculty.Modern Clientela Italian Maa.At this momentDon Corleonedemands:call me aServerIlias Sibgatullin (Moscow University)OpenFOAM course 1: theory of FVM19 ìàÿ 2016 ã.45 / 89Process of numerical simulation on Unihub.ruIlias Sibgatullin (Moscow University)OpenFOAM course 1: theory of FVM19 ìàÿ 2016 ã.46 / 89вычисл узел n1УправляющаяМашинакластераМСЦ РАНвычисл узел n2вычисл узел n3vcn.unicluster.ruuserуправляющаяМашинадля доступак ресурсамunihubweb-interfaceof UNIHUB.RUdesktop.weblab.cloud.unihub.ru...Кластеранализабольшихданныхsl-BIGдля входа на упраляющий узел кластера с sl-BIG:ssh -X vcn.unicluster.ruдля входа на вычислительные узлы:qsub -I -l walltime=00:10:00,nodes=1:ppn=8Ilias Sibgatullin (Moscow University)OpenFOAM course 1: theory of FVM...19 ìàÿ 2016 ã.47 / 89Access to computational clustersTo enter on the management node of the cluster:ssh -X vcn.unicluster.ruIlias Sibgatullin (Moscow University)OpenFOAM course 1: theory of FVM19 ìàÿ 2016 ã.48 / 89Cluster managementBatch queuing for HPC clustersAn important niche for job schedulers is managing the job queue for acluster of computers.
Typically, the scheduler will schedule jobs from thequeue as sucient resources (cluster nodes) become idle. Some widely usedR , Univa Gridcluster batch systems are Moab, Argent Job SchedulerEngine, Portable Batch System, LoadLeveler, Condor, OAR, Simple LinuxUtility for Resource Management (SLURM), OpenLava, and IBM'sPlatform LSF.The Terascale Open-source Resource and QUEue Manager(TORQUE) is a distributed resource manager providing control over batchTORQUEjobs and distributed compute nodes.Portable Batch System (or simply PBS)is the name of computer softwarethat performs job scheduling.
Its primary task is to allocate computationaltasks, i.e., batch jobs, among the available computing resources. It is oftenused in conjunction with UNIX cluster environments.Ilias Sibgatullin (Moscow University)OpenFOAM course 1: theory of FVM19 ìàÿ 2016 ã.49 / 89Background execution (batch mode)1) Ñîçäàòü çàäàíèå (myjob):#PBS -l walltime=HH:MM:SS,nodes=[# of nodes]:ppn=[# of cores]#PBS -q workq@master#PBS -M samov@ispras.ru#PBS -m abe#PBS -N jobname#!/bin/shcd [path to the programm/data]mpirun -np [nodes]õ[cores] -machinefile $PBS_NODELIST [programs]2) Submit a job in queue for executionqsub myjob3) Job statusqstatqstat -f [ID çàäàíèÿ]Ilias Sibgatullin (Moscow University)OpenFOAM course 1: theory of FVM19 ìàÿ 2016 ã.50 / 89Interactive execution on computational nodes1) Submit an interactive job to the queue for execution[master@jx0]$qsub -I -l walltime=HH:MM:SS,nodes=[nodes]:ppn=[cores][job ID].[job name][master@jx64]$2) Execute a programm[master@jx64]$ cd [path to a programm/data][master@jx64]$ mpirun -np [nodes]õ[cores] -machinefile $PBS_NODELISTEnvironmental variables:echoechoechoechoechoechoechoecho...$PBS_ENVIRONMENT$PBS_JOBNAME$PBS_O_PATH$PBS_QUEUE$PBS_JOBID$PBS_NODEFILE$PBS_O_HOST$PBS_O_WORKDIRIlias Sibgatullin (Moscow University)OpenFOAM course 1: theory of FVM19 ìàÿ 2016 ã.51 / 89Important Environment Variables$WM_PROJECT_DIR path to the OpenFOAM installation$WM_PROJECT_USER_DIR OpenFOAM user directory$FOAM_TUTORIALS OpenFOAM tutorials$FOAM_SRC source-tree of OpenFOAM libraries$FOAM_APP source-tree of OpenFOAM applications$FOAM_APPBIN directory with the applications$FOAM_USER_APPBIN directory with the applications created by the u$FOAM_LIBBIN directory with the libraries provided by OpenFOAM$FOAM_USER_LIBBIN directory with the libraries created by the user$FOAM_RUN directory where the user can put his/her casesImportant Shell-Aliasesrun cd to $FOAM_RUNsrc cd to $FOAM_SRCapp cd to $FOAM_APPutil cd to $FOAM_APP/utilitiessol cd to $FOAM_APP/solversIlias Sibgatullin (Moscow University)OpenFOAM course 1: theory of FVM19 ìàÿ 2016 ã.52 / 89Basic Case Structure (Áàçîâàÿ ñòðóêòóðà ïðèìåðà)Case boundary value problemm with initial conditions.
Çàäà÷à ñãðàíè÷íûìè óñëîâèÿìè è íà÷àëüíûìè äàííûìè.case relative or absolute path to the casecase/ the case directory+ 0/ ñîäåðæèò íà÷àëüíûå è ãðàíè÷íûå óñëîâèÿ+ constant/ constant data (äàííûå è êîíñòàíòû)+ polyMesh/ ñîäåðæèò äàííûå ñåòêè+ transportProperties âÿçêîñòü+ system/ run-time control / numerics+ controlDict run-time control (ïàðàìåòðû äëÿ êîíòðîëÿ çàäà÷è)+ fvSchemes numerical schemes (ðàñ÷åòíûå ñõåìû)+ fvSolution ðåøàòåëè äëÿ ÑËÀÓcase/0/ contains for each variable a e defning the initial andboundary conditions. May also contain initial and boundary conditionsfor a moving grid.case/constant/polyMesh/ contains the grid data for a non-movinggrid.
The es are: boundary, faces, neighbour, owner, points.case/constant/transportProperties 1:defnesIliasSibgatullin (Moscow University)OpenFOAM coursetheory of theFVMviscosityfor19 (alsoìàÿ 2016ã.53 / 89OpenFOAM structureOpenFOAM consists of solvers and utilities.Solvers are designed to solve a specic kind of problem in continuummechanics.Utilities are designed for data manipulation.Ilias Sibgatullin (Moscow University)OpenFOAM course 1: theory of FVM19 ìàÿ 2016 ã.54 / 89OpenFOAM tutorialsTutorials are located in directory, indicated by$FOAM_TUTORIALSenvironment variable.
Tutorials are grouped by directories with descriptivenames:DNSbasiccombustioncompressiblediscreteMethodselectromagneticsfinancialheatTransferincompressiblelagrangianmeshmultiphaseresourcesstressAnalysisIlias Sibgatullin (Moscow University)OpenFOAM course 1: theory of FVM19 ìàÿ 2016 ã.55 / 89Case structureConstant directory contains a description of thecase mesh in a subdirectory polyMesh and lesspecifying physical properties for the applicationconcerned, e.g.transportProperties.Systemdirectoryforsettingparametersassociated with the solution procedure itself.Itcontainsatleastthefollowing3les:controlDict where run control parameters areset including start/end time, time step andparameters for data output; fvSchemes wherediscretisationschemesusedinthesolutionmay be selected at run-time; and, fvSolutionwhere the equation solvers, tolerances and otheralgorithm controls are set for the run.The `time' directories Initial values and boundaryconditions that the user must specify to denetheproblem;or,resultswrittentolebyOpenFOAM.Ilias Sibgatullin (Moscow University)OpenFOAM course 1: theory of FVM19 ìàÿ 2016 ã.56 / 89Case study: Lid-driven cavity owIlias Sibgatullin (Moscow University)OpenFOAM course 1: theory of FVM19 ìàÿ 2016 ã.57 / 89MeshingThe most basic and simple mesh generation tool for OpenFOAM isblockMesh utility.
It can create a structured mesh in a rectangulargeometry. The mesh is described in the le blockMeshDict located insystemdirectory of current case.Ilias Sibgatullin (Moscow University)OpenFOAM course 1: theory of FVM19 ìàÿ 2016 ã.58 / 89/*--------------------------------*- C++ -*----------------------------------*\| =========||| \\/ F ield| OpenFOAM: The Open Source CFD Toolbox|| \\/ O peration| Version: 3.0.x|| \\ /A nd| Web:www.OpenFOAM.org||\\/M anipulation ||\*---------------------------------------------------------------------------*/FoamFile{version2.0;formatascii;classdictionary;objectblockMeshDict;}// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //convertToMeters 0.1;vertices((0 0(1 0(1 1(0 1(0 0(1 0(1 1(0 1);0)0)0)0)0.1)0.1)0.1)0.1)blocks(hex (0 1 2 3 4 5 6 7) (20 20 1) simpleGrading (1 1 1));edges(Ilias); Sibgatullin (Moscow University)OpenFOAM course 1: theory of FVM19 ìàÿ 2016 ã.59 / 89edges();boundary(movingWall{type wall;faces((3 7 6 2));}fixedWalls{type wall;faces((0 4 7 3)(2 6 5 1)(1 5 4 0));}frontAndBack{type empty;faces((0 3 2 1)(4 5 6 7));});Ilias Sibgatullin (Moscow University)OpenFOAM course 1: theory of FVM19 ìàÿ 2016 ã.60 / 89Boundary conditionsBoundary and initial conditions are usually set in the subdirectory0of thecase in le, whose name correspond to names of variables.To set dimensions of variablesIlias Sibgatullin (Moscow University)dimensionSetentry is used.OpenFOAM course 1: theory of FVM19 ìàÿ 2016 ã.61 / 89/*--------------------------------*- C++ -*----------------------------------*\| =========||| \\/ F ield| OpenFOAM: The Open Source CFD Toolbox|| \\/ O peration| Version: 3.0.x|| \\ /A nd| Web:www.OpenFOAM.org||\\/M anipulation ||\*---------------------------------------------------------------------------*/FoamFile{version2.0;formatascii;classvolScalarField;objectp;}// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //dimensions[0 2 -2 0 0 0 0];internalFielduniform 0;boundaryField{movingWall{type}fixedWalls{type}}frontAndBack{type}zeroGradient;zeroGradient;empty;Ilias Sibgatullin (Moscow University)OpenFOAM course 1: theory of FVM19 ìàÿ 2016 ã.62 / 89/*--------------------------------*- C++ -*----------------------------------*\| =========||| \\/ F ield| OpenFOAM: The Open Source CFD Toolbox|| \\/ O peration| Version: 3.0.x|| \\ /A nd| Web:www.OpenFOAM.org||\\/M anipulation ||\*---------------------------------------------------------------------------*/FoamFile{version2.0;formatascii;classvolVectorField;objectU;}// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //dimensions[0 1 -1 0 0 0 0];internalFielduniform (0 0 0);boundaryField{movingWall{typevalue}fixedWalls{typevalue}fixedValue;uniform (1 0 0);fixedValue;uniform (0 0 0);frontAndBack{typeempty;Ilias Sibgatullin(Moscow University)}OpenFOAM course 1: theory of FVM19 ìàÿ 2016 ã.63 / 89Physical propertiesPhysical properties are set in constant subdirectory of a case in les, withnames ending by..Properties/*--------------------------------*- C++ -*----------------------------------*\| =========||| \\/ F ield| OpenFOAM: The Open Source CFD Toolbox|| \\/ O peration| Version: 3.0.x|| \\ /A nd| Web:www.OpenFOAM.org||\\/M anipulation ||\*---------------------------------------------------------------------------*/FoamFile{version2.0;formatascii;classdictionary;location"constant";objecttransportProperties;}// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //nu[0 2 -1 0 0 0 0] 0.01;// ************************************************************************* //Ilias Sibgatullin (Moscow University)OpenFOAM course 1: theory of FVM19 ìàÿ 2016 ã.64 / 89Solution controlStart and end- time of execution, timestep and write control are set incontrolDictle of constant subdirectoryEnsure that Courant number is less than 1:Co =δx =d0.1== 0.005mn20δt <Ilias Sibgatullin (Moscow University)δt|U |δx0.005= 0.005|U | = 1OpenFOAM course 1: theory of FVM19 ìàÿ 2016 ã.65 / 89/*--------------------------------*- C++ -*----------------------------------*\| =========||| \\/ F ield| OpenFOAM: The Open Source CFD Toolbox|| \\/ O peration| Version: 3.0.x|| \\ /A nd| Web:www.OpenFOAM.org||\\/M anipulation ||\*---------------------------------------------------------------------------*/FoamFile{version2.0;formatascii;classdictionary;location"system";objectcontrolDict;}// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //applicationicoFoam;startFromstartTime;startTime0;stopAtendTime;endTime0.5;deltaT0.005;writeControltimeStep;writeInterval 20;purgeWrite0;writeFormatascii;writePrecision 6;writeCompression off;timeFormatgeneral;timePrecision 6;runTimeModifiable true;Ilias Sibgatullin (Moscow University)OpenFOAM course 1: theory of FVM19 ìàÿ 2016 ã.66 / 89Discretisation and linear-solver settingsFinite volume discretisation schemes are set in the fvSchemes dictionary inthe system directory.The specication of the linear equation solvers and tolerances and otheralgorithm controls is made in the fvSolution dictionary,Ilias Sibgatullin (Moscow University)OpenFOAM course 1: theory of FVM19 ìàÿ 2016 ã.67 / 89PostprocessingViewing the meshIsosurface and contour plotsVector plotsStreamline plotsIlias Sibgatullin (Moscow University)OpenFOAM course 1: theory of FVM19 ìàÿ 2016 ã.68 / 89Increasing the mesh resolution.