Giter Site home page Giter Site logo

feelpp / toolbox Goto Github PK

View Code? Open in Web Editor NEW
6.0 24.0 11.0 85.73 MB

:hammer: Feel++ Toolbox Examples

Home Page: https://feelpp.github.io/toolbox/

License: GNU General Public License v3.0

Ruby 2.27% Dockerfile 1.28% Jupyter Notebook 1.32% Shell 0.41% JavaScript 47.31% GLSL 47.12% Python 0.30%
feelpp toolbox multi-physics cfd csm fsi heat-transfer thermoelectric maxwell

toolbox's Introduction

Feel++: Finite Element Embedded Library in C++

feelpp DOI

feelpp?color=009688&logo=Riseup&style=flat square feelpp?color=009688&logo=Moleculer&logoColor=white&style=flat square feelpp?color=009688&logo=Bilibili&logoColor=white&style=flat square feelpp?logo=Draugiem feelpp?color=009688&style=flat square&logo=Hack The Box&logoColor=white

Feel++ is a C++ library for continuous or discontinuous Galerkin methods including finite element method(FEM), spectral element methods(SEM), reduced basis methods, discontinuous galerkin methods (DG and HDG) in 1D 2D and 3D and in parallel. Checkout What is Feel++?, Feel++ Features and some Examples.

Releases

The latest release of Feel++ is here feelpp

Feel++ has a DOI provided by Zenodo. Please use this to cite Feel++ if you use it in a publication DOI

Feel++ is split into three components:

feelpp

library and tools

feelpp-toolboxes

mono and multiphysics toolboxes (cfd, csm, heat transfer, fsi, heat and fluid, hdg(poisson and elasticity), thermo-electric and maxwell)

feelpp-mor

model order reduction applications and tools

These components are built and delivered in two distribution channels: stable and latest. The channels are currently available via Docker containers, Debian and Ubuntu packages.

stable

Once a year, sometimes more, we make a release of Feel++ and it becomes the basis of the stable channel. The channel is updated infrequently, only for a new release or a major bug.

latest

Feel++ has a very active development and changes are made everyday with the research done by Cemosis and its collaborators. Each commit in the main development branch triggers a new full build with more than 800 tests from unit test to full pde solves.

Instructions are available here to install Feel++ : https://docs.feelpp.org/user/latest/install/index.html.

Feel++ Documentation

Slack Discussion Forum

We encourage you to ask questions and discuss any aspects of the project on Slack. New contributors are always welcome!

Continuous Integration

Feel++ maintains various branches. At the core, the development model is greatly inspired by existing models out there. The central repo holds two main branches with an infinite lifetime: master and develop

master

Main branch where the source code of HEAD always reflects a production-ready state.

develop

Main branch where the source code of HEAD always reflects a state with the latest delivered development changes for the next release. Some would call this the “integration branch”. This is where any automatic nightly builds are built from.

feature/*

Feature branches (or sometimes called topic branches) are used to develop new features for the upcoming or a distant future release. When starting development of a feature, the target release in which this feature will be incorporated may well be unknown at that point. The essence of a feature branch is that it exists as long as the feature is in development, but will eventually be merged back into develop (to definitely add the new feature to the upcoming release) or discarded (in case of a disappointing experiment).

What is Feel++?

Feel++ is a C++ library for continuous or discontinuous Galerkin methods including finite element method(FEM), spectral element methods(SEM), reduced basis methods, discontinuous Galerkin methods (DG and HDG) in 1D 2D and 3D and in parallel. The objectives of this framework are quite ambitious; ambitions which could be expressed in various ways such as :

  • the creation of a versatile mathematical kernel solving easily problems using different techniques thus allowing testing and comparing methods, e.g. cG versus dG,

  • the creation of a small and manageable library which shall nevertheless encompass a wide range of numerical methods and techniques,

  • build mathematical software that follows closely the mathematical abstractions associated with partial differential equations (PDE),

  • the creation of a library entirely in C++ allowing to create complex and typically multi-physics applications such as fluid-structure interaction or mass transport in haemodynamic.

Features

  • 1D 2D and 3D (including high order) geometries and also lower topological dimension 1D(curve) in 2D and 3D or 2D(surface) in 3D

  • continuous and discontinuous (dG and hdG) arbitrary order Galerkin Methods in 1D, 2D and 3D including finite and spectral element methods

  • domain specific embedded language in C++ for variational formulations

  • interfaced with PETSc for linear and non-linear solvers

  • seamless parallel computations using PETSc

  • interfaced with SLEPc for large-scale sparse standard and generalized eigenvalue solvers

  • supports Gmsh for mesh generation

  • supports Gmsh for post-processing (including on high order geometries)

  • supports Paraview and CEI/Ensight for post-processing and the following file formats: ensight gold, gmsh, xdmf.

Contributing

In the spirit of free software, everyone is encouraged to help improve this project. If you discover errors or omissions in the source code, documentation, or website content, please don’t hesitate to submit an issue or open a pull request with a fix. New contributors are always welcome!

Here are some ways you can contribute:

  • by using develop versions

  • by reporting bugs

  • by suggesting new features

  • by writing or editing documentation

  • by writing specifications

  • by writing code — No patch is too small.

    • fix typos

    • add comments

    • write examples!

    • write tests!

  • by refactoring code

  • by fixing issues

  • by reviewing Pull Requests

The Contributing guide provides information on how to create, style, and submit issues, feature requests, code, and documentation to the Feel++ Project.

Getting Help

The Feel++ project is developed to help you easily do (i) modelisation simulation and optimisation and (ii) high performance computing. But we can’t do it without your feedback! We encourage you to ask questions and discuss any aspects of the project on the discussion list, on Twitter or in the chat room.

Twitter

#feelpp hashtag or @feelpp mention

Chat (Slack)

Slack

Further information and documentation about Feel++ can be found on the project’s website.

Home | News | Docs

The Feel++ organization on GitHub hosts the project’s source code, issue tracker, and sub-projects.

Source repository (git)

https://github.com/feelpp/feelpp

Issue tracker

https://github.com/feelpp/feelpp/issues

Feel++ organization on GitHub

https://github.com/feelpp

Copyright © 2011-2023 Feel++ Consortium. Free use of this software is granted under the terms of the GPL License.

See the LICENSE file for details.

Authors

Feel++ is led by Christophe Prud’homme and has received contributions from many other individuals.

Examples

Laplacian in 2D using P3 Lagrange basis functions

Here is a full example to solve

-\Delta u = f \mbox{ in } \Omega,\quad u=g \mbox{ on } \partial \Omega

#include <feel/feel.hpp>

int main(int argc, char**argv )
{
    using namespace Feel;
    Environment env( _argc=argc, _argv=argv,
                     _desc=feel_options(),
                     _about=about(_name="qs_laplacian",
                                  _author="Feel++ Consortium",
                                  _email="[email protected]"));

    auto mesh = unitSquare();
    auto Vh = Pch<1>( mesh );
    auto u = Vh->element();
    auto v = Vh->element();

    auto l = form1( _test=Vh );
    l = integrate(_range=elements(mesh),
                  _expr=id(v));

    auto a = form2( _trial=Vh, _test=Vh );
    a = integrate(_range=elements(mesh),
                  _expr=gradt(u)*trans(grad(v)) );
    a+=on(_range=boundaryfaces(mesh), _rhs=l, _element=u,
          _expr=constant(0.) );
    a.solve(_rhs=l,_solution=u);

    auto e = exporter( _mesh=mesh, _name="qs_laplacian" );
    e->add( "u", u );
    e->save();
    return 0;
}

Bratu equation in 2D

Here is a full non-linear example - the Bratu equation - to solve

\[-\Delta u + e^u = 0 \mbox{ in } \Omega,\quad u=0 \mbox{ on } \partial \Omega$$.\]
#include <feel/feel.hpp>

inline
Feel::po::options_description
makeOptions()
{
    Feel::po::options_description bratuoptions( "Bratu problem options" );
    bratuoptions.add_options()
    ( "lambda", Feel::po::value<double>()->default_value( 1 ),
                "exp() coefficient value for the Bratu problem" )
    ( "penalbc", Feel::po::value<double>()->default_value( 30 ),
                 "penalisation parameter for the weak boundary conditions" )
    ( "hsize", Feel::po::value<double>()->default_value( 0.1 ),
               "first h value to start convergence" )
    ( "export-matlab", "export matrix and vectors in matlab" )
    ;
    return bratuoptions.add( Feel::feel_options() );
}

/**
 * Bratu Problem
 *
 * solve \f$ -\Delta u + \lambda \exp(u) = 0, \quad u_\Gamma = 0\f$ on \f$\Omega\f$
 */
int
main( int argc, char** argv )
{

    using namespace Feel;
    Environment env( _argc=argc, _argv=argv,
                     _desc=makeOptions(),
                     _about=about(_name="bratu",
                                  _author="Christophe Prud'homme",
                                  _email="[email protected]"));
    auto mesh = unitSquare();
    auto Vh = Pch<3>( mesh );
    auto u = Vh->element();
    auto v = Vh->element();
    double penalbc = option(_name="penalbc").as<double>();
    double lambda = option(_name="lambda").as<double>();

    auto Jacobian = [=](const vector_ptrtype& X, sparse_matrix_ptrtype& J)
        {
            auto a = form2( _test=Vh, _trial=Vh, _matrix=J );
            a = integrate( elements( mesh ), gradt( u )*trans( grad( v ) ) );
            a += integrate( elements( mesh ), lambda*( exp( idv( u ) ) )*idt( u )*id( v ) );
            a += integrate( boundaryfaces( mesh ),
               ( - trans( id( v ) )*( gradt( u )*N() ) - trans( idt( u ) )*( grad( v )*N()  + penalbc*trans( idt( u ) )*id( v )/hFace() ) );
        };
    auto Residual = [=](const vector_ptrtype& X, vector_ptrtype& R)
        {
            auto u = Vh->element();
            u = *X;
            auto r = form1( _test=Vh, _vector=R );
            r = integrate( elements( mesh ), gradv( u )*trans( grad( v ) ) );
            r +=  integrate( elements( mesh ),  lambda*exp( idv( u ) )*id( v ) );
            r +=  integrate( boundaryfaces( mesh ),
               ( - trans( id( v ) )*( gradv( u )*N() ) - trans( idv( u ) )*( grad( v )*N() ) + penalbc*trans( idv( u ) )*id( v )/hFace() ) );
        };
    u.zero();
    backend()->nlSolver()->residual = Residual;
    backend()->nlSolver()->jacobian = Jacobian;
    backend()->nlSolve( _solution=u );

    auto e = exporter( _mesh=mesh );
    e->add( "u", u );
    e->save();
}

toolbox's People

Contributors

faznam avatar francoisdh avatar ggrossetie avatar gqmp avatar jbwahl avatar jobinhio avatar kcheballah avatar lberti avatar lsala avatar miinguyen avatar philippericka avatar prudhomm avatar raouajaraib avatar romainhild avatar thomas-saigre avatar trophime avatar vincentchabannes avatar weimin453 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

toolbox's Issues

Stokes flow in a pipe

Description of the example

simulate a Stokes flow in a pipe with a poiseuille inflow

Geometry

the geometry is a 2D pipe with length L=5 and height H=1

Input parameters

The input parameters can be the

  • viscosity
  • length
  • height
  • velocity magnitude

Model & Toolbox

  • toolbox fluid CFD using the Stokes

Materials

constant set to eg. blood viscosity

Boundary conditions

First case

  • inlet : poiseuille (dirichlet)
  • outlet : free (neumann)
  • wall : no slip condition (homogeneous dirichlet)

Outputs

Fields

velocity and pressure

Measures

l2 norm of error with respect to exact solution

Benchmark

this is a Verification benchmark

/cc @vincentchabannes

Spring CFD fails on atlas

This case fails using

feelpp_toolbox_fluid --case "github:{repo:toolbox, branch:master, path:examples/modules/cfd/examples/spring_cfd}"

The mesh is missing (it should be downloaded from girder).

RED: floating-gate nMOS transistor in inversion conditions

Description of the example

This example shows the distribution of the electric potential $V$ in a nanoscale floating-gate nMOS (Metal-Oxide-Semiconductor) transistor working in inversion conditions.
The prefix "n" indicates that the electric current is due to negatively charged electrons.
This simulation involves a non-homogeneous problem with internal interfaces and it has been solved with the HDG method applied to the Darcy problem.

Geometry

A scheme of a realistic floating-gate nMOS transistor used as a nonvolatile memory device is shown with the schematic representation of the two-dimensional cross-section in which the control gate is now included for sake of simplicity in Figure ??

nmos

The device is composed of a pair of n-doped source and drain regions, a p-doped substrate region and a silicon dioxide (SiO2) region in which a control gate and a floating gate are buried.
The floating gate is isolated from the control gate by an inter-polysilicon dielectric (IPD) layer beneath the control gate.

Input parameters

Physical parameters:

  • electron charge
  • permittivity of vacuum
  • relative permittivity of silicon
  • relative permittivity of silicon dioxide
  • thermal voltage
  • intrinsic concentration

Device parameters:

  • horizontal length
  • vertical length
  • width
  • oxide thickness
  • source and drain lengths
  • channel length
  • junction depth
  • source potential
  • bulk potential
  • source doping concentration
  • bulk doping concentration
  • drain doping concentration

Model & Toolbox

  • The main goal of the simulations is to determine, via the integral boundary condition, the value attained on $\Gamma_G$ at inversion conditions by the electric potential.
    This value is the threshold voltage of the device, denoted henceforth by $V_T$ , and is a fundamental design parameter in integrated circuit nanoelectronics.
    The accurate prediction of the threshold voltage may be significantly influenced by the numerical treatment of the heterogeneous material device structure across the interface $\Gamma_{int}$.
    With this respect the HDG framework appears to be the ideal computational approach because it allows to enforce, at the same time and in a strong manner, (a) the jump of the normal component of the electric displacement vector across the interface and (b) the continuity of the electric potential, at suitable quadrature nodes on each face belonging to $\Gamma_{int}$, unlike standard displacement-based finite element discretization schemes which satisfy property (b) but fail at satisfying property (a).

  • poisson: give toolbox name

Materials

already in the geometry and in the input parameters

Boundary conditions

Boundary conditions:

  • $V = \bar{V}j + \bar{V|{bi,j}$ on $\Gamma_j, j=S,D,B$
  • $\underline{D} \cdot \underline{n} = 0$ on $\Gamma^{lat}_si \cup \Gamma^{lat}_ox$
  • $\int_{\Gamma_G} \underline{D} \cdot \underline{n} d\Sigma = q \bar{N}B \delta L{ch} L_z $ on $\Gamma_G$

Interface conditions:

  • $[V]{\Gamma{int}} = 0$
  • $[\underline{D}]{\Gamma{int}} = q \bar{N}_B \delta$

The quantities \bar{V|_{bi,j} are the built-in potentials associated with the subdomain regions
$\Omega_j , j = S,D,B$, while $\bar{N}_B$ is the concentration of ionized dopants in the bulk region and �$\delta$ is the width of the accumulation region in the $y$ direction of the channel.

Outputs

describe the output set of the example

Fields

add scalar vectorial and matricial fields to be visualized

Measures

add measures, scalar quantities, mean values, performance metrics

References (articles, papers, reports...)

  • section of the HDG article in preparation

Add balloon type FSI examples

add darcy examples

This is linked to #16 to provide examples for the Darcy toolbox based on the generic HDG Poisson solver. See #16 for more details.

We should gather here suggestions of examples/test cases of Darcy flows.

backwardstep examples

  • backwardstep.cfg symbolic link to backwardstep3d.cfg
  • backwardstep2d.jon update
  • backwardstep3d.jon update
  • file pages/backwardstep/Readme.adoc doesn't contain results and conclusions

CSM: ideal solenoid magnet - Analytical expression

Description of the example

In this example, we consider a solenoid conductor with finite thickness and infinite length.
This allow us to ignore the z components in our equations.
We admit that there is only a radial expansion.

Geometry

The conductor $\Omega$ consists in a rectangular cross section torus.
The geometry also contains an external domain which is an approximation of $\mathbf{R}^3/\Omega$.

Name Description Value Unit
$r_1$ internal radius $1.10^{-3}$ m
$r_2$ external radius $2.10^{-3}$ m
dz~ height $2.10^{-1}$ m

Input parameters

current density: $\textbf{j}$ in $A/m^2$.
magnetic field: $\textbf{b}$ in $T$.

Model & Toolbox

  • From the momentum conservation equation, we have:
    [
    div\sigma+\textbf{j}\times\textbf{b}=0
    ]
    With the hypothesys specified in introduction, this equation may be rewritten :
    [
    -\sigma_{\theta}+\frac{\partial}{\partial r}(r\sigma_{r})=-rj_{\theta}b_{z}
    ]
    For a solenoid conductor with finite thickness and infinite length, we have for a constant current density
    $j_{\theta}$:
    [

  • b_{z} = ...
    ]
    With these hypothesys, we can show that (see [REF002]):
    [

  • u_{r} = ...
    ]

  • toolbox: elasticity

Materials

|Name |Description | Value | Unit |
|$E$ |Young modulus||$128.10^{9}$|$Pa=kg.m^{-1} .s^{-2}$|
|$\nu$|Poisson's ratio|0.33|- |

Boundary conditions

  • entry/exit: $\textbf{u} \dot \texbf{n} = 0$, displacements only in the perpendical plane,
  • top:bottom: clamped

Outputs

The output is describe the output set of the example

Fields

add scalar vectorial and matricial fields to be visualized

Measures

add measures, scalar quantities, mean values, performance metrics

Benchmark

Describe Benchmark type:
[X] Verification
[] Validation
[] Performance

The computed values of the displacements on r-axis in the solenoidal mid-plane are compared
with the analytical expression given by Montgomery.

References (articles, papers, reports...)

Enable Feel++ Reduced Order Methods in MSO4SC

Is your feature request related to a problem ? Please describe.
A ECMI 2018 participant would like to enable reduced order methods from Feel++ in MSO4SC

Describe the solution you'd like
The offline stage can definitely be deployed and the output databases can be then uploaded to Girder.

Additional context
Request from a ECMI 2018 participant

CI for toolbox cases

Is your feature request related to a problem ? Please describe.
We don't have CI support for toolbox. We should be able to know the status of all the cases stored

Describe the solution you'd like
we should have a quick way to assess the health of the case files and also be able to run all cases
I suggest using --check-init to run simulation up to init() stage included
we then use buildkite to run all the registered cases

Enable Fitting in toolbox JSON files

Is your feature request related to a problem ? Please describe.
Lots of industrial problems require loading data from datafiles and use interpolation to fit the data.

Describe the solution you'd like
use fit interpolation feature of feel++ to add json files.

Additional context
request comes from a ECMI 2018 conference participant

Add copy to clipboard buttons to get command lines or case option

Is your feature request related to a problem ? Please describe.
When a end-user is reading the documentation, he may want to execute the case or have access to the case string to pass to MSO4SC

Describe the solution you'd like
To facilitate the usage, we can provide a copy to clipboard button that allows to retrieve either the command line or the case option

we may use https://clipboardjs.com/ and add it to supplemental-ui. it is small and seems to fit the bill.

Also we need to

  • update the template case file and add this feature
  • update current cases

Export current density in electric/thermoelectric toolboxes

Is your feature request related to a problem ? Please describe.
In Hifimagnet the field of concern is more the current density (conductivity times electric field) than the electric field itself.
It would be great to be able to export it.

Describe the solution you'd like
Add current-density to the list of exported fields.

Describe alternatives you've considered
Since the conductivity and the electric field can be exported, we could compute ourselves the current density.

Additional context
I started implementing it from the same model than the electric field, with a member to store it and a function updateCurrentDensity().
For the linear case, there is no issue, but in the non linear case, the conductivity depending on the temperature, it is the thermoelectric toolbox that should handle this.

Possible fix:

  • template the updateCurrentDensity function and pass the temperature as a parameter
  • the electric::updateCurrentDensity does nothing if it depends on the temperature and the thermoelectric toolbox has its own function to do it.

What is the best solution ?
@vincentchabannes @Trophime

Add opus testcase

The opus testcase needs to be added to the toolbox benchmarks, we have some results to compare with in some cases (with Comsol)

C++ or Python codes as inputs for Feel++ apps in MSO4SC

Is your feature request related to a problem ? Please describe.
Would it be possible to have C++ or Python codes as inputs for Feel++ apps in MSO4SC

Describe the solution you'd like
Instead of case option we would use a script/code option which would then be executed by the feel++ app

Describe alternatives you've considered

Additional context
This was discussed with an ECMI 2018 participant

Rotating Winch fails on atlas

Describe the bug
test case fails in singularity on atlas

To Reproduce
Steps to reproduce the behavior:

  1. Go to Atlas
  2. Start singularity
  3. run `feelpp_toolbox_solid --case "github:{repo:toolbox,path:examples/modules/csm/examples/rotating-winch}"
    4.See error
Reading /feel/downloads/feelpp_toolbox_solid/cases/rotating-winch/biele.cfg...
[ Starting Feel++ ] application feelpp_toolbox_solid version 0.105.0-rc.10 date 2018-Jun-12
 . feelpp_toolbox_solid files are stored in /feel/toolboxes/solid/rotating-winch/biele/P2/np_1
 .. logfiles :/feel/toolboxes/solid/rotating-winch/biele/P2/np_1/logs
[modelProperties] Loading Model Properties : "/feel/downloads/feelpp_toolbox_solid/cases/rotating-winch/biele.json"
[loadMesh] Loading Gmsh compatible mesh: "/feel/downloads/feelpp_toolbox_solid/cases/rotating-winch/biele.msh"
[loadMesh] Loading Gmsh compatible mesh: "/feel/downloads/feelpp_toolbox_solid/cases/rotating-winch/biele.msh" done
F0612 06:48:46.079028 42072 nullspace.cpp:128] Check failed: this->hasOrthonormalBasisVectors() basis vectors are not orthonormal
*** Check failure stack trace: ***
    @     0x7fdb4b3d9acc  google::LogMessageFatal::~LogMessageFatal()
    @     0x7fdb5598cbfa  Feel::NullSpace<>::orthonormalizeBasisVector()
    @     0x7fdb51001944  _ZN4Feel9NullSpaceIdE12updateForUseINS_13FunctionSpaceINS_4MeshINS_7SimplexILt3ELt1ELt3EEEdLi0EEENS_5basesIJNS_8LagrangeILt1ENS_9VectorialENS_10ContinuousENS_14PointSetFeketeELt0EEEEEEN5boost9parameter5void_ESH_SH_E7ElementIdNS_11VectorUblasIdNSF_7numeric5ublas6vectorIdNSM_15unbounded_arrayIdSaIdEEEEEEEEEEEvRKSt16initializer_listIT_EN4mpl_5bool_ILb1EEE
    @     0x7fdb50ffb1d7  _ZN4Feel9NullSpaceIdEC2INS_13FunctionSpaceINS_4MeshINS_7SimplexILt3ELt1ELt3EEEdLi0EEENS_5basesIJNS_8LagrangeILt1ENS_9VectorialENS_10ContinuousENS_14PointSetFeketeELt0EEEEEEN5boost9parameter5void_ESH_SH_E7ElementIdNS_11VectorUblasIdNSF_7numeric5ublas6vectorIdNSM_15unbounded_arrayIdSaIdEEEEEEEEEEERKSt16initializer_listIT_E
    @     0x7fdb50b31edf  _ZN4Feel10FeelModels6detail12getNullSpaceIN5boost10shared_ptrINS_13FunctionSpaceINS_4MeshINS_7SimplexILt3ELt1ELt3EEEdLi0EEENS_5basesIJNS_8LagrangeILt1ENS_9VectorialENS_10ContinuousENS_14PointSetFeketeELt0EEEEEENS3_9parameter5void_ESI_SI_EEEEEENS_9NullSpaceIdEERKT_N4mpl_4int_ILi3EEE
    @     0x7fdb50b2d113  Feel::FeelModels::SolidMechanics<>::init()
    @           0x458522  Feel::runApplicationSolid<>()
    @           0x43dc8f  main
    @     0x7fdb22396830  __libc_start_main
    @           0x43d0b9  _start
    @              (nil)  (unknown)
Aborted (core dumped)

Merge example and benchmark guides

we have examples and benchmarks, I am thinking that it might be best to actually merge them into cases or examples and have Feel++ Cases Guide. Then we would need to identify the benchmarks (which are just a subset of a case or example, they provide verification,validation or scalability checks) in each modules in a specific section. That way we gather all examples in one place and don’t have to remember whether it is a benchmark or an example

Another side effect is that we show more examples in one go for each toolbox (edited)
Yet another advantage is that it simplifies the documentation and avoid duplication between example and benchmark templates

@vincentchabannes what do you think ?

Darcy toolbox

We want to develop a toolbox for fluid seepage through porous media in 2D and 3D using the work already done for the Poisson problems.

One of the aims is to be able to solve Stokes-Darcy and Navier-Stokes-Darcy coupled problems within the context of blood perfusion through the brain.

  • Documentation of the model
  • Documentation of the mathematical background
  • Documentation of the toolbox

The toolbox should be a subclass of the HDG Poisson.

ECMI 2018 User Stories

We gather at ECMI 2018 user stories to improve our Feel++ apps and pilots as well as the userexperience

fluiddarcy toolbox

We would like to enable coupling between a free fluid model and a fluid flow through porous media using existing CFD and soon existing HDG Darcy toolboxes.

Benchmarking solution strategies for linear elasticity in 3D

Description of the benchmark

compare the performances of different linear solvers in linear elasticity

Geometry

  • cantilever

Input parameters

  • mesh size
  • FEM order
  • pc-type
  • ksp-type

Model & Toolbox

  • toolbox: csm - linear elasticity

Materials

compressible

Boundary conditions

describe set of boundary conditions

Outputs

performance metrics:

  • number of iterations
  • time
  • relative time

Fields

add scalar vectorial and matricial fields to be visualized

Measures

add measures, scalar quantities, mean values, performance metrics

Benchmark

Describe Benchmark type:

  • Performance

The performance will be compared with SOFA framework

Add toolbox thermo-electro-fluid

Is your feature request related to a problem ? Please describe.
thermo-electric-fluid toolbox would be nice to have in many industrials applications

Additional context
Request from a ECMI participant

Compute Min, Max and Mean outputs

Is your feature request related to a problem ? Please describe.
is it possible to compute outputs such as

  • min
  • max
  • mean
    either global or local(markers)

Describe the solution you'd like

if yes, how is it done in the PostProcessing section?

Additional context
This was asked by one participant of ECMI 2018 conference.

Add documentation on how to contribute an example or benchmarks

We need to describe the process of contributing an example or benchmark:

  • template documentation for example and benchmark (see all issue templates)
  • where to put the documentation and example/benchmarks (directory layout)
  • producing and uploading to DMP vtk.js files

ThemoelectricModel: Joules heating of a stranded conductor - Rectangular cross-section torus - Analytical solution

Description of the example

In this example, we will estimate the rise in temperature due to Joules losses in a stranded conductor. An electrical potential $V_0$ is applied to the entry/exit of the conductor which is also cooled by a force flow.
The geometry of the conductor is choosen as to have an analytical expression for the temperature.

Geometry

  • The conductor consists in a rectangular cross section torus which is somehow "cut" to allow for applying electrical potential. The conductor is cooled with a force flow along its cylindrical faces.
  • /images/learning/thermoelectric/quarter-turn3D.png
  • upload CAD file if available
Name Description Value Unit
$r_1$ internal radius $1.10^{-3}$ m
$r_2$ external radius $2.10^{-3}$ m
dz~ height $2.10^{-3}$ m

Input parameters

Name Description Value Unit
$V_0$ electrical potential 0.3 V

Model & Toolbox

  • This problem is fully described by a ThermoElectricModel, namely a poisson equation for the electrical potential $V$ and a standard heat equation for the temperature field $T$ with Joules losses as a source term.
    Assuming that the physical properties of the materials forming the conductor are not dependent on $T$, we can show that $(V,T)$ are solutions of:
    [
    V = V0*\frac{\theta}{2\pi}
    \rho C_{p}\frac{\partial T}{\partial t} - \nabla.(k \nabla T)=\sigma(\frac{V}{2\pi r})^{2}
    ]

In our geometry and owing to the considered thermal boundary conditions, $T$ only depends on the radius $r$.
We can show that the $T$ static solution is of the form:
[
T=-a \log(\frac{r}{r_{0}})^{2} + T_{max}
]
with:

  • $a=sigma/(2k)(V0/(2*pi))**2$

  • $b=k*(1/(h1r1)+1/(h2r2))+log(r2/r1)$

  • $c=log(r2/r1)log(r2r1)+2k(log(r1)/(h1r1)+log(r2)/(h2r2))$

  • $r0=exp( ((Tw2-Tw1)/b+ac/b)/(2a) )$

  • [Tm = 2ak/(h1r1+h2r2)log(r2/r1)
    + (h1
    r1Tw1+h2r2Tw2)/(h1r1+h2r2)
    + a
    (h1r1log(r1/r0)**2+h2r2log(r2/r0)**2)/(h1r1+h2r2)
    ]

  • toolbox: thermoelectric

Materials

Name Description Value Unit
$\sigma$ electrical conductivity $58.10^{6}$ $S.m^{-1}$
k thermal conductivity 380 $W.m^{-1} .K^{-1}$

Boundary conditions

The boundary conditions for the electrical probleme are introduced as simple Dirichlet boundary conditions for the electric potential on the entry/exit of the conductor. For the remaining faces, as no current is flowing througth these faces, we add Homogeneous Neumann conditions.

Name Description Value Unit
$V0$ electrical potential 0. V
$V1$ electrical potential V_0*f V

where $f$ is a factor representing the portion of the torus considered (eg f=0.25 is only 1/4th of the torus is modeled, f=1 for the complete torus).

As for the heat equation, the forced water cooling is modeled by robin boundary condition with $Tw$ the temperature of the coolant and $h$ an heat exchange coefficient.

Name Description Value Unit
$Tw_1$ coolant temperature on r1 293 K
$Tw_2$ coolant temperature on r2 293 K
$h_1$ heat transfer coefficient on r~1 $h_{1}=h_{2}\frac{r_{2}}{r_{1}}$ $W.m^{-2} .K^{-1}$
$h_2$ heat transfer coefficient on r~1 80000 $W.m^{-2} .K^{-1}$

Outputs

The output is describe the output set of the example

Fields

add scalar vectorial and matricial fields to be visualized

Measures

add measures, scalar quantities, mean values, performance metrics

Benchmark

Describe Benchmark type:
[X] Verification
[] Validation
[] Performance

The computed values of the temperature are compared with the analytical expression given above for several mesh sizes.

References (articles, papers, reports...)

  • add any article in pdf or html links related to the example
  • [REF001] authors..., title, ... journal,... year...

Get output data from MSO4SC

Is your feature request related to a problem ? Please describe.
Currently the way we get to output from Feel++ apps is cumbersome and not very user friendly
We should be able to retrieve the data from the simulation in an easier way

Describe the solution you'd like
Several solutions were discussed:

  • automated upload to girder
  • Download buttons (log files, restarts files, result files paraview, results files csv)

Additional context
The duscussion was with a participant of the ECMI 2018 conference

Add documentation on how to use plot.ly in the pages

Is your feature request related to a problem ? Please describe.
we should support embedded graph plot to add for example convergence graphs and outputs plots

Describe the solution you'd like
plotly.js is a nice framework to embed graphics in html page
this can be easily supported in antora framework

add toolbox report to testcase

use toolbox application report and add it to the antora site along the description of the testcase

the report is at the toplevel of the application repository

Enable 2D Axi formulations of the toolboxes

Is your feature request related to a problem ? Please describe.
For many problems, it may be useful in a first approximation to consider 2D Axi geometries and formulation. Common examples may be found in physics textbooks.

Describe the solution you'd like
It would be great to have a 2D axi version for each toolbox.

Additional context
Special care shall be taken for PDE with vectorial unknows.

Add case generator

Is your feature request related to a problem ? Please describe.
There is some boilerplate when adding a new case documentation and input files.
This could be simplified/accelerated via a template system

Describe the solution you'd like
Ruby provides some nice tools and in particular supports Liquid templating.

Magnetostatic: A solenoidal magnet - Analytical solutions

Magnetic Field on the Z-Axis of a Cross rectangular section solenoidal magnet

In this example, we will compute the magnetic field generated by a stranded conductor.
The geometry of the conductor is chosen such that we can derive the analytical expression
of the magnetic field.

Geometry

The conductor stem:[\Omega] consists in a rectangular cross-section torus.
The geometry also contains an external domain which is an approximation of stem:[\mathbf{R}^3/\Omega].

Name Description Value Unit
stem:[r_1] internal radius stem:[1.10^{-3}] m
stem:[r_2] external radius stem:[2.10^{-3}] m
stem:[dz] height stem:[2.10^{-3}] m

Input parameters

current density: stem:[\mathtbf{j}] in stem:[A/m^2].

Model & Toolbox

  • The magnetostatic formulation in terms of magnetic potential stem:[\mathtbf{A}] may be found in xxx:
    [stem]
    ++++
    \nabla^{2}\mathbf{A}=-\mu\mathbf{j}
    ++++
    with stem:[\mathbf{A}] the magnetic potential and stem:[\mathbf{j}] the current density in $\Omega$.
    The general solution of this equation is :
    [stem]
    ++++
    \mathbf{A}(\mathbff{r})=-\mu\int_{\Omega}G(\mathtbf{r},\mathbf{r'})\mathbf{j}(\mathbf{r'})
    ++++
    with stem:[G(\mathbf{r},\mathbf{r'})] the Green's function defined as :
    [stem]
    ++++
    G(\mathbf{r},\mathbf{r'})=\frac{1}{4\pi}\frac{1}{|\mathbf{r}-\mathbf{r'}|}
    ++++
    with stem:[\mathtbf{r}\in\mathbf{R}^3] andstem: [\mathbf{r'}\in\Omega_{cond}]

Then it follows that the magnetic field stem:[\mathbf{B}], defined as the curl of stem:[\mathtbf{A}], is:
[stem]
++++
\mathbf{B}(\mathbf{r})=\frac{\mu_{0}}{4\pi}\int_{\Omega_{cond}}\frac{\mathbf{j}(\mathtbf{r'})\times(\mathbf{r}-\mathbf{r'})}{|\mathbf{r}-\mathbf{r'}|^{3}} d\mathbf{r'}\qquad\forall\mathbf{r}\in\Omega_{mgn}
++++
This is the so-called Biot & Savart's law.

For simple conductor geometry, analytical expressions of the magnetic field may be found in physics textbooks.
As a classical result, we have the following expression for a "solenoidal" conductor with a constant current density
distribution for the magnetic field along the Z-Axis:
xxxxx

  • toolbox: maxwell

Boundary conditions

  • stem:[\mathbf{A} = \mathbf{0}] on the boundaries
    // - stem:[\mathbf{A} \times mathbf n = \mathbf{0}]
  • stem:[\mathbf{A} \dot \mathbf{n} = 0 ] on symetry plane

Outputs

The output is described the output set of the example

Fields

add scalar vectorial and matricial fields to be visualized

Measures

add measures, scalar quantities, mean values, performance metrics

Benchmark

Describe Benchmark type:
[X] Verification
[] Validation
[] Performance

The computed values of the magnetic field on the Z-Axis is compared with the analytical expression given above
for several mesh sizes.

References (articles, papers, reports...)

  • add any article in pdf or html links related to the example
  • [REF001] authors..., title, ... journal,... year...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.