Coupled Motion of Two Floating Objects. Minghao Wu

Size: px
Start display at page:

Download "Coupled Motion of Two Floating Objects. Minghao Wu"

Transcription

1 Project assignment for the course CFD with OpenSource Software, 2015 Minghao Wu Department of Shipping and Marine Technology Chalmers University of Technology

2 Introduction Introduction of the topic Environment: OpenFOAM 2.4.x, interdymfoam Two cases Uncoupled motion of two floating objects

3 Uncoupled motion of two floating objects Uncoupled motion of two floating objects Description Description

4 Uncoupled motion of two floating objects Terminal Command cp -r $FOAM_TUTORIALS/multiphase/interDyMFoam/ras/floatingObjec t $FOAM_RUN cd $FOAM_RUN mv floatingobject uncoupledfloatingobjects cd uncoupledfloatingobjects

5 Uncoupled motion of two floating objects blockmeshdict blockmeshdict Vertices ( (-1 0 0) (1 0 0) (1 1 0) (-1 1 0) (-1 0 1) (1 0 1) (1 1 1) (-1 1 1) ); floatingobject1 { type wall; faces (); } floatingobject2 { type wall; faces (); }

6 Uncoupled motion of two floating objects toposetdict toposetdict actions ( {name c1; type cellset; action new; source boxtocell; sourceinfo {box ( ) ( );} } {name c1; type cellset; action invert;} ); actions ( {name c2; type cellset; action new; source boxtocell; sourceinfo {box ( ) ( );} } {name c2; type cellset; action invert;} );

7 Uncoupled motion of two floating objects dynamicmeshdict dynamicmeshdict dynamicfvmesh dynamicmotionsolverfvmesh; motionsolverlibs ( "libsixdofrigidbodymotion.so" "libfvmotionsolvers.so" ); solver displacementlaplacian; displacementlaplaciancoeffs { diffusivity inversedistance (floatingobject1 floatingobject2); }

8 pointdisplacement Uncoupled motion of two floating objects pointdisplacement floatingobject1 {type sixdofrigidbodydisplacement; mass 4; centreofmass ( ); momentofinertia ( ); rhoname rhoinf; rhoinf 1; report on; value uniform (0 0 0); constraints {fixedpoint1 {sixdofrigidbodymotionconstraint point; centreofrotation ( );} } } floatingobject2 {type sixdofrigidbodydisplacement; mass 4; centreofmass ( ); momentofinertia ( ); rhoname rhoinf; rhoinf 1; report on; value uniform (0 0 0); constraints {fixedpoint2 {sixdofrigidbodymotionconstraint point; centreofrotation ( );} } }

9 Other boundary values Uncoupled motion of two floating objects Other boundary values cd $FOAM_RUN/uncoupledFloatingObjects/0.org sed -i s/floatingobject/floatingobject1/g * sed -i 37r<(sed 34,37!d alpha.water) alpha.water sed -i 45r<(sed 38,45!d epsilon) epsilon sed -i 39r<(sed 35,39!d k) k sed -i 44r<(sed 37,44!d nut) nut sed -i 41r<(sed 38,41!d p_rgh) p_rgh sed -i 38r<(sed 34,38!d U) U sed -i 0,/floatingObject1/! {0,/floatingObject1/ s/floatingobject1/floatingobject2/} *

10 Uncoupled motion of two floating objects fvsolution fvsolution "celldisplacement.*" { solver GAMG; tolerance 1e-8; reltol 0; smoother GaussSeidel; cacheagglomeration true; ncellincoarsestlevel 10; agglomerator faceareapair; mergelevels 1; }

11 Uncoupled motion of two floating objects Allrun Allrun runapplication blockmesh #run toposet for object1 #use runapplication runapplication toposet -dict system/object1toposet runapplication subsetmesh -overwrite c1 -patch floatingobject1 #Cleaning logs when runapplication is used rm log.toposet rm log.subsetmesh #run toposet for object2 #without runapplication toposet -dict system/object2toposet runapplication subsetmesh -overwrite c2 -patch floatingobject2 cp -r 0.org 0 > /dev/null 2>&1 runapplication setfields runapplication $application

12 Description Description Spring Damper Hinge Catenary

13 Description Description Two objects linked with springs

14 A glimpse of linearspring.c A glimpse of linearspring.c restraintposition = motion.transform(refattachmentpt_); r = restraintposition - anchor_; magr = mag(r); r /= (magr + VSMALL); restraintforce = -stiffness_*(magr-restlength_)*rdamping_*(r & v)*r;

15 Terminal command cd $WM_PROJECT_USER_DIR mkdir src cd $WM_PROJECT_DIR/src cp -r sixdofrigidbodymotion $WM_PROJECT_USER_DIR/src Cd $WM_PROJECT_USER_DIR/src mv sixdofrigidbodymotion mysixdofrigidbodymotion cd mysixdofrigidbodymotion cd mysixdofrigidbodymotion/sixdofrigidbodymotion/restraints cp -r linearspring couplinglinearspring cd couplinglinearspring mv linearspring.c couplinglinearspring.c mv linearspring.h couplinglinearspring.h sed -i s/linearspring/couplinglinearspring/g couplinglinearspring.*

16 Make/files Make/files restraints = sixdofrigidbodymotion/restraints $(restraints)/sixdofrigidbodymotionrestraint/sixdofrigidbodymotionrestraint.c $(restraints)/sixdofrigidbodymotionrestraint/sixdofrigidbodymotionrestraintnew. C $(restraints)/couplinglinearspring/couplinglinearspring.c LIB = $(FOAM_USER_LIBBIN)/libmysixDoFRigidBodyMotion

17 Identification of objects sixdofrigidbodymotion.h sixdofrigidbodymotion.h class sixdofrigidbodymotion { // Private data Switch report_; //- Name of the rigid body word rigidbodyname_; //- Name of the coupled body word coupledbodyname_; class sixdofrigidbodymotion {... Public... // Member Functions // Access inline bool report() const; //- Return the Name inline word rigidbodyname() const; //- Return the coupled body name inline word coupledbodyname() const;...

18 Identification of objects sixdofrigidbodymotioni.h sixdofrigidbodymotioni.h // * * * * * * * * * Member Functions * * * * * * * * * // inline Foam::scalar Foam::sixDoFRigidBodyMotion::mass() const { return mass_; }... inline Foam::word Foam::sixDoFRigidBodyMotion::rigidBodyName() const { return rigidbodyname_; } inline Foam::word Foam::sixDoFRigidBodyMotion::coupledBodyName() const { return coupledbodyname_; }

19 Identification of objects sixdofrigidbodymotion.c sixdofrigidbodymotion.c // * * * * * * * * * * Constructors * * * * * * * * * // Foam::sixDoFRigidBodyMotion::sixDoFRigidBodyMotion() :... report_(false), rigidbodyname_(), coupledbodyname_() {}... Foam::sixDoFRigidBodyMotion::sixDoFRigidBodyMotion (const dictionary& dict, const dictionary& statedict):... rigidbodyname_(dict.lookupordefault<word>("rigidbodyname","rigidbody 1")), coupledbodyname_(dict.lookupordefault<word>("coupledbodyname","none" )) {

20 Identification of objects sixdofrigidbodymotion.c sixdofrigidbodymotion.c Foam::sixDoFRigidBodyMotion::sixDoFRigidBodyMotion ( const sixdofrigidbodymotion& sdofrbm ) :... report_(sdofrbm.report_), rigidbodyname_(sdofrbm.rigidbodyname_), coupledbodyname_(sdofrbm.coupledbodyname_) {}...

21 Identification of objects sixdofrigidbodymotion.c sixdofrigidbodymotion.c void Foam::sixDoFRigidBodyMotion::status() const { Info<< "6-DoF rigid body motion" << nl << " Name of rigid body: " << rigidbodyname() << nl << " Centre of rotation: " << centreofrotation() << nl << " Centre of mass: " << centreofmass() << nl << " Orientation: " << orientation() << nl << " Linear velocity: " << v() << nl << " Angular velocity: " << omega() << endl; }

22 Identification of objects sixdofrigidbodymotionio.c sixdofrigidbodymotionio.c motionstate_.write(os);... os.writekeyword("rigidbodyname") << rigidbodyname_ << token::end_statement << nl; os.writekeyword("coupledbodyname") << coupledbodyname_ << token::end_statement << nl;

23 couplinglinearspring class OFstream and IFstream IFstream ( const filename& pathname, streamformat format=ascii, versionnumber version=currentversion ); // STL stream //- Access to underlying std::istream virtual istream& stdstream(); //- Const access to underlying std::istream virtual const istream& stdstream() const; OFstream and IFstream OFstream (const filename& pathname, streamformat format=ascii, versionnumber version=currentversion, compressiontype compression=uncompressed );

24 couplinglinearspring class couplinglinearspring.c couplinglinearspring.c // Foam classes #include "OFstream.H" #include "IFstream.H" #include "Vector.H" // std classes #include <stdio.h> #include <fstream> #include <iostream> #include <string.h> #include <stdlib.h>

25 couplinglinearspring class couplinglinearspring.c couplinglinearspring.c OFstream restrainpositionoutputx(motion.rigidbodyname()+"x"); OFstream restrainpositionoutputy(motion.rigidbodyname()+"y"); OFstream restrainpositionoutputz(motion.rigidbodyname()+"z"); IFstream AnchorInputX(motion.coupledBodyName()+"X"); IFstream AnchorInputY(motion.coupledBodyName()+"Y"); IFstream AnchorInputZ(motion.coupledBodyName()+"Z"); double AX,AY,AZ; char temp[100];

26 couplinglinearspring class couplinglinearspring.c couplinglinearspring.c AnchorInputX.stdStream().getline(temp, 100); AX=(double)strtod(temp,NULL); AnchorInputY.stdStream().getline(temp, 100); AY=(double)strtod(temp,NULL); AnchorInputZ.stdStream().getline(temp, 100); AZ=(double)strtod(temp,NULL); Vector<double> anchor_(ax, AY, AZ); restrainpositionoutputx << restraintposition.x()<< nl << endl; restrainpositionoutputy << restraintposition.y()<< nl << endl; restrainpositionoutputz << restraintposition.z()<< nl << endl; Info<< " anchor position " << anchor_<< endl;

27 couplinglinearspring class Compiling Compiling cd $WM_PROJECT_USER_DIR/src/sixDoFRigidBodyMotion wclean wmake libso Prepare for running cd $FOAM_RUN cp -r uncoupledfloatingobjects coupledfloatingobjects

28 0.org/pointDisplacement Run the case floatingobject1 { rigidbodyname floatingobject1; coupledbodyname floatingobject2; type sixdofrigidbodydisplacement; mass 4; centreofmass ( ); momentofinertia ( ); rhoname rhoinf; rhoinf 1; report on; value uniform (0 0 0); constraints... restraints { horizontalspring { sixdofrigidbodymotionrestraint CouplinglinearSpring; anchor $anchorofobj1; refattachmentpt ( ); stiffness 35; damping 0; restlength 0.2; } }

29 0.org/pointDisplacement Run the case floatingobject2 { rigidbodyname floatingobject2; coupledbodyname floatingobject1; type sixdofrigidbodydisplacement; mass 4; centreofmass ( ); momentofinertia ( ); rhoname rhoinf; rhoinf 1; report on; value uniform (0 0 0); constraints... restraints { horizontalspring { sixdofrigidbodymotionrestraint CouplinglinearSpring; anchor $anchorofobj1; refattachmentpt ( ); stiffness 35; damping 0; restlength 0.2; } }

30 Constant/dynamicMeshDict Run the case motionsolverlibs ( "libmysixdofrigidbodymotion.so" "libfvmotionsolvers.so" );

31 Run the case Allrun and Allclean Allrun echo "-0.1" >& floatingobject1x echo "0.5" >& floatingobject1y echo "0.6" >& floatingobject1z echo "0.1" >& floatingobject2x echo "0.5" >& floatingobject2y echo "0.6" >& floatingobject2z Allclean rm floatingobject?x rm floatingobject?y rm floatingobject?z

32 Results and Discussions Results Uncoupled case Coupled case t=0s

33 Results and Discussions Results Uncoupled case Coupled case t=0.5s

34 Results and Discussions Results Uncoupled case Coupled case t=1.0s

35 Results and Discussions Results Uncoupled case Coupled case t=1.5s

36 Results and Discussions Results Uncoupled case Coupled case t=2.5s

37 Results and Discussions Results Uncoupled case Coupled case t=3.5s

38 Results and Discussions Discussions

39 Results and Discussions Suggestions for balancing the force In couplinglinearspring.c restraintposition = motion.transform0 (refattachmentpt_); // Use transform instead of transform function In sixdofrigidbodymotion.h // Transformations inline point transform(const point& initialpoints) const; //not changed inline point transform0(const point& initialpoints) const; // added In sixdofrigidbodymotioni.h inline Foam::point Foam::sixDoFRigidBodyMotion::transform0(const point& initialpoint) const { return (centreofrotation() + (Q0() & initialq_.t() & (initialpoint - initialcentreofrotation_))); } // return the tranformation of a point based on previous-step motion

40 Results and Discussions Suggestions for balancing the force Time step should be small if stiffness is high. Slowly varying spring force means it is possible to use transformation based on previous time step motion. Set damping to 0.

41 Results and Discussions Discussions Use dictionary to execute I/O and exchange information between patches It is possible to extend to multiple objects Restraints can be modified to be shared with two objects

Coupled motion of two floating objects

Coupled motion of two floating objects CFD with OpenSource software A course at Chalmers University of Technology Taught by Håkan Nilsson Project work: Coupled motion of two floating objects Developed for OpenFOAM-2.4.x Author: Minghao Wu Peer

More information

A tutorial of the sixdofrigidbodymotion library with multiple bodies

A tutorial of the sixdofrigidbodymotion library with multiple bodies CFD with OpenSource software A course at Chalmers University of Technology Taught by Håkan Nilsson Project work: A tutorial of the sixdofrigidbodymotion library with multiple bodies Developed for OpenFOAM-2.4.x

More information

Modifying sixdofrigidbodymotion library to match eigenfrequency of a sprung rod with vortex shedding due to

Modifying sixdofrigidbodymotion library to match eigenfrequency of a sprung rod with vortex shedding due to CFD with OpenSource software A course at Chalmers University of Technology Taught by Håkan Nilsson Project work: Modifying sixdofrigidbodymotion library to match eigenfrequency of a sprung rod with vortex

More information

An Unsteady-Periodic Flow generated by a Oscillating Moving Mesh

An Unsteady-Periodic Flow generated by a Oscillating Moving Mesh CFD with OpenSource software A course at Chalmers University of Technology Taught by Håkan Nilsson Project work: An Unsteady-Periodic Flow generated by a Oscillating Moving Mesh Developed for OpenFOAM-2.1.x

More information

MSc/PhD course in CFD with OpenSource software, 2011

MSc/PhD course in CFD with OpenSource software, 2011 MSc/PhD course in CFD with OpenSource software, 2011 Implementation of lift and drag coefficinets in transient condition Developed for OpenFOAM-1.7-x Håkan Nilsson, Chalmers/ Applied Mechanics/ Fluid Dynamics

More information

How to implement a new boundary condition

How to implement a new boundary condition How to implement a new boundary condition The implementations of the boundary conditions are located in $FOAM_SRC/finiteVolume/fields/fvPatchFields/ To add a new boundary condition, start by finding one

More information

How to implement a new boundary condition

How to implement a new boundary condition How to implement a new boundary condition Håkan Nilsson, Chalmers / Applied Mechanics / Fluid Dynamics 1 How to implement a new boundary condition The implementations of the boundary conditions are located

More information

Moving Wave class. 1. Introduction

Moving Wave class. 1. Introduction Moving Wave class 1. Introduction This tutorial describes how to generate moving waves in OpenFoam. This class can be used to simulate for example the effect of ocean waves on offshore structures. A mesh

More information

Presentation slides for the course CFD with OpenSource Software 2015

Presentation slides for the course CFD with OpenSource Software 2015 Presentation slides for the course CFD with OpenSource Software 2015 Sebastian Kohlstädt Applied Mechanics/Fluid Dynamics, Chalmers University of Technology, Gothenburg, Sweden 2015-12-08 Sebastian Kohlstädt

More information

Force based motion of a submerged object using immersed boundary method

Force based motion of a submerged object using immersed boundary method Cite as: Siggeirsson, E.M.V.: Force based motion of a submerged object using immersed boundary metod. In Proceedings of CFD with OpenSource Software, 2016, http://www.tfd.chalmers.se/~hani/kurser/os_cfd_2016

More information

OpenFOAM. in wastewater applications: 2 - Getting Started th June 2015

OpenFOAM. in wastewater applications: 2 - Getting Started th June 2015 OpenFOAM in wastewater applications: 2 - Getting Started n elson.marques@bluecape.com.pt 13-14 th June 2015 Progress Introduction OpenFOAM characterization bluecfd installation Getting started Simulation

More information

Roll Motion of a Box and Interaction with Free-Surface

Roll Motion of a Box and Interaction with Free-Surface CHALMERS UNIVERSITY OF TECHNOLOGY Project work for the PhD course in CFD WITH OPEN SOURCE SOFTWARE Roll Motion of a Box and Interaction with Free-Surface Author: Arash Eslamdoost arash.eslamdoost@chalmers.se

More information

How to implement a new boundary condition

How to implement a new boundary condition How to implement a new boundary condition The implementations of the boundary conditions are located in $FOAM_SRC/finiteVolume/fields/fvPatchFields/ Toaddanewboundarycondition,startbyfindingonethatdoesalmostwhatyouwant.

More information

Project work for the PhD course in OpenFOAM

Project work for the PhD course in OpenFOAM Project work for the PhD course in OpenFOAM A tutorial on how to use Dynamic Mesh solver IcoDyMFOAM Performed by: Pirooz Moradnia Contact: pirooz.moradnia@forbrf.lth.se Spring 2008, Göteborg-Sweden Introduction:

More information

MovingWave class cuttingplane class Velocity Profile postprocess

MovingWave class cuttingplane class Velocity Profile postprocess MovingWave class cuttingplane class Velocity Profile postprocess Modify a moving mesh class Short overview of cuttingplane class Write a post process utility MovingWave class There is already implemented

More information

Convective Heat transfer in a vertical slot for the course CFD with OpenSource Software

Convective Heat transfer in a vertical slot for the course CFD with OpenSource Software for the course CFD with OpenSource Software Applied Mechanics/Fluid Dynamics, Chalmers University of Technology, Gothenburg, Sweden December 10, 2016 December 10, 2016 1 / Contents 1 Introduction 2 buoyantboussinesqsimplefoam

More information

OpenFOAM Tutorials: Programming Session

OpenFOAM Tutorials: Programming Session OpenFOAM Tutorials: Programming Session Hrvoje Jasak and Henrik Rusche h.jasak@wikki.co.uk, h.rusche@wikki-gmbh.de Wikki, United Kingdom and Germany Advanced Training at the OpenFOAM Workshop 21.6.2010,

More information

Dynamic mesh refinement in dieselfoam

Dynamic mesh refinement in dieselfoam Division of Combustion Department of Applied Mechanics Chalmers University of Technology CFD with OpenSource software, project Dynamic mesh refinement in dieselfoam Author: Anne Kösters Developed for OpenFOAM-1.6.x

More information

CFD WITH OPENSOURCE SOFTWARE. How to make a dynamicmotionrefinefvmesh class

CFD WITH OPENSOURCE SOFTWARE. How to make a dynamicmotionrefinefvmesh class CFD WITH OPENSOURCE SOFTWARE A COURSE AT CHALMERS UNIVERSITY OF TECHNOLOGY TAUGHT BY HÅKAN NILSSON Project work: How to make a dynamicmotionrefinefvmesh class Developed for OpenFOAM-2.4.x Author: Bjarke

More information

OpenFOAM Tutorial. Adaptive mesh refinement. - The development of a new application. Anton Berce, October 16, 2010

OpenFOAM Tutorial. Adaptive mesh refinement. - The development of a new application. Anton Berce, October 16, 2010 OpenFOAM Tutorial Adaptive mesh refinement - The development of a new application, October 16, 2010, Chalmers / Solid and Fluid Dynamics 1 Project Definition Agenda Tutorial icoerrorestimate Tutorial refinemesh

More information

CFD with OpenSource software. A course at Chalmers University of Technology Taught by Håkan Nilsson. Project work: Make a fish swim

CFD with OpenSource software. A course at Chalmers University of Technology Taught by Håkan Nilsson. Project work: Make a fish swim CFD with OpenSource software A course at Chalmers University of Technology Taught by Håkan Nilsson Project work: Make a fish swim Developed for foam extend 4.0 and Openfoam 1706 version Requires: pimpledymfoam,

More information

Modelling of chemical batch reactor

Modelling of chemical batch reactor CFD with OpenSource software A course at Chalmers University of Technology Taught by Håkan Nilsson Project work: Modelling of chemical batch reactor Developed for OpenFOAM-2.4x Author: Rajukiran Antham

More information

A tutorial to urban wind flow using OpenFOAM for the course CFD with OpenSource Software

A tutorial to urban wind flow using OpenFOAM for the course CFD with OpenSource Software A tutorial to urban wind flow using OpenFOAM for the course CFD with OpenSource Software David Segersson Swedish Meteorological and Hydrological Institute & Stockholm University 2017-11-23 David Segersson

More information

How to implement an application

How to implement an application How to implement an application Håkan Nilsson, Chalmers / Mechanics and Maritime Sciences / Fluid Dynamics 1 Prerequisites How to implement an application You are familiar with the directory structure

More information

CFD with OpenFOAM Andreu Oliver González 14/12/2009

CFD with OpenFOAM Andreu Oliver González 14/12/2009 CFD with OpenFOAM Andreu Oliver González 14/12/2009 Introduction Mesh motion approaches and classes Procedure to define a mesh with motion Explanation of dynamicinkjetfvmesh class Modification of dynamicinkjetfvmesh

More information

A interphasechangefoam tutorial

A interphasechangefoam tutorial CFD with OpenSource software A course at Chalmers University of Technology Taught by Håkan Nilsson Project work: A interphasechangefoam tutorial Developed for OpenFOAM-2.0.x Author: Martin Andersen Peer

More information

Implementation of an air-entrainment model in interfoam for the course CFD with OpenSource Software

Implementation of an air-entrainment model in interfoam for the course CFD with OpenSource Software Implementation of an air-entrainment model in interfoam for the course CFD with OpenSource Software Silje Kreken Almeland Department of Civil and Environmental Engineering, Norwegian University of Science

More information

OpenFOAM. in wastewater applications: 4 - Simulation Process th June 2015

OpenFOAM. in wastewater applications: 4 - Simulation Process th June 2015 OpenFOAM in wastewater applications: 4 - Simulation Process n elson.marques@bluecape.com.pt 13-14 th June 2015 Progress Introduction OpenFOAM characterization bluecfd installation Getting started Simulation

More information

Setting up the watersprinkler case

Setting up the watersprinkler case Setting up the watersprinkler case The modifications should be done using the dambreak case, therefore we should copy it to a new directory run mkdir sprinkler cp -r $FOAM_TUTORIALS/multiphase/interFoam/laminar/damBreak

More information

Instructional workshop on OpenFOAM programming LECTURE # 4

Instructional workshop on OpenFOAM programming LECTURE # 4 Instructional workshop on OpenFOAM programming LECTURE # 4 Pavanakumar Mohanamuraly April 26, 2014 Outline Time derivative User defined boundary conditions - part I ddt operator fvc and fvm versions of

More information

How to get started with OpenFOAM at SHARCNET

How to get started with OpenFOAM at SHARCNET How to get started with OpenFOAM at SHARCNET, High Performance Technical Consultant SHARCNET, York University isaac@sharcnet.ca Outlines Introduction to OpenFOAM Compilation in SHARCNET Pre/Post-Processing

More information

A simple validation case Hagen-Poiseuille solution

A simple validation case Hagen-Poiseuille solution Hagen-Poiseuille solution Re = 100 Incompressible flow Physical and numerical side of the problem: The governing equations of the problem are the incompressible laminar Navier-Stokes equations. We are

More information

Folder structure and pre-defined File Names in OpenFOAM

Folder structure and pre-defined File Names in OpenFOAM Folder structure and re-defined File Names in OenFOAM Folder Sub-Folders Files / Folder Files / Folder Files / Folder Files / Folder Exlanation constant/ Allclean Allrun olymesh/ - - - oints File to remove

More information

A description of isoadvector - a numerical method for improved surface sharpness in two-phase flows

A description of isoadvector - a numerical method for improved surface sharpness in two-phase flows Cite as: Olsson, E.: A description of isoadvector - a numerical method for improved surface sharpness in two-phase flows. In Proceedings of CFD with OpenSource Software, 2017, Edited by Nilsson. H., http://dx.doi.org/10.17196/os_cfd#year_2017

More information

OpenFOAM directory organization

OpenFOAM directory organization OpenFOAM directory organization Håkan Nilsson, Chalmers / Mechanics and Maritime Sciences / Fluid Dynamics 1 OpenFOAM directory organization We will first browse the directories graphically in Linux. Below

More information

interphasechangefoam

interphasechangefoam interphasechangefoam This assignment is solved in OpenFOAM 2.0.x. How to apply a heat source to interphasechangefoam to evaporate water. In this presentation will go through the following steps: Short

More information

A FSI tutorial on the axialturbine tutorial case

A FSI tutorial on the axialturbine tutorial case CFD with OpenSource software A course at Chalmers University of Technology Taught by Håkan Nilsson Project work: A FSI tutorial on the axialturbine tutorial case Developed for FOAM-3.1-ext Case files:

More information

Lab 6 Due Date: Wednesday, April 5, /usr/local/3302/include/direct linking loader.h Driver File:

Lab 6 Due Date: Wednesday, April 5, /usr/local/3302/include/direct linking loader.h Driver File: Source File: ~/3302/lab06.C Specification File: /usr/local/3302/include/direct linking loader.h Driver File: /usr/local/3302/src/lab06main.c Implementation Starter File: /usr/local/3302/src/lab06.c.start

More information

Writing New Boundary Conditions in OpenFOAM

Writing New Boundary Conditions in OpenFOAM Writing New Boundary Conditions in OpenFOAM UK FOAM/OpenFOAM User Day Prof Gavin Tabor 18th April 2016 Aim of todays session... Let s create a new boundary condition in OpenFOAM!! We could do this in several

More information

Marine Hydrodynamics Solver in OpenFOAM

Marine Hydrodynamics Solver in OpenFOAM Marine Hydrodynamics Solver in OpenFOAM p. 1/14 Marine Hydrodynamics Solver in OpenFOAM Hrvoje Jasak and Henrik Rusche h.jasak@wikki.co.uk, h.rusche@wikki.co.uk Wikki, United Kingdom and Germany 4 December

More information

Exercise: Implement a rampedfixedvalue boundary condition (for OpenFOAM-2.1.x, and most likely 2.2.x)

Exercise: Implement a rampedfixedvalue boundary condition (for OpenFOAM-2.1.x, and most likely 2.2.x) Exercise: Implement a rampedfixedvalue boundary condition (for OpenFOAM-2.1.x, and most likely 2.2.x) Håkan Nilsson, Chalmers / Applied Mechanics / Fluid Dynamics 1 Pretend that you are in desperate need

More information

Coupling of Dakota and OpenFOAM for automatic parameterized optimization

Coupling of Dakota and OpenFOAM for automatic parameterized optimization CFD with OpenSource software 2013 A course at Chalmers University of Technology taught by Håkan Nilsson Coupling of Dakota and OpenFOAM for automatic parameterized optimization Developed for OpenFOAM-1.6-ext

More information

Notes on OpenFOAM cases. Daniel Duque Dep. Ciencias Aplicadas a la Ingeniería Naval ETSIN, UPM

Notes on OpenFOAM cases. Daniel Duque Dep. Ciencias Aplicadas a la Ingeniería Naval ETSIN, UPM Notes on OpenFOAM cases Daniel Duque Dep. Ciencias Aplicadas a la Ingeniería Naval ETSIN, UPM October 11, 2012 Contents 1 Setup 2 1.1 Installation............................ 2 1.2 Session setup...........................

More information

Due Date: See Blackboard

Due Date: See Blackboard Source File: ~/2315/45/lab45.(C CPP cpp c++ cc cxx cp) Input: under control of main function Output: under control of main function Value: 4 Integer data is usually represented in a single word on a computer.

More information

Strings and Stream I/O

Strings and Stream I/O Strings and Stream I/O C Strings In addition to the string class, C++ also supports old-style C strings In C, strings are stored as null-terminated character arrays str1 char * str1 = "What is your name?

More information

Implementation of soot model for aachenbomb tutorial

Implementation of soot model for aachenbomb tutorial CFD WITH OPENSOURCE SOFTWARE A COURSE AT CHALMERS UNIVERSITY OF TECHNOLOGY TAUGHT BY HÅKAN NILSSON Project work: Implementation of soot model for aachenbomb tutorial Developed for OpenFOAM-3.0.x Author:

More information

Adapting chtmultiregionsimplefoam to include the effects of a rotating frame of reference and heat source term

Adapting chtmultiregionsimplefoam to include the effects of a rotating frame of reference and heat source term Cite as: Niebles Atencio, B.: Adapting chtmultiregionsimplefoam to include the effects of a rotating frame of reference and heat source term. In Proceedings of CFD with OpenSource Software, 2017, Edited

More information

File I/O Christian Schumacher, Info1 D-MAVT 2013

File I/O Christian Schumacher, Info1 D-MAVT 2013 File I/O Christian Schumacher, chschuma@inf.ethz.ch Info1 D-MAVT 2013 Input and Output in C++ Stream objects Formatted output Writing and reading files References General Remarks I/O operations are essential

More information

OpenFOAM Project: Different ways to treat rotating geometries

OpenFOAM Project: Different ways to treat rotating geometries /*-------------------------------------------------------------------------------------------------------*\ ======== \\ / F ield OpenFOAM: The Open Source CFD Toolbox \\ / O peration \\ / A nd Copyright

More information

Fully turbulent flow around a sphere using OpenFOAM

Fully turbulent flow around a sphere using OpenFOAM Fully turbulent flow around a sphere using OpenFOAM In this tutorial you will simulate a fully turbulent flow with a Reynolds number of 1 million around a sphere with a radius of 1 m using a given CAD

More information

The ERCOFTAC centrifugal pump OpenFOAM case study

The ERCOFTAC centrifugal pump OpenFOAM case study The ERCOFTAC centrifugal pump OpenFOAM case study Olivier Petit and Håkan Nilsson Chalmers University of Technology, SVC Maryse Page and Martin Beaudoin Hydro Québec, Research Institute 4 th OpenFOAM workshop

More information

G52CPP C++ Programming Lecture 17

G52CPP C++ Programming Lecture 17 G52CPP C++ Programming Lecture 17 Dr Jason Atkin http://www.cs.nott.ac.uk/~jaa/cpp/ g52cpp.html 1 Last Lecture Exceptions How to throw (return) different error values as exceptions And catch the exceptions

More information

Coupling OpenFOAM and MBDyn with precice coupling tool

Coupling OpenFOAM and MBDyn with precice coupling tool Cite as: Folkersma, M.: Coupling OpenFOAM and MBDyn with precice coupling tool. In Proceedings of CFD with OpenSource Software, 2018, Edited by Nilsson. H., http://dx.doi.org/10.17196/os_cfd#year_2018

More information

Chapter 14 Sequential Access Files

Chapter 14 Sequential Access Files Chapter 14 Sequential Access Files Objectives Create file objects Open a sequential access file Determine whether a sequential access file was opened successfully Write data to a sequential access file

More information

Open Source Computational Fluid Dynamics

Open Source Computational Fluid Dynamics Open Source Computational Fluid Dynamics An MSc course to gain extended knowledge in Computational Fluid Dynamics (CFD) using open source software. Teachers: Miklós Balogh and Zoltán Hernádi Department

More information

CS101 Linux Shell Handout

CS101 Linux Shell Handout CS101 Linux Shell Handout Introduction This handout is meant to be used as a quick reference to get a beginner level hands on experience to using Linux based systems. We prepared this handout assuming

More information

Introduction to the Computer Exercices Turbulence: Theory and Modelling R.Z. Szasz, Energy Sciences, LTH Lund University

Introduction to the Computer Exercices Turbulence: Theory and Modelling R.Z. Szasz, Energy Sciences, LTH Lund University Introduction to the Computer Exercices Turbulence: Theory and Modelling R.Z. Szasz, Energy Sciences, LTH Lund University Outline VERY short CFD introduction Steps of problem solving The software used:

More information

Optimization of parameter settings for GAMG solver in simple solver

Optimization of parameter settings for GAMG solver in simple solver Optimization of parameter settings for GAMG solver in simple solver Masashi Imano (OCAEL Co.Ltd.) Aug. 26th 2012 OpenFOAM Study Meeting for beginner @ Kanto Test cluster condition Hardware: SGI Altix ICE8200

More information

Descriptions and comparisons of sprayfoam, reactingparcelfoam, and basicspraycloud, basicreactingcloud

Descriptions and comparisons of sprayfoam, reactingparcelfoam, and basicspraycloud, basicreactingcloud CFD with OpenSource software A course at Chalmers University of Technology Taught by Håkan Nilsson Project work: Descriptions and comparisons of sprayfoam, reactingparcelfoam, and basicspraycloud, basicreactingcloud

More information

OpenFOAM case: Mixing

OpenFOAM case: Mixing OpenFOAM case: Mixing nelson.marques@fsdynamics.pt; bruno.santos@fsdynamics.pt 30 th September 1 st October 2017 optim ises you rtec hnology 2 1 1. Case Description Overview Solver selection 2. Meshing

More information

Programming II with C++ (CSNB244) Lab 10. Topics: Files and Stream

Programming II with C++ (CSNB244) Lab 10. Topics: Files and Stream Topics: Files and Stream In this lab session, you will learn very basic and most common I/O operations required for C++ programming. The second part of this tutorial will teach you how to read and write

More information

CEE 618 Scientific Parallel Computing (Lecture 10)

CEE 618 Scientific Parallel Computing (Lecture 10) 1 / 20 CEE 618 Scientific Parallel Computing (Lecture 10) Computational Fluid Mechanics using OpenFOAM: Cavity (2) Albert S. Kim Department of Civil and Environmental Engineering University of Hawai i

More information

Strings and Streams. Professor Hugh C. Lauer CS-2303, System Programming Concepts

Strings and Streams. Professor Hugh C. Lauer CS-2303, System Programming Concepts Strings and Streams Professor Hugh C. Lauer CS-2303, System Programming Concepts (Slides include materials from The C Programming Language, 2 nd edition, by Kernighan and Ritchie, Absolute C++, by Walter

More information

Basics of C++ and object orientation in OpenFOAM

Basics of C++ and object orientation in OpenFOAM Basics of C++ and object orientation in OpenFOAM Tobeginwith:TheaimofthispartofthecourseisnottoteachallofC++, but to give a short introduction that is useful when trying to understand the contents of OpenFOAM.

More information

Summary of basic C++-commands

Summary of basic C++-commands Summary of basic C++-commands K. Vollmayr-Lee, O. Ippisch April 13, 2010 1 Compiling To compile a C++-program, you can use either g++ or c++. g++ -o executable_filename.out sourcefilename.cc c++ -o executable_filename.out

More information

Introduction to C++ Professor Hugh C. Lauer CS-2303, System Programming Concepts

Introduction to C++ Professor Hugh C. Lauer CS-2303, System Programming Concepts Introduction to C++ Professor Hugh C. Lauer CS-2303, System Programming Concepts (Slides include materials from The C Programming Language, 2 nd edition, by Kernighan and Ritchie, Absolute C++, by Walter

More information

Top-Level Code Walk-Through: scalartransportfoam and magu

Top-Level Code Walk-Through: scalartransportfoam and magu Top-Level Code Walk-Through: scalartransportfoam and magu Hrvoje Jasak and Henrik Rusche h.jasak@wikki.co.uk, h.rusche@wikki-gmbh.de Wikki, United Kingdom and Germany Advanced Training at the OpenFOAM

More information

Contributions to the Turbomachinery Working Group: Case Study: Single-Channel Pump & Function Object: turboperformance

Contributions to the Turbomachinery Working Group: Case Study: Single-Channel Pump & Function Object: turboperformance Contributions to the Turbomachinery Working Group: : & Function Object: M. Auvinen 1, N. Pedersen 2, K. Dahl 2, H. Nilsson 3 1 Department of Applied Mechanics, Fluid Mechanics Aalto University 2 Structural

More information

File I/O. File Names and Types. I/O Streams. Stream Extraction and Insertion. A file name should reflect its contents

File I/O. File Names and Types. I/O Streams. Stream Extraction and Insertion. A file name should reflect its contents File I/O 1 File Names and Types A file name should reflect its contents Payroll.dat Students.txt Grades.txt A file s extension indicates the kind of data the file holds.dat,.txt general program input or

More information

Object Oriented Programming COP3330 / CGS5409

Object Oriented Programming COP3330 / CGS5409 Object Oriented Programming COP3330 / CGS5409 Multiple Inheritance Template Classes and Functions Inheritance is supported by most object oriented languages C++ allows a special kind of inheritance known

More information

Adding the scalar transport equation to icofoam

Adding the scalar transport equation to icofoam Let us modify a solver, we will work with icofoam. We will add a passive scalar convection-diffusion equation). At this point, you can work in any directory. But we recommend you to work in your OpenFOAM

More information

Introduction to fluid mechanics simulation using the OpenFOAM technology

Introduction to fluid mechanics simulation using the OpenFOAM technology Introduction to fluid mechanics simulation using the OpenFOAM technology «Simulation in porous media from pore to large scale» Part II: Mesh complex geometries, application to the evaluation of permeability,

More information

Immersed Boundary Method in FOAM

Immersed Boundary Method in FOAM Immersed Boundary Method in FOAM Theory, Implementation and Use Hrvoje Jasak and Željko Tuković Chalmers University, Gothenburg Faculty of Mechanical Engineering and Naval Architecture, Zagreb Immersed

More information

PROGRAMMING EXAMPLE: Checking Account Balance

PROGRAMMING EXAMPLE: Checking Account Balance Programming Example: Checking Account Balance 1 PROGRAMMING EXAMPLE: Checking Account Balance A local bank in your town is looking for someone to write a program that calculates a customer s checking account

More information

Basics of C++ in OpenFOAM

Basics of C++ in OpenFOAM Basics of C++ in OpenFOAM Håkan Nilsson, Chalmers / Applied Mechanics / Fluid Dynamics 1 Basics of C++ in OpenFOAM To begin with: The aim of this part of the course is not to teach all of C++, but to give

More information

CS 1337 Computer Science II Page 1

CS 1337 Computer Science II Page 1 Source File: ~/1337/65/lab65.(C CPP cpp c++ cc cxx cp) Input: Under control of main function Output: Under control of main function Value: 3 The purpose of this assignment is to add to the implementation

More information

Implementation of a myinterfoamdiabatic Solver with OpenFOAM

Implementation of a myinterfoamdiabatic Solver with OpenFOAM CFD with OpenSource Software A course at Chalmers University of Technology Taught by Håkan Nilsson Project work: Implementation of a myinterfoamdiabatic Solver with OpenFOAM Developed for OpenFOAM-1.7.x

More information

Setting up a case for turbomachinery problems. OpenFOAM kurs 2009 Håkan Nilsson Olivier Petit

Setting up a case for turbomachinery problems. OpenFOAM kurs 2009 Håkan Nilsson Olivier Petit Setting up a case for turbomachinery problems OpenFOAM kurs 2009 Håkan Nilsson Olivier Petit Outline Pre-processing utilities: import a mesh, mergemesh, stitchmesh, transformpoints, creation of zones and

More information

Abstract Data Types (ADTs) 1. Legal Values. Client Code for Rational ADT. ADT Design. CS 247: Software Engineering Principles

Abstract Data Types (ADTs) 1. Legal Values. Client Code for Rational ADT. ADT Design. CS 247: Software Engineering Principles Abstract Data Types (ADTs) CS 247: Software Engineering Principles ADT Design An abstract data type (ADT) is a user-defined type that bundles together: the range of values that variables of that type can

More information

Despcription of an adjoint method for object optimization related to wind noise

Despcription of an adjoint method for object optimization related to wind noise CFD with OpenSource software A course at Chalmers University of Technology Taught by Håkan Nilsson Project work: Despcription of an adjoint method for object optimization related to wind noise Developed

More information

Auto Injector Syringe. A Fluent Dynamic Mesh 1DOF Tutorial

Auto Injector Syringe. A Fluent Dynamic Mesh 1DOF Tutorial Auto Injector Syringe A Fluent Dynamic Mesh 1DOF Tutorial 1 2015 ANSYS, Inc. June 26, 2015 Prerequisites This tutorial is written with the assumption that You have attended the Introduction to ANSYS Fluent

More information

AC55/AT55 OBJECT ORIENTED PROGRAMMING WITH C++ DEC 2013

AC55/AT55 OBJECT ORIENTED PROGRAMMING WITH C++ DEC 2013 Q.2 a. Discuss the fundamental features of the object oriented programming. The fundamentals features of the OOPs are the following: (i) Encapsulation: It is a mechanism that associates the code and data

More information

Generic external aerodynamic simulation training

Generic external aerodynamic simulation training Generic dynamic simulation move-csc UG www. Inst. Scientific Computing, TU Braunschweig 25.06.2012 1 / 57 Table of contents 1 2 3 4 5 6 7 8 Post-processing 2 / 57 Aim Focus of the presentation to present

More information

A hybrid slurry CFD model: Euler-Euler to Euler-Lagrange (in development)

A hybrid slurry CFD model: Euler-Euler to Euler-Lagrange (in development) MacKenzie, Alasdair (2017) A hybrid slurry CFD model : Euler-Euler to Euler-Lagrange (in development). In: 5th United Kingdom & Éire OpenFOAM User Meeting, 2017-01-16-2017-01-17, University College Dublin.,

More information

myenginefoam Implementation of different combustion model and newjanafthermo model

myenginefoam Implementation of different combustion model and newjanafthermo model myenginefoam Implementation of different and Lorenzo Bartolucci Department of Industrial Engineering University of Rome Tor Vergata Italy 28/11/2014 Lorenzo Bartolucci myenginefoam 1 Outline: implementation

More information

CS 247: Software Engineering Principles. ADT Design

CS 247: Software Engineering Principles. ADT Design CS 247: Software Engineering Principles ADT Design Readings: Eckel, Vol. 1 Ch. 7 Function Overloading & Default Arguments Ch. 12 Operator Overloading U Waterloo CS247 (Spring 2017) p.1/17 Abstract Data

More information

CSc Introduc/on to Compu/ng. Lecture 19 Edgardo Molina Fall 2011 City College of New York

CSc Introduc/on to Compu/ng. Lecture 19 Edgardo Molina Fall 2011 City College of New York CSc 10200 Introduc/on to Compu/ng Lecture 19 Edgardo Molina Fall 2011 City College of New York 18 Standard Device Files Logical file object: Stream that connects a file of logically related data to a program

More information

More tutorials. Håkan Nilsson, Chalmers/ Applied Mechanics/ Fluid Dynamics 67

More tutorials. Håkan Nilsson, Chalmers/ Applied Mechanics/ Fluid Dynamics 67 More tutorials Wewillnowlearnhowtousea(small)numberofusefulutilitiesandlibraries. Some of them are described in the UserGuide and ProgrammersGuide, and some ofthemhavebeendiscussedintheforum. Inyourhomeassignmentyouwillbeaskedtogothroughallthewrittentutorials

More information

Debugging OpenFOAM implementations with GDB

Debugging OpenFOAM implementations with GDB Debugging OpenFOAM implementations with GDB (Acknowledgements to Dr. Fabian Peng-Kärrholm) It is impossible to do bug-free programming(trust me!), so you should always verify your implementations. Whenyourunintoproblems,suchascodecrash,ormysteriousbehaviour,youalsoneed

More information

OpenFOAM Course. Assignment 1. Arash Eslamdoost

OpenFOAM Course. Assignment 1. Arash Eslamdoost OpenFOAM Course Assignment 1 arash.eslamdoost@chalmers.se 2009.10.05, Chalmers / Shipping and Marine Technology / Computational Hydrodynamics 1 SOLVER: icofoam Case: cavity Contour of velocity magnitude

More information

A hybrid slurry CFD model: Euler-Euler to Euler-Lagrange

A hybrid slurry CFD model: Euler-Euler to Euler-Lagrange 5th-6th December 2016 A hybrid slurry CFD model: Euler-Euler to Euler-Lagrange Alasdair Mackenzie Weir Advanced Research Centre, University of Strathclyde, Glasgow, Scotland Outline Background, context

More information

Implementing an application from scratch

Implementing an application from scratch Let us do a little bit of high level programming, this is the hard part of working with OpenFOAM. At this point, you can work in any directory. But we recommend you to work in your OpenFOAM user directory,

More information

A SHORT COURSE ON C++

A SHORT COURSE ON C++ Introduction to A SHORT COURSE ON School of Mathematics Semester 1 2008 Introduction to OUTLINE 1 INTRODUCTION TO 2 FLOW CONTROL AND FUNCTIONS If Else Looping Functions Cmath Library Prototyping Introduction

More information

Input/output. Remember std::ostream? std::istream std::ostream. std::ostream cin std::istream. namespace std { class ostream { /*...

Input/output. Remember std::ostream? std::istream std::ostream. std::ostream cin std::istream. namespace std { class ostream { /*... Input/output Remember std::ostream? namespace std { class ostream { /*... */ }; } extern istream cin; extern ostream cout; extern ostream cerr; extern ostream clog; 7 / 24 std::istream std::ostream std

More information

Modifying buoyantpimplefoam for the Simulation of Solid-Liquid Phase Change with Temperature-dependent Thermophysical Properties

Modifying buoyantpimplefoam for the Simulation of Solid-Liquid Phase Change with Temperature-dependent Thermophysical Properties Modifying buoyantpimplefoam for the Simulation of Solid-Liquid Phase Change with Temperature-dependent Thermophysical Properties Daniel Hummel Ostbayerische Technische Hochschule (OTH) Amberg-Weiden Friedrich-Alexander

More information

Due Date: See Blackboard

Due Date: See Blackboard Source File: ~/2315/28/lab28.cpp Input: under control of main function Output: under control of main function Value: 2 Write a function template that will process the elements of a vector and determine

More information

OpenFOAM. q Open source CFD toolbox, which supplies preconfigured solvers, utilities and libraries.

OpenFOAM. q Open source CFD toolbox, which supplies preconfigured solvers, utilities and libraries. OpenFOAM q Open source CFD toolbox, which supplies preconfigured solvers, utilities and libraries. q Flexible set of efficient C++ modules---object-oriented. q Use Finite-Volume Method (FVM) to solve systems

More information

Chapter 2. Procedural Programming

Chapter 2. Procedural Programming Chapter 2 Procedural Programming 2: Preview Basic concepts that are similar in both Java and C++, including: standard data types control structures I/O functions Dynamic memory management, and some basic

More information

OpenFOAM and Third Party Structural Solver for Fluid Structure Interaction Simulations

OpenFOAM and Third Party Structural Solver for Fluid Structure Interaction Simulations OpenFOAM and Third Party Structural Solver for Fluid Structure Interaction Simulations Robert L. Campbell rlc138@arl.psu.edu Fluids and Structural Mechanics Office Applied Research Laboratory The Pennsylvania

More information

Presentation of PAM-CRASH v2004. Part 1: Solver News

Presentation of PAM-CRASH v2004. Part 1: Solver News Presentation of PAM-CRASH v2004 Part 1: Solver News. 1 Overview New Options Elements Materials Others Quality Numerical precision and robustness 2 CRASH/SAFE 2G Evolution V2002: Basic reengineering Common

More information