Matlab


A short discussion on lateral wall effect on Lift/Drag Forces on a rigid body in a flow. And a question, too.

Based on my knowledge, forces on rigid bodies in a flow stream are given for an undefined flow field, from a Drag point of view, I mean. A practice problem I recently had was to evaluate the Lift/Drag forces on a body (a 60 m x 45 m rectangular body, in my case) close to two lateral walls.

At the moment, my only change was to do a numerical analysis. So, I performed the analysis by using Navier2d mathematical model, written in Matlab language (M-files and/and M-functions). I considered two cases:

  1. A 180 m wide channel with the obstacle 60 m large and 45 m long along the symmetry channel axes. The flow domain has been discredized with 23354 triangles and 11869 vertices, built by using Mesh2D toolbox;
  2. A 360 m wide channel with the obstacle 60 m large and 45 m long along the symmetry channel axes; The flow domain has been discredized with 11570 triangles and 5953 vertices, built by using Mesh2D toolbox.


The two geometries were forced with an uniform current of 1 m/s. The cinematic viscosity was set to 1.0e-6 m^2/s. No turbulence model for sub-grid analysis was used.

The following Figure shows an instant of motion (velocity magnitude) for both the cases. The vortex wake behind the body is well formed for either case.

 

I thought that the lateral walls influence on the forces determination could be negligible, given the same flow velocity. Viceversa, I obtained that the 360 m channel reduces the forces, both Lift (Fx) and Drag (Fy), on the body, as seen in Figure (quite noisy, but so far it is my best… anyway it is quite clear, isn’t it).

I guess the difference is due to the velocity gradient around the body, stronger for the 180 m channel. Does anyone have a physics-based proof ?

Peter Kovesi of School of Computer Science & Software Engineering - The University of Western Australia wrote some Matlab functions for image processing. I used them, founding interesting hints for my works. The m files can be downloaded following this link.

In particular, the following arguments are treated:

  1. Feature detection
  2. Edge detection
  3. Image denoising
  4. Grey scale transformation and enhancement
  5. Frequency domain transformations
  6. Functions supporting projective geometry
  7. Matching
  8. Model fitting and Robust estimation
  9. Lens Distortion Correction
  10. Image Display and Image Writing

I would like to receive comments and suggestions, because I am continously looking for functions to improve my image analysis skill.

AIOM is the Italian Association for Off-Shore and Marine Engineering.

AIOM publishes periodically a technical bulletin in italian language.

People interested in publishing technical articles, in italian, can submit them for evaluation to bollettino@aiom.info

AIOM bulletins are freely downloadable from the website: www.aiom.info

Follow this link to a useful (and free) matlab code that is basically a PDE solver adapted to common problems like diffusion, convection-diffusion, Stokes flow and Navier-Stokes flow problems (incompressible fluid dynamics).

I am talking about ifiss2.2 or Incompressible Flow & Iterative Solver Software Version 2.2.

There you will read that:

It has built-in multigrid and Krylov subspace solvers and includes a variety of appropriate preconditioning strategies for each problem.

Licence: LGPL

MESH2D is a toolbox for the generation and manipulation of unstructured triangular meshes in MATLAB.

High quality meshes can be generated automatically for user defined geometries. These meshes are suitable for subsequent Finite Element Method or Finite Volume Method analysis.

MESH2D is a Delaunay based algorithm with a “Laplacian-like” smoothing operation built into the mesh generation process. An unbalanced quadtree decomposition is used to evaluate the element size distribution required to resolve the geometry. The quadtree is triangulated and used as a backgorund mesh to store the element size data. The main method attempts to optimise the node location and mesh topology through an iterative process. In each step a constrained delaunay triangulation is generated with a series of “Laplacian-like” smoothing operations used to improve triangle quality. Nodes are added or removed from the mesh to ensure the required element size distribution is approximated.

MESH2D is Copyright (C) 2005-2006 Darren Engwirda (d_engwirda@hotmail.com).MESH2D is distributed under the GNU GPL.

I am pretty sure that any hydraulic engineer wants to have a code for integrating Navier-Stokes equations over a complex domain. Fortunately there are some cool guys who share their work.This is what Navier-Stokes Solver (Navier2d) is: a Matlab solver of motion of incompressible fluids via a solution of the Navier-Stokes equations in 2-D domains, discretized by unstructured meshes. Only the incompressible equations are solved, so the flow speed has to be sufficiently low (Mach Number < 0.3).

Navier2d includes three options:

  1.  Normal – solves the Navier-Stokes equations for the velocity and pressure fields.
  2. Tracer – as above, but also solves an additional transport equation for a scalar quantity within the flow.
  3. Thermal – as above, but treats the scalar tracer field as the temperature of the fluid and includes buoyancy terms in the momentum equations. This allows the solution of coupled thermal problems (like thermal convection).

In Navier2d no turbulence model is implemented. At high Reynolds numbers this becomes very important, because it is necessary to account for sub-grid scale effects. This limitation can be by-passed reducing the grid size, at least in domain zones where the momentum exchanges are important.

Navier2d supports three Boundary Condition types: known velocities and two outflow types.

You need a mesh generator to create general domains. The same author created a 2-D mesh generator (MESH2D). Details of mesh2D can be found here.

Navier2d is Copyright (C) 2005-2006 Darren Engwirda (d_engwirda@hotmail.com). Navier2d is distributed under the GNU GPL.

tags : , ,

By using Partial Differential Equation Toolbox of Matlab language, I generated a simple problem of confined seepage. To use it

  1. save flow_v2.m (mouse right button and save destination as)
  2. open Matlab;
  3. type pdetool at the Matlab command line;
  4. open saved flow_v2.m.m through pdetool toolbox window.

You’ll see the results in terms of equipotential contour and water velocity field (red arrows), based on Laplace equation and Dirichlet boundary conditions.

Of this example, you can edit:

  • Geometry;
  • Boundary conditions;
  • FEM mesh;
  • Results visualization;

A Canadian environmental engineer friend of mine asked me a consultancy on Groundwater Mathematical Modelling; water seepage through levees, in his case.

I took this occasion for updating my personal list of softwares (free, partially free, and not free) that perform groundwater calculations.

Details of mathematical models herein described are taken from their own web-sites.

MODFLOW: MODFLOW is the name that has been given the USGS (United States Geological Survey) Modular Three-Dimensional finite-difference Groundwater Flow Model. MODFLOW can represent the effects of wells, rivers, streams, drains, horizontal flow barriers, evapotranspiration, and recharge on flow. Potentiality of MODFLOW is that it can include many other modules to perform specific calculation, e.g. MOC3D a three-dimensional method-of-characteristics ground-water flow and transport model; MODPATH a particle tracking post-processing package; ZONEBDGT a computer program for calculating subregional water budgets. But many others tools are available that can fit your needs. It is widely used 2000 version of MODFLOW, but recently this version was upgraded by 2005 version. The standard version of MODFLOW is public-domain.

SEEP2D: SEEP2D is a 2-D finite-element flow model designed to compute seepage on profile models, such as for earthen dam and levee cross sections. SEEP2D can be used to model confined, partially confined, and unconfined flow situations. For partially-confined and unconfined flow situations, both the saturated and unsaturated flow is simulated and the phreatic surface determined. SEEP2D is a steady-state flow model and it computes the flow value at each node of the finite-element mesh. You have to pay for SEEP2D model. Anyhow it is easy to use: SEEP2D makes few things, but it works well.

Z_SOIL. PC: is a finite element package designed for solving geotechnical problems in two and three dimensions. The program can represent, among others: gravity fields and initial stress conditions, water table and water pressures under steady state or transient conditions, including time dependent boundary conditions, drained and undrained soil conditions, unloading control for convergence analysis in tunnels. In Demo version, Z_SOIL.PC can solve problems unlimited in time but limited in size to: 400 nodes and/or 25 structural elements (beams, trusses, membranes) for 2D problems; 600 nodes and/or 50 structural elements (beams, trusses, membranes, shells) for 3D problems. Prices varies between 2D and 3D version, and for academic and professional users.

GSM: GSM is a comprehensive graphical user environment for performing groundwater simulations. The entire GMS system consists of a graphical user interface (the GMS program) and a number of analysis codes (MODFLOW, MT3DMS, RT3D, SEAM3D, MODPATH, MODAEM, SEEP2D, FEMWATER, WASH123D, UTCHEM). The GMS interface was developed by the Environmental Modeling Research Laboratory of Brigham Young University in partnership with the U.S. Army Engineer Waterways Experiment Station. GMS was designed as a comprehensive modeling environment. Several types of models are supported and facilities are provided to share information between different models and data types. GSM is a nice tool. My favorite, absolutely, above all the last version 6.0. GSM is not for free (see prices). In DEMO mode you can work freely, but you can’t save your project.

In my opinion, the funniest way to model groundwater flows is implementing your own code, e.g in Matlab language. Just Matlab has the Partial Differential Equation Toolbox (PDE), an environment for the study and solution of partial differential equations in two space dimensions and time. The equations are discretized by the Finite Element Method (FEM). An easy-to-use Graphical User Interface (typing pdetool at the Matlab command line) completes this Matlab toolbox.

tags : , , ,

DHI released the new MATLAB DFS interface library. This is a major extension compared to the previous version (2004). The new version supports e.g. read and write of flexible mesh data (dfsu 2D and 3D).

From DHIgroup website, I see that th new MATLAB DFS interface provides different levels of support for different file types:

  • dfs0: read, write, create
  • dfs1, dfs2 ,dfs3: read only
  • dfsu 2D and 3D: read and write
  • mesh files and xyz files: read and create

This Matlab toolbox is a good point for all DHI software and Matlab users who want to exploit Matlab built-in functions to manage and visualize multi-dimensional data.

The matlab code and an user guide can be downladed here and here.

Who doesn’t know (and use) Matlab? Personally, I used to take great advantage of its powerful toolboxes to achieve my hydraulics-related tasks. But in France I made an interesting discovery.

I’ve been using this open-source Matlab alternative during the past six month and, to say the truth, I’m quite satisfied.

I have done some signal filtering, some statistics, some plotting stuff for my job without major problems… well, you have to know you are handling with a non commercial tool. Anyway, If your budget is limited, think about it.

I think that what makes this project different (and more reliable in theory) is the list of non-negligible sponsors, members of the SciLab Consortium, and the (not-so-well manged) directory of additional contributed toolboxes, among which I could try only the HYDROGR one, and just for trivial purpose.

So, let me know what you think about that, in the case you tested it.