TFEL
, MFront
and MTest
MFront
StandardElastoViscoPlasticity
brickCyrano
fuel performance codeCast3M
’ behaviour interfaceCyrano
’ behaviour interfaceCOMSOL Multiphysics
and DIANA FEA
MTest
mfm-test-generator
TFEL
’ core libraries
generic
interfaceThe page declares the new functionalities of the 3.3 version of the TFEL
project.
This version was released along with the following bug-fix releases:
Version 3.3 inherits the fixes of all those versions.
Version 3.3 includes \(15\,427\) unit tests and has been successfully tested on:
LiNuX
with various versions of the gcc
and clang
compilers. The Intel 2019
compilers were tested on Debian Stretch
.Mac Os Catalina
with the clang
and gcc
compilers.FreeBSD
.Windows
with Visual Studio 15
, Visual Studio 17
, various versions of the MinGW
compilers (mostly the ones delivered with Cast3M
2017
, 2018
and 2019
), Cygwin
and Windows
Subsystem
for
LiNuX
(WSL)OpenSolaris
, Haiku
, etc.More tests are available in the MFrontGallery
project.
MFront
’ galleryNew entries were added to the gallery:
MFront
User DaySome of the talks of the fifth MFront
User Day are available online:
MFront
Some recent scientific programming languages like Julia
or \(\nabla\) allow the usage of (a subset of) unicode characters [1, 2]. This allows a much more readable code, very close to the mathematical expressions.
Here is an example of the implementation of a Norton behaviour:
@Integrator{
const auto σᵉ = sigmaeq(σ);
const auto iσᵉ = 1 / (max(σᵉ, real(1.e-12) ⋅ E));
const auto vᵖ = A ⋅ pow(σᵉ, nn);
const auto ∂vᵖ∕∂σᵉ = nn ⋅ vᵖ ⋅ iσᵉ;
const auto n = 3 ⋅ deviator(σ) ⋅ (iσᵉ / 2);
// Implicit system
fεᵉˡ += Δp ⋅ n;
fp -= vᵖ ⋅ Δt;// jacobian
2 ⋅ μ ⋅ θ ⋅ dp ⋅ iσᵉ ⋅ (Mᵉ - (n ⊗ n));
∂fεᵉˡ∕∂Δεᵉˡ +=
∂fεᵉˡ∕∂Δp = n;2 ⋅ μ ⋅ θ ⋅ ∂vᵖ∕∂σᵉ ⋅ Δt ⋅ n;
∂fp∕∂Δεᵉˡ = -// end of @Integrator }
The supported subset of unicode characters is fully detailed here.
Generalised behaviours relate a set of gradients to their conjugated fluxes.
The following example shows how the linear Fourier law can be implemented:
@DSL DefaultGenericBehaviour;
@Behaviour StationaryHeatTransfer;
@Author Thomas Helfer;
@Date 15/02/2019;
@Gradient TemperatureGradient gT;
"TemperatureGradient");
gT.setGlossaryName(
@Flux HeatFlux j;
"HeatFlux");
j.setGlossaryName(
@MaterialProperty thermalconductivity k;
"ThermalConductivity");
k.setGlossaryName(
@Integrator{
j = -k * (gT + dgT);// end of @Integrator
}
@TangentOperator {
Dt = -k * tmatrix<N, N, real>::Id(); }
The non linear case is much more interesting as the consistent tangent operator can be split in two blocks:
The latter is introduced by the @AdditionalTangentOperatorBlock
code block.
@DSL DefaultGenericBehaviour;
@Behaviour StationaryNonLinearHeatTransfer;
@Author Thomas Helfer;
@Date 15/02/2019;
@Gradient TemperatureGradient gT;
"TemperatureGradient");
gT.setGlossaryName(
@Flux HeatFlux j;
"HeatFlux");
j.setGlossaryName(
@AdditionalTangentOperatorBlock dj_ddT;
@Parameter real A = 0.0375;
@Parameter real B = 2.165e-4;
@LocalVariable thermalconductivity k;
@Integrator{
const auto T_ = T + dT;
1 / (A + B * T_);
k =
j = -k * (gT + dgT);// end of @Integrator
}
@TangentOperator {
dj_ddgT = -k * tmatrix<N, N, real>::Id();
dj_ddT = B * k * k * (gT + dgT);// end of @TangentOperator }
The last example deals with solid-liquid phase change in transient heat-transfer. The enthalpy is treated in as a state variable. Its derivative with respect to temperature is yet another block in the tangent operator:
@DSL DefaultGenericBehaviour;
@Behaviour HeatTransfer;
@Author Thomas Helfer;
@Date 15 / 02 / 2019;
@Gradient TemperatureGradient gT;
"TemperatureGradient");
gT.setGlossaryName(
@Flux HeatFlux j;
"HeatFlux");
j.setGlossaryName(
@StateVariable real H;
"Enthalpy");
H.setEntryName(
@AdditionalTangentOperatorBlock dj_ddT;
@AdditionalTangentOperatorBlock dH_ddT;
@Parameter Tm = 933.15;
@Parameter ks = 210;
@Parameter Cs = 3.e6;
@Parameter kl = 95;
@Parameter Cl = 2.58e6;
@Parameter dHsl = 1.08048e9;
@LocalVariable thermalconductivity k;
// @LocalVariable real H0;
@LocalVariable real Ce;
@Integrator {
const auto T_ = T + dT;
// const auto Te = temperature(0.01);
// const auto Ts = Tm-Te;
// const auto Tl = Tm+Te;
// heat flux
k = (T_<Tm) ? ks : kl;
j = -k*(gT+dgT);// enthalpy
if(T_<Tm){
Ce = Cs;
H = Cs*T_;else {
}
Ce = Cl;
H = Cl*(T_-Tm)+dHsl+Cs*Tm;
}// end of @Integrator
}
@TangentOperator {
dj_ddgT = -k * tmatrix<N, N, real>::Id();0));
dj_ddT = tvector<N, real>(real(
dH_ddT = Ce;// end of @TangentOperator }
All those examples have been tested in the FEniCS
platform and validated against analytical results or test cases extracted from the Cast3M
or Code_Aster
codes.
Generalised behaviours are currently limited by the tensorial objects provided by the TFEL/Math
library.
Only the generic
interface handles generalised behaviours.
StandardElastoViscoPlasticity
brickA regularised Mohr-Coulomb stress potential is now available. This stress potential is fully described here.
As defined by Wikipedia, Quality assurance (QA) is a way of preventing mistakes and defects in manufactured products and avoiding problems when delivering products.
Fuel performance codes are developed under stringent Quality Assurance requirements that make their developers reluctant to rely on shared libraries to deliver material knowledge they are responsible for. A risk that must be mitigated as much as possible is the replacement of a shared library by another one, either intentionally to modify the results of the code or by accident (conflict with a previous version for example).
Specifying a build identifier proposes a solution for this issue. During building the shared libraries, developers may now specify a build identifier using the TFEL_BUILD_ID
environment variable. This identifier is meant to be only known by the developers of the code and is hidden to end users. At runtime, when calling a shared library, the code can retrieve its build identifier, if any, and can check if it matches the identifier defined by the developers. If not, it may indicate a conflict exists with a previous versions of the shared library or that the end user wants to test a new material property or a new mechanical behaviour. In both cases, the code will report that results are unreliable and not coverered by the code specifications.
In previous versions, parameters had the implicit type real
. The user can now specify any scalar type. This makes the declaration of parameters consistent with the declaration of the other variables.
@Parameter strainrate de0 = 1e-4;
Cyrano
fuel performance codeFor the Cyrano
fuel performance code to call external material properties, a dedicated interface has been built.
The prototype of the generated functions is as follows:
CyranoRealType (*)(CyranoOutputStatus* const,
const CyranoRealType* const,
const CyranoIntegerType,
const CyranoOutOfBoundsPolicy);
This new interface is fully documented here.
Cast3M
’ behaviour interfaceCast3M
users have to deal with two a priori incompatible requirements:
Cast3M
’ default algorithm relies on the definition of the elastic stiffness.MFront
implementations to define the elastic properties internally1.Possible workarounds so far include:
Cast3M
as its elastic stiffness is just a numerical parameter.MFront
files and compiling both the behaviour and the elastic properties.Both workarounds have their drawbacks:
This release introduces a better solution. When elastic properties are defined internally, the Cast3M
interface for behaviours now automatically generates the elastic material properties using the Cast3M
interface for material properties.
The generated functions: have a name built with the name of the behaviour, followed by the underscore, and the name of the material property and are built in the same shared library than the behaviour.
At this stage, one gets something very similar with the second solution we just discussed. However, we now have the following advantages:
Cast3M
usage, this is very useful for more advanced solvers built on top of Cast3M
, such as the ones available in the PLEIADES
platform. See also Section 3.2.Consider the following minimal example:
@DSL Implicit;
@Behaviour Test;
@ElasticMaterialProperties{"127.8e9*(1-7.825e-5*(T-293.15))", 0.3};
@ComputeStress{
2 ⋅ μ ⋅ εᵉˡ;
σ = λ ⋅ trace(εᵉˡ) ⋅ I₂ +
}@Integrator {
fεᵉˡ += Δεᵗᵒ; }
Compiling this behaviour with the Cast3M
interface generates the following output:
Treating target : all
The following library has been built :
- libUmatBehaviour.so : umattest Test_YoungModulus Test_PoissonRatio
In addition of the behaviour, this output highlights that two functions associated respectively with the YoungModulus
and the PoissonRatio
were generated.
In the generated example of usage, the material properties are declared as follows:
= 'TABLE';
xyoun 'MODELE' = 'Test_YoungModulus';
xyoun . 'LIBRAIRIE' = '';
xyoun . 'VARIABLES' = 'MOTS' 'T';
xyoun .
= 0.3; xnu
Cyrano
’ behaviour interfaceFor post-processing reasons, the Cyrano
fuel performance code must access the elastic material properties used by the behaviour. To ensure consistency, the behaviour now automatically exports the elastic material properties when they are defined internally.
The MFront
API was greatly improved to allow the implementation of the tfel-editor
’ behaviour wizard.
COMSOL Multiphysics
and DIANA FEA
This release introduces two new experimental interfaces for the COMSOL Multiphysics
and DIANA FEA
solvers.
Experimental means that those interfaces have been build using the solvers specifications but have not been tested in those solvers.
There are 125
unit tests associated with the DIANA FEA
solver through MTest
.
Users of those solvers willing to test those new interfaces are welcomed.
MTest
generic
interfaceThe following options can be passed to the behaviour:
stress_measure
. The value of this option must be either CauchyStress
(or CAUCHY
), SecondPiolaKirchoffStress
(or PK2
) or FirstPiolaKirchoffStress
(or PK1
).tangent_operator
. The value of this option must be either:
DCAUCHY_DF
(or DSIG_DF
): the derivative of the Cauchy stress with respect to the deformation gradientDS_DEGL
: the derivative of the second Piola-Kirchoff stress with respect to the Green-Lagrange strainDPK1_DF
: the derivative of the first Piola-Kirchoff stress with respect to the deformation gradient is returned@Behaviour<generic> 'src/libBehaviour.so' 'LogarithmicStrainElasticity2' {
stress_measure : PK2,
tangent_operator : DPK1_DF };
The output of the behaviour is still the Cauchy stress. The stress measure on input and input are converted from or to the Cauchy stress.
The non linear algorithm still relies on the derivative of the Cauchy stress with respect to the deformation gradient: the tangent operator returned by the behaviour is automatically converted to this derivative.
Cast3M
behavioursAs detailed in Section 2.7, behaviours generated by the Cast3M
interface may export their elastic properties. If so, those elastic properties are automatically loaded by MTest
(if not declared by the user).
python
bindings)Various methods have been added to the MTest
and PipeTest
class in python
:
completeInitialisation
: this method used to be called internally by the execute
method. However, this prevented multiple calls to the execute
method. The completeInitialisation
is made public. If this method is called explicitly by the user, the execute
method shall be called with the False
argument. This method shall only be called onceresetOutputFiles
: this method closes and reopens all the output files.mfm-test-generator
mfm-test-generator
provides a way to generate input files for various solvers for specific cases. See the dedicated page for details.
TFEL
’ core librariesTFEL/Material
libraryThe derivative of the first Piola-Kirchhoff stress with respect to the deformation gradient is now available as a tangent operator for finite strain behaviour.
Various functions allowing the computation of the Mohr-Coulomb yield criterion, its first and second derivatives are now available. See this page for details.
TFELUnicodeSupport
This release introduces a new library called TFELUnicodeSupport
. The purpose of this library is mainly to provide some mangling mechanisms that convert names based a subset of UTF-8
characters into valid C++
identifiers.
TFEL/System
libraryExternalLibraryManager
ExternalLibraryManager
’ new features includes:
Cyrano
interface (see Section 2.6).ExternalBehaviourData
structureThe ExternalBehaviourData
class now contains three new fields associated respectively with the build identifier see Section 2.4), the interface used to generate the behaviour, and the exported elastic material properties.
The later is empty if the behaviour does not export elastic material properties.
See the doxygen documentation for details.
ExternalMaterialPropertyData
and ExternalMaterialPropertyDescription
structuresThe ExternalMaterialPropertyData
and ExternalMaterialPropertyDescription
structures provides metadata about a material property. See the doxygen documentation for details.
TargetsDescription
In previous versions, the class TargetsDescription
was mainly designed to handle libraries. Version 3.3 provides a better support for executables.
The following changes were made:
TargetsDescription
is not more iterable. One shall use the getLibraries()
methods to get an iterable object over libraries.LibraryDescrition
can’t be retrieved via the subscript operator []
, one shall use the getLibrary
method instead.This feature is detailled in Section 2.8.1. See also Section 2.6.
For more details, see: https://sourceforge.net/p/tfel/tickets/183/
generic
interfaceThe generic
interface now allows to specify, for finite strain behaviours (including the behaviours based on the Green-Lagrange and the Hencky strain measure):
If K
is the array used to store the consistent tangent operator, K[0]
still represent the kind of integration to be performed.
For finite strain behaviours K[1]
must now hold the stress measure used:
K[1]
< 0.5, the Cauchy stress is usedK[1]
< 1.5, the second Piola-Kirchoff stress is usedK[1]
< 2.5, the first Piola-Kirchoff stress is usedK[2]
must hold the consitent tangent operator returned by the behaviour:
K[2]
<0.5, the derivative of the Cauchy stress with respect to the deformation gradient is returnedK[2]
<1.5, the derivative of the second Piola-Kirchoff stress with respect to the Green-Lagrange strain is returnedK[2]
<2.5, the derivative of the first Piola-Kirchoff stress with respect to the deformation gradient is returnedFor more details, see: https://sourceforge.net/p/tfel/tickets/172/
For more details, see: https://sourceforge.net/p/tfel/tickets/171/
For more details, see: https://sourceforge.net/p/tfel/tickets/169/
Elastic properties may be defined in various ways. One way is to use either the @ElasticMaterialProperties
keyword or the @ComputeStiffnessTensor
keyword. Another way is to define them inside the options of bricks.↩︎