Moving boundary in openfoam



Similar documents
A simplefoam tutorial

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

OpenFOAM. The Open Source CFD Toolbox. User Guide

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

Simple beginning 3D OpenFOAM Tutorial

OpenFOAM Tutorial. 4. Units

OpenFOAM Opensource and CFD

Solver Development in OpenFOAM

Application of Wray-Agarwal Model to Turbulent Flow in a 2D Lid-Driven Cavity and a 3D Lid- Driven Box

Which strategy to move the mesh in the Computational Fluid Dynamic code OpenFOAM

Auxiliary Processing swak4foam and PyFoam

TVM 4155 Numerical modelling and hydraulics 10. March OpenFOAM homework

Numerical Modelling of Regular Waves Propagation and Breaking Using Waves2Foam

How To Run A Steady Case On A Creeper

OpenFOAM postprocessing and advanced running options

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.

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

CastNet: Modelling platform for open source solver technology

CFD Simulation of Subcooled Flow Boiling using OpenFOAM

CFD Analysis of Container Ship Sinkage, Trim and Resistance

OpenFOAM open source CFD on ANSELM

CastNet: GUI environment for OpenFOAM

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

Self Financed One Week Training

Open Source Computational Fluid Dynamics

OpenFOAM: Open source CFD in research and industry

OpenFOAM-extend on SourceForge.net

CFD software overview comparison, limitations and user interfaces

Model of a flow in intersecting microchannels. Denis Semyonov

Numerical Wave Generation In OpenFOAM R

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

OPTIMISE TANK DESIGN USING CFD. Lisa Brown. Parsons Brinckerhoff

STUDY OF MESH DEFORMATION FEATURES OF AN OPEN SOURCE CFD PACKAGE AND APPLICATION TO A GEAR PUMP SIMULATION

A moving piston boundary condition including gap flow in OpenFOAM

STCE. Outline. Introduction. Applications. Ongoing work. Summary. STCE RWTH-Aachen, Industrial Applications of discrete adjoint OpenFOAM, EuroAD 2014

Tutorial: Using a UDF to Control the Dynamic Mesh of a Flexible Oscillating Membrane

The Multiphase Capabilities of the CFD Toolbox OpenFOAM for Hydraulic Engineering Applications

CFD Simulation of the NREL Phase VI Rotor

Coupling micro-scale CFD simulations to meso-scale models

Christof Hinterberger, Mark Olesen

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

THE CFD SIMULATION OF THE FLOW AROUND THE AIRCRAFT USING OPENFOAM AND ANSA

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.

HPC Deployment of OpenFOAM in an Industrial Setting

Radiation heat transfer in OpenFOAM

Open Source CFD Solver - OpenFOAM

Effect of Aspect Ratio on Laminar Natural Convection in Partially Heated Enclosure

CFD modelling of floating body response to regular waves

NUMERICAL INVESTIGATIONS ON HEAT TRANSFER IN FALLING FILMS AROUND TURBULENCE WIRES

System-Level Simulation of Floating Platform and Wind Turbine Using High-Fidelity and Engineering Models

Eu-NORSEWInD - Assessment of Viability of Open Source CFD Code for the Wind Industry

CFD: What is it good for?

Mathematical modeling of energy flow in a geothermal reservoir

LSCFD: Meshing Tools for Open Source CFD A Practical Point of View

POLITECNICO DI MILANO Department of Energy

How To Create A Cdf Optimisation System

Importing Boundary and Volume Meshes

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

Quality and Reliability in CFD

TwinMesh for Positive Displacement Machines: Structured Meshes and reliable CFD Simulations

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

Numerical Simulations of Pulsed-Air Mixing Technology using Multiphase Computational Fluid Dynamics Methods

Getting started with CFD packages. OpenFOAM R and FLUENT R

Performance Comparison of a Vertical Axis Wind Turbine using Commercial and Open Source Computational Fluid Dynamics based Codes

Marine CFD applications using OpenFOAM

OpenFOAM Optimization Tools

bluecape s Official Website

Lecture 16 - Free Surface Flows. Applied Computational Fluid Dynamics

A DISCRETE ADJOINT VERSION OF AN UNSTEADY INCOMPRESSIBLE SOLVER FOR OPENFOAM USING ALGORITHMIC DIFFERENTIATION

CFD SIMULATION OF IPR-R1 TRIGA SUBCHANNELS FLUID FLOW

HowTo Rhino & ICEM. 1) New file setup: choose Millimeter (automatically converts to Meters if imported to ICEM)

Faculty of Science and Technology MASTER S THESIS

Numerical Analysis of the Jeans Instability

Application of a Tightly-Coupled CFD/6-DOF Solver For Simulating Offshore Wind Turbine Platforms

Loads and response from steep and breaking waves on monopiles

Adaptation of General Purpose CFD Code for Fusion MHD Applications*

Laminar Flow in a Baffled Stirred Mixer

Impact CM: Model-Based Software Change and Configuration Management

OpenFOAM computation of interacting wind turbine flows and control (I): free rotating case

CFD SIMULATION OF NATURAL GAS COMBUSTION AND IST APPLICATION TO TUNNEL KILN FIRING

CFD SIMULATION OF SDHW STORAGE TANK WITH AND WITHOUT HEATER

Steady Flow: Laminar and Turbulent in an S-Bend

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

1. Lid driven flow in a cavity [Time: 1 h 30 ]

CS 103 Lab Linux and Virtual Machines

Good Practice in CFD. A rough guide.

Recent Developments in OpenFOAM

NUMERICAL SIMULATION OF FLOW FIELDS IN CASE OF FIRE AND FORCED VENTILATION IN A CLOSED CAR PARK

Design and Optimization of OpenFOAM-based CFD Applications for Hybrid and Heterogeneous HPC Platforms

URI and UUID. Identifying things on the Web.

Flow in data racks. 1 Aim/Motivation. 3 Data rack modification. 2 Current state. EPJ Web of Conferences 67, (2014)

Turbulence Modeling in CFD Simulation of Intake Manifold for a 4 Cylinder Engine

Computational Modeling of Wind Turbines in OpenFOAM

This tutorial provides a recipe for simulating L

How To Model A Horseshoe Vortex

1. Fluids Mechanics and Fluid Properties. 1.1 Objectives of this section. 1.2 Fluids

OpenFOAM Simulation for Electromagnetic Problems. Zhe Huang. Master of Science Thesis in Electric Power Engineering

Introduction to COMSOL. The Navier-Stokes Equations

ABS TECHNICAL PAPERS 2008 A STERN SLAMMING ANALYSIS USING THREE-DIMENSIONAL CFD SIMULATION. Suqin Wang SWang@eagle.org

Transcription:

Moving boundary in openfoam Linear motion - OpenFoam #2 Julien Réveillon University of Rouen and CORIA Julien.reveillon@coria.fr http://www.cfdandco.com 7 juin 2012 Intent: The objective is to present the procedure to generate a moving boundary mesh. It is directly inspired of the work of Gonzalez [Mesh motion alternatives in OpenFoam Andreu Oliver Gonzalez December 2009, Göteborg, Sweden], which contains much more details. It has been adapted to the interdymfoam solver in order to work on a water tank case. Prerequisites: All the environment variables concerning openfoam must be correctly defined. OF solver compilation knowledge necessary c.f. OF #1). Procedure: 1/ Creation of the working repository jr:~/openfoam/jr-2.1.0/run$ cp -r $FOAM_TUTORIALS/multiphase/interDyMFoam/ras/damBreakWithObstacle movingbc 2/ Grid construction jr:~/openfoam/jr2.1.0/run$ cd movingbc jr:~/openfoam/jr2.1.0/run/movingbc$ gedit constant/polymesh/blockmeshdict And modify the file according to annex 1. jr:~/openfoam/jr/2.1.0/run/movingbc$ blockmesh

3/ Solver preparation interdymfoam is modified so that only the mesh motion is computed. No resolution of the fluid will be carried out. First, let's go in the user solver repository see OF #1). jr:~/openfoam/jr-2.1.0/run/movingbc$ cd ~/OpenFOAM/jr-2.1.0/solvers/ One will use interdymfoam. There is a small peculiarity : interdymfoam is part of interfoam solver and needs the «creatfields.h» file for the interfoam solver to compile. Thus we need to copy the complete interfoam + interdymfoam solver : jr:~/openfoam/jr-2.1.0/solvers$ cp -r $FOAM_SOLVERS/multiphase/interFoam BCFoam Just to be clear, rename interdymfoam : jr:~/openfoam/jr-2.1.0/solvers$ mv BCFoam/interDyMFoam BCFoam/meshBCFoam Then, continue the renaming jr:~/openfoam/jr-2.1.0/solvers$ cd BCFoam/meshBCFoam jr:~/openfoam/jr-2.1.0/solvers/bcfoam/meshbcfoam$ mv interdymfoam.c meshbcfoam.c in file Make/files jr:~/openfoam/jr-2.1.0/solvers/bcfoam/meshbcfoam$ gedit Make/files Modify warning : do not forget FOAM_USER_APPBIN) such as meshbcfoam.c EXE = $FOAM_USER_APPBIN)/meshBCFoam 4/Modification of the code Edit the solver: jr:~/openfoam/jr-2.1.0/solvers/bcfoam/meshbcfoam $ gedit meshbcfoam.c and comment the parts that does not concern the mesh.update. /* JR */ in annex 2). 5/Compilation jr:~/openfoam/jr- 2.1.0/solvers/BCFoam/meshBCFoam$ wclean

jr:~/openfoam/jr- 2.1.0/solvers/BCFoam/meshBCFoam$ wmake 6/ Initial Fields Back in your 'run' directory, initial fields. jr:~/openfoam/jr- 2.1.0/solvers/BCFoam/meshBCFoam$ cd ~/OpenFOAM/jr- 2.1.0/run/movingBC jr:~/openfoam/jr- 2.1.0/run/movingBC $ mv 0.org 0 jr:~/openfoam/jr- 2.1.0/run/movingBC $ gedit 0/alpha1 0/p_rgh 0/U Modify the face names so that it corresponds to boundaries and do not generate errors. Fields won't be used anyway. Annex 3-4- 5 7/ Set the prefcell and prefvalue jr:~/openfoam/jr- 2.1.0/run/movingBC/0$ cd.. jr:~/openfoam/jr- 2.1.0/run/movingBC$ gedit system/fvsolution Put the prefcell value to 0 prefvalue remains null). prefcell 0; in the PIMPLE section. 9/ Set the moving boundary properties. jr:~/openfoam/jr-2.1.0/run/movingbc$ gedit constant/dynamicmeshdict See Appendix 6 10/ Set the execution properties. jr:~/openfoam/jr- 2.1.0/run/movingBC$ gedit system/controldict See Appendix 7 11/ Run jr:~/openfoam/jr- 2.1.0/run/movingBC$ meshbcfoam

12/ Visualization

Annex 1 blockmeshdict /*--------------------------------*- C++ -*----------------------------------*\ ========= \\ / F ield OpenFOAM: The Open Source CFD Toolbox \\ / O peration Version: 1.6 \\ / A nd Web: http://www.openfoam.org \\/ M anipulation FoamFile version 2.0; format ascii; class dictionary; object blockmeshdict; converttometers 0.1; vertices -3 0 0) 0 0 0) 0 1 0) -3 1 0) -3 0 0.1) 0 0 0.1) 0 1 0.1) -3 1 0.1) ); blocks hex 0 1 2 3 4 5 6 7) 60 20 1) simplegrading 1 1 1) ); edges ); patches patch atmosphere 3 7 6 2) ) wall movingwall 0 4 7 3) ) wall fixedwalls 1 2 6 5) 1 5 4 0) ) empty frontandback 0 3 2 1) 4 5 6 7) ) ); mergepatchpairs );

Annex 2 meshbcfoam.c /*---------------------------------------------------------------------------*\ ========= \\ / F ield OpenFOAM: The Open Source CFD Toolbox \\ / O peration \\ / A nd Copyright C) 2011 OpenFOAM Foundation \\/ M anipulation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Application meshbcfoam Description Solver for 2 incompressible, isothermal immiscible fluids using a VOF volume of fluid) phase-fraction based interface capturing approach, with optional mesh motion and mesh topology changes including adaptive re-meshing. #include "fvcfd.h" #include "dynamicfvmesh.h" #include "MULES.H" #include "subcycle.h" #include "interfaceproperties.h" #include "twophasemixture.h" #include "turbulencemodel.h" #include "pimplecontrol.h" int mainint argc, char *argv[]) #include "setrootcase.h" #include "createtime.h" #include "createdynamicfvmesh.h" #include "initcontinuityerrs.h" #include "createfields.h" #include "readtimecontrols.h" pimplecontrol pimplemesh);

/* JR surfacescalarfield phiabs"phiabs", phi); fvc::makeabsolutephiabs, U); #include "correctphi.h" #include "CourantNo.H" #include "setinitialdeltat.h"*/ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nstarting time loop\n" << endl; while runtime.run)) #include "readcontrols.h" #include "alphacourantno.h" #include "CourantNo.H" #include "setdeltat.h" runtime++; Info<< "Time = " << runtime.timename) << nl << endl; scalar timebeforemeshupdate = runtime.elapsedcputime); /* JR // Calculate the relative velocity used to map the relative flux phi volvectorfield Urel"Urel", U); */ if mesh.moving)) Urel -= fvc::reconstructfvc::meshphiu)); // Do any mesh changes mesh.update);

/* JR if mesh.changing)) Info<< "Execution time for mesh.update) = " << runtime.elapsedcputime) - timebeforemeshupdate << " s" << endl; gh = g & mesh.c); ghf = g & mesh.cf); if mesh.changing) && correctphi) #include "correctphi.h" if mesh.changing) && checkmeshcourantno) #include "meshcourantno.h" twophaseproperties.correct); #include "alphaeqnsubcycle.h" // --- Pressure-velocity PIMPLE corrector loop while pimple.loop)) #include "UEqn.H" // --- Pressure corrector loop while pimple.correct)) #include "peqn.h" */ if pimple.turbcorr)) turbulence->correct); runtime.write); Info<< "ExecutionTime = " << runtime.elapsedcputime) << " s" << " ClockTime = " << runtime.elapsedclocktime) << " s" << nl << endl; Info<< "End\n" << endl; return 0;

Annex 3 alpha1 /*--------------------------------*- C++ -*----------------------------------*\ ========= \\ / F ield OpenFOAM: The Open Source CFD Toolbox \\ / O peration Version: 2.1.0 \\ / A nd Web: www.openfoam.org \\/ M anipulation FoamFile version 2.0; format ascii; class volscalarfield; object alpha1; dimensions [0 0 0 0 0 0 0]; internalfield uniform 0; boundaryfield movingwall fixedwalls zerogradient; zerogradient; atmosphere inletoutlet; inletvalue uniform 0; value uniform 0; frontandback empty;

Annex 4 p_rgh /*--------------------------------*- C++ -*----------------------------------*\ ========= \\ / F ield OpenFOAM: The Open Source CFD Toolbox \\ / O peration Version: 2.1.0 \\ / A nd Web: www.openfoam.org \\/ M anipulation FoamFile version 2.0; format ascii; class volscalarfield; object p_rgh; dimensions [1-1 -2 0 0 0 0]; internalfield uniform 0; boundaryfield movingwall buoyantpressure; value uniform 0; fixedwalls buoyantpressure; value uniform 0; atmosphere totalpressure; p0 uniform 0; U U; phi phi; rho rho; psi none; gamma 1; value uniform 0; frontandback empty;

Annex 5 U /*--------------------------------*- C++ -*----------------------------------*\ ========= \\ / F ield OpenFOAM: The Open Source CFD Toolbox \\ / O peration Version: 2.1.0 \\ / A nd Web: www.openfoam.org \\/ M anipulation FoamFile version 2.0; format ascii; class location "0"; object U; volvectorfield; dimensions [0 1-1 0 0 0 0]; internalfield uniform 0 0 0); boundaryfield fixedwalls fixedvalue; value uniform 0 0 0); movingwall movingwallvelocity; value uniform 0 0 0); atmosphere pressureinletoutletvelocity; value uniform 0 0 0); frontandback empty;

Annex 6 /*--------------------------------*- C++ -*----------------------------------*\ ========= \\ / F ield OpenFOAM: The Open Source CFD Toolbox \\ / O peration Version: 2.1.0 \\ / A nd Web: www.openfoam.org \\/ M anipulation FoamFile version 2.0; format ascii; class dictionary; location "constant"; object dynamicmeshdict; dynamicfvmesh dynamicinkjetfvmesh; motionsolverlibs "libfvmotionsolvers.so" ); dynamicinkjetfvmeshcoeffs amplitude 0.3; frequency 2; refplanex 0;

Annex 7 /*--------------------------------*- C++ -*----------------------------------*\ ========= \\ / F ield OpenFOAM: The Open Source CFD Toolbox \\ / O peration Version: 2.1.0 \\ / A nd Web: www.openfoam.org \\/ M anipulation FoamFile version 2.0; format ascii; class dictionary; location "system"; object controldict; application startfrom interdymfoam; latesttime; starttime 0; stopat endtime; endtime 2; deltat 0.001; writecontrol timestep; writeinterval 10; purgewrite 0; writeformat ascii; writeprecision 6; writecompression uncompressed; timeformat general; timeprecision 6; runtimemodifiable yes; adjusttimestep no; maxco 0.1; maxalphaco 0.1; maxdeltat 1;