load "msh3"

// Parameters
int nn = 20; // Mesh quality

// Mesh
int[int] labs = [1, 2, 2, 1, 1, 2]; // Label numbering
mesh3 Th = cube(nn, nn, nn, label=labs);
// Remove the ]0.5,1[^3 domain of the cube
Th = trunc(Th, (x < 0.5) | (y < 0.5) | (z < 0.5), label=1);

// Fespace
fespace Vh(Th, P1);
Vh u, v;

// Macro
macro Grad(u) [dx(u), dy(u), dz(u)] //

// Define the weak form and solve
solve Poisson(u, v, solver=CG)
    = int3d(Th)(
          Grad(u)' * Grad(v)
          1 * v
    + on(1, u=0)

// Plot
plot(u, nbiso=15);

A high level multiphysics finite element software

FreeFEM offers a fast interpolation algorithm and a language for the manipulation of data on multiple meshes.

Easy to use PDE solver

FreeFEM is a popular 2D and 3D partial differential equations (PDE) solver used by thousands of researchers across the world.

It allows you to easily implement your own physics modules using the provided FreeFEM language. FreeFEM offers a large list of finite elements, like the Lagrange, Taylor-Hood, etc., usable in the continuous and discontinuous Galerkin method framework.

Pre-built physics

Strong mesh and parallel capabilities

FreeFEM has it own internal mesher, called BAMG, and is compatible with the best open-source mesh and visualization software like Tetgen, Gmsh, Mmg and ParaView.

Written in C++ to optimize for speed, FreeFEM is interfaced with the popular mumps, PETSc and HPDDM solvers.

HPC in the cloud integration

7 lines of python code and a Qarnot Computing Logo account is all you need to run a FreeFEM simulation in the cloud.

Thanks to a partnership with Qarnot's advanced HPC platform, you won't have to worry about deploying FreeFEM on the cloud, everything is automated.

Learn how to run FreeFEM with Qarnot's sustainable HPC platform on Qarnot's blog.

Latest Articles

August 27, 2020 | Florian Feppon, Grégoire Allaire, Charles Dapogny, Pierre Jolivet

Body-fitted topology optimization of 2D and 3D fluid-to-fluid heat exchangers

We present a topology optimization approach for the design of fluid-to-fluid heat exchangers which rests on an explicit meshed discretization of the phases at stake, at every iteration of the optimization process. The considered physical situations involve a weak coupling between the Navier–Stokes equations for the velocity and the pressure in the fluid, and the convection–diffusion equation for the temperature field. The proposed framework combines several recent techniques from the field of shape and topology optimization, and notably a level-set based mesh evolution algorithm for tracking shapes and their defor- mations, an efficient optimization algorithm for constrained shape optimization problems, and a numerical method to handle a wide variety of geometric constraints such as thickness constraints and non-penetration constraints. Our strategy is applied to the optimization of various types of heat exchangers. At first, we consider a simplified 2D cross-flow model where the optimized boundary is the section of the hot fluid phase flowing in the transverse direction, which is naturally composed of multiple holes. A minimum thickness constraint is imposed on the cross-section so as to account for manufacturing and maximum pressure drop constraints. In a second part, we optimize the design of 2D and 3D heat exchangers composed of two types of fluid channels (hot and cold), which are separated by a solid body. A non-mixing constraint between the fluid components containing the hot and cold phases is enforced by prescribing a minimum distance between them. Numerical results are presented on a variety of test cases, demonstrating the efficiency of our approach in generating new, realistic, and unconventional heat exchanger designs.

March 30, 2020 | Florian Feppon, Grégoire Allaire, Charles Dapogny, Pierre Jolivet

Topology optimization of thermal fluid-structure systems using body-fitted meshes and parallel computing

An efficient framework is described for the shape and topology optimization of realistic three-dimensional, weakly-coupled fluid-thermal-mechanical systems. At the theoretical level, the proposed methodology relies on the boundary variation of Hadamard for describing the sensitivity of functions with respect to the domain. From the numerical point of view, three key ingredients are used: (i) a level set based mesh evolution method allowing to describe large deformations of the shape while maintaining an adapted, high-quality mesh of the latter at every stage of the optimization process; (ii) an efficient constrained optimization algorithm which is very well adapted to the infinite-dimensional shape optimization context; (iii) efficient preconditioning techniques for the solution of large finite element systems in a reasonable computational time. The performance of our strategy is illustrated with two examples of coupled physics: respectively fluid-structure interaction and convective heat transfer. Before that, we perform three other test cases, involving a single physics (structural, thermal and aerodynamic design), for comparison purposes and for assessing our various tools: in particular, they prove the ability of the mesh evolution technique to capture very thin bodies or shells in 3D.

December 13, 2019 | Lèye Babacar, Tine Léon Matar, Sy Mamadou

Optimal Control of Thermal Pollution Emitted by Power Plants

The coastal areas near thermal or nuclear plants are subject to hot water discharges produced by cooling processes. These activities induce an increase of the temperature near the outlet vicinity, which can extend for miles. The temperature variation affects the metabolic rate of organisms and the level of dissolved oxygen. Cooling by cold water from an additional discharge can be considered in order to limit this thermal pollution. This paper present a methodology based on the implementation of a two-dimensional numerical model to study the dynamic of the temperature originated from the industrial discharges. Moreover the optimal injection rate of cold water is sought to keep the water temperature as close as possible to the survival of the ecosystem. Numerical simulations are performed to illustrate the efficiency approach.



JSIAM 2020

FreeFEM tutorial: Fluid-Structure interaction problem in a monolithic form and its implementation are shown.
Zoom webinar, Japan

11-13 MAY 2020


Des outils libres et puissants de prototypage pour la simulation multiphysique avec freefem++!
Paris, France

17-19 DECEMBER 2019

FreeFEM Days

Join us for the FreeFEM Days 2019 edition !
Paris, France

You are in good company

Sorbonne université INRIA ANR Genci CNRS