I like to have the elastic coefficients to be temperature dependent,
i.e Youngs modulus (4,4) should to be set with temperature dependent coefficients.
I tried
Youngs modulus (4,4) = Variable Temperature
Real MATC " 1.19e11 " MATC " 2.18e10 " MATC " 1.81e10 " MATC " 0 " \
MATC " 2.18e10 " MATC " 1.15e11 " MATC " 2.18e10 " MATC " 0 " \
MATC " 1.81e10 " MATC " 2.18e10 " MATC " 1.19e11 " MATC " 0 " \
MATC " 0 " MATC " 0 " MATC " 0 " MATC " 4.55e10 "
as a simple test (later I want to use tx in the expression)
but when updating I got the error
Solver input file error: MATC ERROR: Undeclared identifier: [matc].
...offending input line: 1.19e11 matc 2.18e10 matc 1.81e10 matc 0 matc 2.18e10 matc 1.15e11 matc 2.18e10 matc 0 matc 1.81e10 matc 2.18
Is there a workaround ?
Wolfram
MATC expression in 2D array definition
Re: MATC expression in 2D array definition
Hi,
you don't need MATC just for a table. This should work:
The MATC keyword needs to be written only once, like in
For details see the MATC manual, e.g. chapter 2 for array syntax...
HTH,
Matthias
you don't need MATC just for a table. This should work:
Code: Select all
Youngs modulus
size 4 4
Real 1.19e11 2.18e10 1.81e10 0 \
2.18e10 1.15e11 2.18e10 0 \
1.81e10 2.18e10 1.19e11 0 \
0 0 0 4.55e10 \
End
Code: Select all
myvar = Variable Temperature
Real MATC "5.67e8 * tx^4"; End
HTH,
Matthias
Re: MATC expression in 2D array definition
this was only the first trivial test case.
In principle I like to have something like
Or is it possible to create the vector in MATC and MATC is returning the vector (or matrix) ?
Wolfram
In principle I like to have something like
Code: Select all
Youngs modulus (4,4) = Variable Temperature
Real MATC " 1.19e111.7e7*tx " MATC " 2.18e101.1e7*tx " MATC " 1.81e101.1e6*tx " MATC " 0 " \
MATC " 2.18e101.1e7*tx " MATC " 1.15e11/5e6*tx " MATC " 2.18e101.1e7*tx " MATC " 0 " \
MATC " 1.81e101.1e6*tx " MATC " 2.18e101.7e7*tx " MATC " 1.19e111.7e7*tx " MATC " 0 " \
MATC " 0 " MATC " 0 " MATC " 0 " MATC " 4.55e105e6*tx "
Wolfram

 Site Admin
 Posts: 3321
 Joined: 22 Aug 2009, 11:57
 Antispam: Yes
 Location: Espoo, Finland
 Contact:
Re: MATC expression in 2D array definition
Hi Wolfram
As it happens I had some similar needs and created 4 test cases for unisotropic heat conductivity: constant, MATC, table, UDF. See the test cases HeatUniso* at devel branch since three minutes.
Peter
As it happens I had some similar needs and created 4 test cases for unisotropic heat conductivity: constant, MATC, table, UDF. See the test cases HeatUniso* at devel branch since three minutes.
Peter
Re: MATC expression in 2D array definition
Hi Wolfram,
You can also observe a MATC expression written to describe the variation of anisotropic thermal conductivity with coordinate (variable)
at https://github.com/anilkunwar/elmerfem/ ... oKthml.sif.
The mathematical equation is described as Eq. 12 in https://www.sciencedirect.com/science/a ... 9517309354.
The solver input file is similar to the example:https://github.com/ElmerCSC/elmerfem/bl ... C/case.sif quoted by Peter , with the addition of function to describe the MATC expressions that are longer than 128 characters.
Peter, I would like to thank you for uploading the examples of UDF, Table and Constants.
https://github.com/ElmerCSC/elmerfem/bl ... o/case.sif
https://github.com/ElmerCSC/elmerfem/bl ... e/case.sif
https://github.com/ElmerCSC/elmerfem/bl ... F/case.sif
Yours Sincerely,
Anil Kunwar
You can also observe a MATC expression written to describe the variation of anisotropic thermal conductivity with coordinate (variable)
at https://github.com/anilkunwar/elmerfem/ ... oKthml.sif.
Code: Select all
...
$function test(x) {z=0.0;k=34.2;o=0.01; _test= k z (k*o*x(1)/(x(0)*x(0)+x(1)*x(1)+0.0000005)) z k (k*o*x(0)/(x(0)*x(0)+x(1)*x(1)+0.0000005)) (k*o*x(1)/(x(0)*x(0)+x(1)*x(1)+0.0000005)) (k*o*x(0)/(x(0)*x(0)+x(1)*x(1)+0.0000005)) (k*(1.0+o*o/(x(0)*x(0)+x(1)*x(1)+0.0000005))) }
! Use a nonzero very small number (0.0000005) to prevent numerical instability of division by zero when x = 0 and y = 0.
Material 1
...
Heat conductivity(3,3) = Variable Coordinate 1, Coordinate 2
Real MATC "test(tx)"
...
End
The solver input file is similar to the example:https://github.com/ElmerCSC/elmerfem/bl ... C/case.sif quoted by Peter , with the addition of function to describe the MATC expressions that are longer than 128 characters.
Peter, I would like to thank you for uploading the examples of UDF, Table and Constants.
https://github.com/ElmerCSC/elmerfem/bl ... o/case.sif
https://github.com/ElmerCSC/elmerfem/bl ... e/case.sif
https://github.com/ElmerCSC/elmerfem/bl ... F/case.sif
Yours Sincerely,
Anil Kunwar
Re: MATC expression in 2D array definition
Thank's Anil.
The following works
The following works
Code: Select all
$function elastconst(x) {_elastconst = (1.36e111.65e7*x) (2.80e106.20e6*x) (2.43e106.20e6*x) 0 \
(2.80e106.20e6*x) (1.32e111.70e7*x) (2.80e106.20e6*x) 0 \
(2.43e106.20e6*x) (2.80e106.20e6*x) (1.36e111.65e7*x) 0 \
0 0 0 (5.22e105.40e6*x) }
......
Youngs modulus (4,4) = Variable Temperature
MATC "elastconst(tx)"