Ivar KJELBERG
COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
29 nov 2012, 09:39 GMT-5
Hi
take your data and load it into an interpolation function you define, then set your BC pressure to these values (multiplied by whatever units or units conversion required)
--
Good luck
Ivar
Hi
take your data and load it into an interpolation function you define, then set your BC pressure to these values (multiplied by whatever units or units conversion required)
--
Good luck
Ivar
Andrew Prudil
Nuclear Materials
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
30 nov 2012, 11:58 GMT-5
Hi,
In the past I found that I was able to:
-create a global function with the data I needed example_function(t)
-sample_parameter = example_function(t)
This method only works if you define it in the parameters area (and it will give you an orange text unknown variable warning due to t being undefined). When the model is run everything works fine. When I tried to use this with parameter sweeps to change which function a parameter was pointed to it failed. This is because one of the steps in the sweep is to evaluate all parameters to numerical values. Since it couldn't it stopped the sweep before it even started a simulation.
There is a a work around for sweeps using parameters to change a variable for example.
-example_parameter = 1
-example_function1(t)
-example_function2(t)
-example_variable = if(example_parameter = 1, example_function1(t), example_function2(t))
It works fine this way because all parameters can be evaluted to numbers. It is just a quirk of Comsol.
Obviously these methods cannot be used to change paramters which are used for solver settings, geometry or function definitions.
Hi,
In the past I found that I was able to:
-create a global function with the data I needed example_function(t)
-sample_parameter = example_function(t)
This method only works if you define it in the parameters area (and it will give you an orange text unknown variable warning due to t being undefined). When the model is run everything works fine. When I tried to use this with parameter sweeps to change which function a parameter was pointed to it failed. This is because one of the steps in the sweep is to evaluate all parameters to numerical values. Since it couldn't it stopped the sweep before it even started a simulation.
There is a a work around for sweeps using parameters to change a variable for example.
-example_parameter = 1
-example_function1(t)
-example_function2(t)
-example_variable = if(example_parameter = 1, example_function1(t), example_function2(t))
It works fine this way because all parameters can be evaluted to numbers. It is just a quirk of Comsol.
Obviously these methods cannot be used to change paramters which are used for solver settings, geometry or function definitions.
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
30 nov 2012, 13:05 GMT-5
Thanks for the response Ivar.
Worked like a charm! What i forgot is the (t) portion of the int_func(t).
In fact, I often find your responses in many of the discussion forum topics to be great solutions for my comsol problems.
Aaron
Thanks for the response Ivar.
Worked like a charm! What i forgot is the (t) portion of the int_func(t).
In fact, I often find your responses in many of the discussion forum topics to be great solutions for my comsol problems.
Aaron
Ivar KJELBERG
COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
30 nov 2012, 14:47 GMT-5
Hi
I'm not sure I'm gettinmg everything in your explanations, but one thing for sure: orange is no error but a unit incoherence, this COMSOL flags, as warning but consider that you know what you are doing, so it solves with the values it have, even if these might be wrong due to unit conversion errors, that COMSOl cannot know bout.
Among other most functions expect unitless values, but "t" is flagged as seconds in COMSOL so you should write (t[1/s]) to get a number without units representing a value of t as expressed in seconds (just as t[1/h] gives ouy time in real numbers representing hours etc).
You can only use PARAMETERS to set set your geoemtry, and to change a parameter overs a swee you need to add explicitely a "Parametric Node in the solver setting, and select the parameter you want to adapt. Then COMSOl will interpreste this parameter, redesign xyour geometry, remesh it and solve with the new geometry for each step (this works nicely so long the topology remains unchanged, but might fail if you your parameter changes the topology (i.e. swuare of one size =0 etc)
--
Good luck
Ivar
Hi
I'm not sure I'm gettinmg everything in your explanations, but one thing for sure: orange is no error but a unit incoherence, this COMSOL flags, as warning but consider that you know what you are doing, so it solves with the values it have, even if these might be wrong due to unit conversion errors, that COMSOl cannot know bout.
Among other most functions expect unitless values, but "t" is flagged as seconds in COMSOL so you should write (t[1/s]) to get a number without units representing a value of t as expressed in seconds (just as t[1/h] gives ouy time in real numbers representing hours etc).
You can only use PARAMETERS to set set your geoemtry, and to change a parameter overs a swee you need to add explicitely a "Parametric Node in the solver setting, and select the parameter you want to adapt. Then COMSOl will interpreste this parameter, redesign xyour geometry, remesh it and solve with the new geometry for each step (this works nicely so long the topology remains unchanged, but might fail if you your parameter changes the topology (i.e. swuare of one size =0 etc)
--
Good luck
Ivar