FreeFEM
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)
    )
    -int3d(Th)(
          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.

Examples of Associated book:

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

With Qarnot's HPC platform, 7 lines of python code is all you need to run a FreeFEM simulation in the cloud. Learn how to run FreeFEM with Qarnot's sustainable HPC platform on Qarnot's blog.

FreeFEM is also available on Rescale's ScaleX® Pro. Rescale offers academic users up to 500 core hours on their HPC cloud.

Video tutorials

Thanks to Mojtaba Barzegari

Latest Articles

December 22, 2024

Bounds for higher Steklov and mixed Steklov Neumann eigenvalues on domains with holes

Sagar Basak, Sheela Verma

In this article, we study Steklov eigenvalues and mixed Steklov Neumann eigenvalues on a smooth bounded domain in $\mathbb{R}^{n}$, $n \geq 2$, having a spherical hole. We focus on two main results related to Steklov eigenvalues. First, we obtain explicit expression for the second nonzero Steklov eigenvalue on concentric annular domain. Secondly, we derive a sharp upper bound of the first $n$ nonzero Steklov eigenvalues on a domain $\Omega \subset \mathbb{R}^{n}$ having symmetry of order $4$ and a ball removed from its center. This bound is given in terms of the corresponding Steklov eigenvalues on a concentric annular domain of the same volume as $\Omega$. Next, we consider the mixed Steklov Neumann eigenvalue problem on $4^{\text{th}}$ order symmetric domains in $\mathbb{R}^{n}$ having a spherical hole and obtain upper bound of the first $n$ nonzero eigenvalues. We also provide some examples to illustrate that symmetry assumption in our results is crucial. Finally, We make some numerical observations about these eigenvalues using FreeFEM++ and state them as conjectures.

December 19, 2024

FreeFEM analysis of thermally induced higher-grade Darcy-Forchheimer flow through heated semi-circular cylinders

Muhammad Sabeel Khan, Azmat Urunbayev

In this article, a higher-grade Darcy-Forchheimer porous model is derived by using the concepts of tensor calculus. The model presented is accounting for non-linear flow behavior at highly permeable media where the flow is induced by temperature boundary conditions. To this end, a square geometry with two semi-circular heating cylinders mounted at its bottom wall is considered for the analysis of thermal flow dynamics. To solve the obtained coupled system of highly nonlinear partial differential equations the finite element procedure is adopted. Weak formulation of the problem is calculated via the application of variational calculus. The numerical algorithm is implemented through the open source code FreeFEM++. Obtained solutions are validated by reduced model with exact solutions. Mesh independence of the solution is shown through mesh independence analysis test. Results are computed for varying physical parameters with some interesting new observations. Moreover, streamline plots for the velocities and isotherms are shown and discussed. It is found that the Nusselt number increases with increasing Grashhoff and Frochheimer numbers, but decreases with increasing medium porosity.

December 18, 2024

Application of the Phase Field Approach for Crack Propagation in Viscoelastic Solid Materials under Thermal Stress: A Case Study of Solder Fracturing

S. Alfat, La Ode Ahmad Barata, Aditya Rachman, R. Eso, Arman Arman, Nurgiantoro Nurgiantoro, Ali Mulya Rende

To date, solder has been a crucial component for interconnecting circuit boards (PCBs) and electronic components in the electronics industry. However, solder faces certain challenges, such as cracking due to thermal changes. This paper investigates solder cracking under thermal expansion. We employ a phase field model to study crack propagation under thermal stress in a square domain and in solder with a fillet shape. The model is based on those proposed by Takaishi-Kimura and Alfat, where the stress and strain tensors are modified to account for variations in the temperature field. In this study, we consider the solder material to be viscoelastic, while the other materials are treated as homogeneous and isotropic. A numerical example is computed using the adaptive mesh finite element method, with the code implemented in FreeFEM software. The results of this study are in good agreement with previous numerical and experimental findings.

November 01, 2024

Magnetohydrodynamic mixed convection of nanofluid flow in a split lid driven cavity using finite element method

Ankita Dubey, B. Vasu, R. Gorla, M. H. Borbora, A. Chamkha

A computational study on the effect of magnetohydrodynamic mixed convection of nanofluid flow in a square split lid driven cavity with a block placed near the bottom wall is undertaken. Two different nanoparticles gold and alumina are considered for the study. The observations for the study are obtained by solving the non-dimensionalized governing equations by Finite Element Method with variational approach as accessible with the FreeFEM++ software. The results for different Prandtl numbers ( Pr), Richardson number ( Ri), volume fractions of nanoparticles [Formula: see text], Reynolds number (Re), and MHD parameters (M) are displayed through graphs and figures. It has been observed that the pressure distribution significantly increases with the increment in Reynolds number but both the nanoparticles behave differently. The magnetic field enhancement ( M = 0.1, 0.2, 0.5 and 0.9) decreases the velocity within the cavity. The convective heat transfer is faster in the case of Reynolds number ( Re) = 100 than in the case of Reynolds number ( Re) = 14 or 21. And also increasing the Richardson Number from 0.1 to 1.0, the average Nusselt number shows increment of ∼9.5% and with Ri = 1.0 to 10.0, an increment of ∼3% whereas decrement with higher Reynolds Number ( Re = 21, 100) for Gold and Allumina nanoparticles respectively. The present simulations have various applications for the study of natural phenomenon like climate control, meteorological and geophysical activities and industrial applications like cooling of electronics equipment, heat exchanger.

October 22, 2024

Optimal Control of a Domestic Frost-Free Refrigerator Inlet Freezer from the Perspective of Reducing Energy Consumption

Nacer Sellila, W. Mouhali, M. Louaked, Houari Mechkour

This study is dedicated to the development of a mathematical model based on shape optimal control of the inlet domestic frost-free refrigerator in the context of energy consumption reduction. A three-dimensional thermofluid model is established for the numerical studies. As the physical system (with shelves and fruits) can be seen as a porous medium, the coupled state equations of the transport mechanism (for velocity and temperature fields) are governed by Navier–Stokes–Forchheimer/Fourier equations. Then, based on the finite element method, the numerical scheme computation is made with FreeFem++ software (Version 4.6). Numerical results are shown for three different cases: empty without shelves, empty with shelves, and loaded with foods. For each case, the velocity and temperature fields’ results are discussed for the optimal configurations. The characterization of these physical parameters would help engineers in domestic frost-free refrigerator design.

October 17, 2024

Simulação da Dinâmica Populacional do Mexilhão-Dourado Utilizando o Método dos Elementos Finitos via FreeFem

Edgard S. Theotonio, R. Z. S. Azevedo, L. Catabriga

Este artigo apresenta uma aplicação do método dos elementos finitos, via o software FreeFem, para resolver um modelo matemático que simula a dinâmica populacional do mexilhão-dourado, suas larvas e as algas. O modelo considera a relação predador-presa e os parâmetros físicos que influenciam o comportamento dessas espécies. A simulação, realizada em diferentes domínios, permite visualizar a concentração do mexilhão-dourado após um ano de experimento. O objetivo é compreender como diferentes condições ambientais afetam a propagação dessa espécie exótica, que é uma praga no Brasil, e assim contribuir para o desenvolvimento de estratégias de controle mais eficazes e menos onerosas.

October 04, 2024

Far-field sound field estimation using robotized measurements and the boundary elements method

Caroline Pascal, Pierre Marchand, Alexandre Chapoutot, Olivier Doaré

Sound Field Estimation (SFE) is a numerical technique widely used to identify and reconstruct the acoustic fields radiated by unknown structures. In particular, SFE proves to be useful when data is only available close to the source, but information in the whole space is required. However, the practical implementation of this method is still hindered by two major drawbacks: the lack of efficient implementation of existing numerical methodologies, and the time-consuming and tedious roll-out of acoustic measurements. This paper aims to provide a solution to both issues. First, the measurements step is fully automated by using a robotic arm, able to accurately gather geometric and acoustic data without any human assistance. In this matter, a particular attention has been paid to the impact of the robot on the acoustic pressure measurements. The sound field prediction is then tackled using the Boundary Element Method (BEM), and implemented using the FreeFEM++ BEM library. Numerically simulated measurements have allowed us to assess the method accuracy, and the overall solution has been successfully tested using actual robotized measurements of an unknown loudspeaker.

August 07, 2024

Investigation of the Output Voltage of a Piezoresistive MEMS Pressure Sensor Using Finite Element Modelling

Yuqing Xia, Peng Zhou, Chunming Zhou, Yubao Zhen, Xiyao Du

In this paper, based on a 3D finite element model of a piezoresistive MEMS pressure sensor developed previously using FreeFem++, the output voltage of the device is calculated via three approaches. In the first approach, the output voltage is calculated using the widely used empirical formula for the Wheatstone bridge circuits, and thus, it is called the empirical result. In the second approach, firstly, the mean stresses are obtained within the four P-type resistors and the resistivity of the resistors is calculated using the constitutive relation of piezoresistivity. Then a steady state equation of the electric potential is solved and the electric potentials are extracted at the corner of the Cu interconnects. Thus, their difference yields the output voltage and it is called the semi-empirical result. However, within the resistors, the distribution of stresses are in fact quite inhomogeneous and thus their resistivity is also inhomogeneous. Hence, in the third approach, the resistivity of the four resistors are determined as functions of the stresses within the resistors using the constitutive relation of piezoresistivity. Then the electrical potential is also obtained numerically and the output voltages are extracted. The result obtained using the third approach is thus called the numerical result, which is the accurate output voltage of the pressure sensor determined numerically. During the simulations, the influences of different thicknesses of the silicon diaphragm, different widths of the P-type silicon resistor, and different distances between the center of the diaphragm and the midpoint of the P-type silicon resistor, are studied. The three results mentioned above are compared. Simulations show that the three results qualitatively agree with each other with the output voltage from the third approach being 30% higher. We argue, though the widely used empirical result leads to a less accurate output voltage, but it can still achieve the purpose of aiding the design of a piezoresistive MEMS pressure sensor satisfactorily.

June 02, 2024

A Domain Decomposition Finite Element Method for the Magneto-Thermal Field Analysis of Electric Machines

Yunpeng Zhang, Jinpeng Cheng, Xinsheng Yang, Qibin Zhou, Weinong Fu

In this paper, a domain decomposition finite element method is proposed for the magneto-thermal field analysis of electric machines. 2-D and 3-D numerical models are built for the magnetic field and thermal field of electric machines, respectively. The computational domains of these two fields are decomposed into subdomains based on the discretized meshes to balance the computation work between processors. With the decomposed subdomains, the additive Schwarz method is developed to solve the forming numerical problems of these two fields using the open source platform freefem++, and a significant improvement in efficiency can be observed from the numerical results of single field analysis of a permanent magnet synchronous machine (PMSM). The coupling between these two fields is modelled with the electromagnetic losses and temperature dependent properties, and a two-step searching algorithm is developed for the data mapping between field solvers, which employ different dimensional models and inconsistent meshes. The counterpart subdomain is determined before searching the counterpart element to reduce the computation effort of searching. The magneto-thermal field analysis of the studied PMSM is finally conducted with the proposed method to showcase its effectiveness.

May 30, 2024

МІКРОСЕРВІСНА АРХІТЕКТУРА СИСТЕМ СКІНЧЕННО-ЕЛЕМЕНТНОГО АНАЛІЗУ

Я. В. Кривий, Антон Лісняк

У світі швидкого технологічного розвитку ефективність і гнучкість архітектур програмної інженерії відіграють ключову роль у створенні масштабованих і відмовостійких систем. Це набуває критичного значення для систем скінченно-елементного аналізу (FEA-систем), які використовуються для моделювання складних фізичних процесів в інженерії та часто повинні обробляти великі обсяги даних. Більшість сучасних FEA-систем використовують монолітну архітектуру – традиційну модель із єдиною кодовою базою для виконання різних функцій. Такий підхід має переваги, такі як єдине середовище розробки та легше налагодження взаємодії компонентів, і суттєві недоліки: складність масштабування, низьку відмовостійкість, погане балансування навантаження, зростання часу відповіді при збільшенні обсягів даних і складність впровадження нових функцій/технологій. Одним із можливих рішень є концепція мікросервісної архітектури, яка передбачає розбиття програмного забезпечення на невеликі незалежні компоненти (сервіси). Кожен сервіс виконує одну функцію і взаємодіє з іншими через чітко визначені інтерфейси. Оскільки вони працюють незалежно, їх можна оновлювати, змінювати, розгортати або масштабувати окремо. Це надає низку переваг: швидке розгортання, незалежність сервісів, гнучке окреме масштабування, стійкість до збоїв, технологічну гнучкість, кращу організацію та простоту тестування, переваги у хмарних середовищах. У статті порівнюються монолітні (Elmer FEM, FreeFEM), мікросервісні (SimScale) і хмарно-монолітні (ANSYS Cloud) FEA- системи за критеріями архітектури, масштабованості, відмовостійкості, розгортання та модифікації. Обґрунтовується перевага мікросервісного підходу та пропонується архітектура FEA-системи на основі патернів API Gateway, Aggregator, Database per Service, Event-Driven, Publisher/ Subscriber, Backend for Frontend.

Events

on last monday of the month

Open Visio discussion

with Zoom form 10h to 11h30h paris time see for detail?

12-13 DECEMBER 2024

FreeFEM Days

Save te date and joint us for the 16th FreeFEM Days 2024 edition !
Paris, France

You are in good company

Sorbonne université INRIA ANR Genci CNRS