Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.
Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.
about the Random function
Posted 2011年1月31日 GMT-5 12:15 Parameters, Variables, & Functions Version 4.0 12 Replies
Please login with a confirmed email address before reporting spam
it uses a Random function as the initial condition, and the geometry is a square with sidelengths equal to 2*pi [m]
when I reduce the sidelength to 1[mm], the model cannot be computed correctly. I figure the problem is the Random function. when I reduce the geometry size, something must be done about the Random function. For the Random function, the default range of the argument is [0, 1], maybe it should be changed, but there is no corresponding setting option in the Random function definition interface.
Please login with a confirmed email address before reporting spam
I believe its a question of understanding then, the random function has a RMS standard deviation in "normal mode" or a boundary limit pk-pk amplitude in "Uniform mode".
So if you fill a 1x1 m domain the default settings are ok to cover the full area, if you reduce the area you should also scale the random function accordingly, either by using a variable for the range, or by multiplying your random function by a factor
--
Good luck
Ivar
Please login with a confirmed email address before reporting spam
Hi
I believe its a question of understanding then, the random function has a RMS standard deviation in "normal mode" or a boundary limit pk-pk amplitude in "Uniform mode".
So if you fill a 1x1 m domain the default settings are ok to cover the full area, if you reduce the area you should also scale the random function accordingly, either by using a variable for the range, or by multiplying your random function by a factor
--
Good luck
Ivar
HI, Ivar, thank you!
I don't quite understand "by using a variable for the range, or by multiplying your random function by a factor"
If my random function is as follows:
Number of arguments: 2
Distribution: Uniform
mean: 0.5
range: 0.01
This random function is suitable for 1*1 m domain
How should I change the random function to make it suitable to 100*100 um domain?
Can you give me an example?
By the way, I wonder the number-to-number spacing of the random function, for example, for 1*1 m domain, the number-to-number spacing is relatively small enough to the domain size, i.e., there are enough random numbers in the domain. But for smaller domains, for example, 100*100 um domain, the number-to-number spacing is comparable to the domain size, as a result, there are not enough random numbers in the domain. Am I right?
Please login with a confirmed email address before reporting spam
I believe I'm not fully understanding your question so you are saying that you have scaled the height (pk-pk value) and average, so OK that is what I was referring to.
But then you talk about a 1x1m domain, how is your domain sampled ?
to know where you are triggering the call to the random function. That is probably on the mesh nodes or even in between depending on the shape function selected.
So I would suggest check your output, refine the mesh and see if its related, is this is pure guess from my side, without a model it's difficult to coordinate ;)
--
Good luck
Ivar
Please login with a confirmed email address before reporting spam
The random function's range is the difference between the largest and smallest values that the function can return. A random function of two variables that is called with the space coordinate variables x and y works for any 2D domain. The spacing between the random values is given by the computational mesh.
The reason that the Phase Separation model does not work directly when changing the geometry size by several orders of magnitude is likely that the phase field parameters in the Settings window for the Phase Field Model node are not adapted to the new geometry. For example, the parameter controlling the interface thickness cannot be 0.08 meters if the domain is 0.1 mm by 0.1 mm. The other phase field parameters probably need some scaling as well.
Best regards,
Magnus Ringh, COMSOL
Please login with a confirmed email address before reporting spam
Hi
I believe I'm not fully understanding your question so you are saying that you have scaled the height (pk-pk value) and average, so OK that is what I was referring to.
But then you talk about a 1x1m domain, how is your domain sampled ?
to know where you are triggering the call to the random function. That is probably on the mesh nodes or even in between depending on the shape function selected.
So I would suggest check your output, refine the mesh and see if its related, is this is pure guess from my side, without a model it's difficult to coordinate ;)
--
Good luck
Ivar
Hi, Ivar
for comsol 4, you can see the model "phase separation", in Model Library: Chemical Engineering Module ---Multiphase flow.
keep all of the settings the same but just reduce the domain size to 1 mm, for example, the model will not be computed correctly.
Please login with a confirmed email address before reporting spam
AS mAGNUS IS WRITING, YOU NEED TO CHECK CAREFULLY ALL SETTINGS, SEVERAL ARE DOMAIN SIZE RELATED, AND ALL DO not SCALE READILY (WITHOUT SOME MANUAL INTERVENTION) WITH THE GEOEMTRY SIZE
--
Good luck
Ivar
Please login with a confirmed email address before reporting spam
hI
AS mAGNUS IS WRITING, YOU NEED TO CHECK CAREFULLY ALL SETTINGS, SEVERAL ARE DOMAIN SIZE RELATED, AND ALL DO not SCALE READILY (WITHOUT SOME MANUAL INTERVENTION) WITH THE GEOEMTRY SIZE
--
Good luck
Ivar
Thank you, Ivar, I've got it .
Please login with a confirmed email address before reporting spam
I expect you'll manage, there are many menus so it's easily to overlook some.
(sory for the caps lock, didnt notice it was on (I'm cheating time from a workshop ;)
--
Good luck
Ivar
Please login with a confirmed email address before reporting spam
Hi,
The random function's range is the difference between the largest and smallest values that the function can return. A random function of two variables that is called with the space coordinate variables x and y works for any 2D domain. The spacing between the random values is given by the computational mesh.
The reason that the Phase Separation model does not work directly when changing the geometry size by several orders of magnitude is likely that the phase field parameters in the Settings window for the Phase Field Model node are not adapted to the new geometry. For example, the parameter controlling the interface thickness cannot be 0.08 meters if the domain is 0.1 mm by 0.1 mm. The other phase field parameters probably need some scaling as well.
Best regards,
Magnus Ringh, COMSOL
Thank you!
I solve the problem according to your suggestion, thank you !
I have anther question. When I just reduce the geometry size, why the result at time=0 is not the same as the initial condition ( the random function), I thought the result at time=0 should always equal to the initial condition.
Please login with a confirmed email address before reporting spam
I believe that the initial conditions and the solution at t=0 are not necessarily equal, as initial conditions are not necessarily a "stable" stationary starting point, but I wuld expect that my solution solved at t=0 is coherent an unique
--
Good luck
Ivar
Please login with a confirmed email address before reporting spam
Hi
I believe that the initial conditions and the solution at t=0 are not necessarily equal, as initial conditions are not necessarily a "stable" stationary starting point, but I wuld expect that my solution solved at t=0 is coherent an unique
--
Good luck
Ivar
Hi, thank you, Ivar
You mean, if the initial condition given is not good enough, as you said not a stable stationary starting point, comsol will do something to make it a stable one, and this stable one will be the solution at t=0 ?
Thank you!
Please login with a confirmed email address before reporting spam
that is my understanding, but I havent really tested it out.
It is true that in certain cases I run a stationary solution with all t=0 settings, such to be sure I have a fully stabilised starting point , I store the solution and run the transient starting from this first run.
--
Good luck
Ivar
Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.
Suggested Content
- FORUM Random function independent of mesh
- KNOWLEDGE BASE Undefined Function Call
- BLOG Sampling Random Numbers from Probability Distribution Functions
- FORUM Random Function
- KNOWLEDGE BASE Out of Memory During Assembly