# Nicolò Grilli
# University of Bristol
# 5 Agosto 2021
# I copy the following file
# /home/nicolo/projects/SalomeMeca2019/V2019.0.3_universal/tools/Code_aster_stable-v144_smeca/share/aster/tests/MonoCrystal_CFC.mfront
# to the project directory
# /home/nicolo/projects/SalomeMeca2019/test_simu_point_mat_video
# compile mfront code
cd /home/nicolo/projects/SalomeMeca2019/appli_V2019.0.3_universal
./salome shell
cd /home/nicolo/projects/SalomeMeca2019/test_simu_point_mat_video
mfront-3.2.1 --obuild --interface=aster MonoCrystal_CFC.mfront
# src and include folders with the compiled code are created
# some warnings appear but compiling is fine
# the file libAsterBehaviour.so is in src folder
# this is the one that provides the library for Code Aster
# the message generated is
#
# Treating target : all
# The following library has been built :
# - libAsterBehaviour.so : astermonocrystal_cfc
#
# the name 'astermonocrystal_cfc' will be used in the line of the behaviour mtest file
# sorry youtube does not allow angular brackets, so I am using
# < and > instead
# @Behaviour < aster > 'src/libAsterBehaviour.so' 'astermonocrystal_cfc';
# other MFront commands to understand the keywords in the .mfront file
mfront-query-3.2.1 --material-properties MonoCrystal_CFC.mfront
mfront-3.2.1 --help-keyword=Implicit:@RequireStiffnessTensor
mfront-3.2.1 --help-keyword=Implicit:@OrthotropicBehaviour
# a similar mtest file to the one needed for MonoCrystal_CFC can be found in:
# /home/nicolo/projects/SalomeMeca2019/V2019.0.3_universal/prerequisites/Mfront-TFEL321/share/doc/mfront-3.2.1/tests/behaviours/bricks/FiniteStrainSingleCrystal/aster/finitestrainsinglecrystal-012.mtest
# copy that file to:
# /home/nicolo/projects/SalomeMeca2019/test_simu_point_mat_video
# rename the file to:
# MonoCrystal_CFC.mtest
# the behaviour line:
# @Behaviour < aster > @library@ @behaviour@;
# must be changed to:
# @Behaviour < aster > 'src/libAsterBehaviour.so' 'astermonocrystal_cfc';
# remove the line with:
# ElasticPartOfTheDeformationGradient
# because this internal variable does not exist in the .mfront model
# rotation matrix represents the orientation of the single crystal
# with respect to the xyz sample reference frame
# this is a small strain model and deformation gradient cannot be imposed
# impose the strain instead with the following line:
# @ImposedStrain 'EXX' {0:0,10:0.004};
# change the time to be consistent with the imposed strain
# @Times {0.,10. in 2000};
# remove the last two lines with @Test
# run mtest
mtest-3.2.1 MonoCrystal_CFC.mtest
# the .res file is generate
# and the stress-strain curve
# a useful forum discussion:
# [ Ссылка ]
# how to modify the .comm file to run aster with MFront on arbitrary mesh:
# [ Ссылка ]
# the complete .mtest file is reported in the following:
/*!
* \file MonoCrystal_CFC.mtest
* \brief mtest file for single crystal simulation
* \author Nicolò Grilli
* \brief 5 Agosto 2021
*/
@MaximumNumberOfSubSteps 1;
@PredictionPolicy 'LinearPrediction';
@Real 'young' 208000.;
@Real 'nu' 0.3;
@Real 'G' 'young/2.6';
// 'astermonocrystal_cfc' must be the name that you get after compiling
// mfront-3.2.1 --obuild --interface=aster MonoCrystal_CFC.mfront
// from the command line
//
// Treating target : all
// The following library has been built :
// - libAsterBehaviour.so : astermonocrystal_cfc
@Behaviour < aster > 'src/libAsterBehaviour.so' 'astermonocrystal_cfc';
@MaterialProperty < constant > 'YoungModulus1' 'young';
@MaterialProperty < constant > 'YoungModulus2' 'young';
@MaterialProperty < constant > 'YoungModulus3' 'young';
@MaterialProperty < constant > 'PoissonRatio12' 'nu';
@MaterialProperty < constant > 'PoissonRatio13' 'nu';
@MaterialProperty < constant > 'PoissonRatio23' 'nu';
@MaterialProperty < constant > 'ShearModulus12' 'young';
@MaterialProperty < constant > 'ShearModulus13' 'young';
@MaterialProperty < constant > 'ShearModulus23' 'young';
@MaterialProperty < constant > 'm' 10.0;
@MaterialProperty < constant > 'K' 25.0;
@MaterialProperty < constant > 'C' 14363.;
@MaterialProperty < constant > 'R0' 66.62;
@MaterialProperty < constant > 'Q' 11.43;
@MaterialProperty < constant > 'b' 2.1;
@MaterialProperty < constant > 'd1' 494.0;
@ExternalStateVariable 'Temperature' 293.15;
// 0:0 means at time 0, strain_xx is 0
// 10:0.004 means at time 0, strain_xx is 0.004
// other components are not imposed,
// it means along Y and Z boundaries are stress free
@ImposedStrain 'EXX' {0:0,10:0.004};
@RotationMatrix {{ 1.0 , 0.0 , 0.0 },
{ 0.0 , 1.0 , 0.0 },
{ 0.0 , 0.0 , 1.0 }};
// initial time, final time, number of time steps
@Times {0.,10. in 2000};
Ещё видео!