Good morning to all,
I have a case.sif input file that uses another file to include some constants like:
Constants
Gravity(4) = 0 -1 0 9.82
Unit Charge = 1.6021766e-19
.
.
.
!--------------------------------
include myInputParams.dat
!--------------------------------
END
... where the myInputParams.dat file contains the following lines:
nComp(2) = Real 4.0 3.0248
thCComp(2) = Real 0.2004 0.1187
vel2 = Real 10.0
(the array-like parameters are used for some UDF I have created ...)
I want to be able to assign the vel2 parameter value inside the Initial Condition section for e.g. Velocity 2:
Initial Condition 1
Name = "InitialCondition 1"
Velocity 2 = vel2 (or something equivalent)
End
Is this possible somehow ? (I know that I can create another .dat file and include it in the Initial Condition 1 section as with the Constants section but I want to avoid that)
Thanks very much in advance
Assigning constants values to initial conditions
-
- Site Admin
- Posts: 4812
- Joined: 22 Aug 2009, 11:57
- Antispam: Yes
- Location: Espoo, Finland
- Contact:
Re: Assigning constants values to initial conditions
Hi,
Do like this:
So here the "vel2" never becomes a legit keyword inside Elmer. It is just used when reading the sif file and interpreted by the built-in matc parser. The "$" tells the code that this one should be dealt with matc. It is noteworrthy that matc has two operating modes. This "$" used when reading the file, and "MATC" when evaluating expressions in each nodal point.
So you could also have the following present a parabolic velocity profile in x \in [0,1].
-Peter
Do like this:
Code: Select all
$vel2=10.0
...
Velocity 2 = $vel2
So you could also have the following present a parabolic velocity profile in x \in [0,1].
Code: Select all
Velocity 2 = Variable "coordinate 1"
Real MATC "4*vel2*tx*(1-tx)"
Re: Assigning constants values to initial conditions
Hi Peter,
thanks very much for the information.
That worked like a charm !
thanks very much for the information.
That worked like a charm !