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.
Initial conditons extracted from a saved file
Posted Jan 22, 2010, 6:52 p.m. EST 14 Replies
Please login with a confirmed email address before reporting spam
1. I have two time dependent models, modeled and saved in two separate m-files, let's say the file names are m1 and m2
2. From a third matlab window I would like to run m1 for 0:0.01:4, save the output(Solved data), use this solved data as an initial condition of m2, run m2.
I will definitely appreciate if someone can advise me how to save the solved post-processing data of m1 and used that as an initial condition of m2 and run m2.
Please login with a confirmed email address before reporting spam
My way would be to do it in the COMSOL GUI (you can l,oad in from Matlab), but this means that you have to have exactly the same geometry in both cases (fiddle with solve intitiaisation and sequensing window), because otherwise you have a solution mapping issue, that indeed you can only perform in matlab, but this means that you must know exactly which sub-domain/boundary/edge/point index element is referring to what in "m1" and to where to go in "m2".
Good luck
Ivar
Please login with a confirmed email address before reporting spam
m1 and m2 are same geometry. I exported solution result from m1 to a text file from Comsol window by following File > Export > Postprocessing data > last time step > directed to the text file (result.txt). Now what would be the process of loading result.txt to m2 ? I am not sure about how to do this. I will appreciate your help.
Please login with a confirmed email address before reporting spam
1. I can make sure that I have understood the process of loading initial values correctly. In this regard m1 was opened in comsol window (as per your advice), exported the result (pressure p2) to result.txt.
2. I reopened m1 in comsol window added the result as a function (Options > functions > new > Interpolation > File > result.txt (browsed to destination) > store data in model > ok, and then kept the default (linear and constant) > ok.
3. m1 was rerun and no effect found on the result. The solution should start from saved p2 but it seemed not.
I was wondering the wrong things that I were doing.
Have fun
Aziz
Please login with a confirmed email address before reporting spam
I'm not familiar with exporting and importing this way via text files. I usually play with the solve parameters performing one simulations, then restarting with saved values and performing further analysis (even other physics by selecting the appropriate ones) all in the COMSOL GUI, or with the segregated solver settings. Have a look in the different tabs of the Solver Manager. But probably this means that you must only have "one " geometry, but different physics.
Good luck
Ivar
Please login with a confirmed email address before reporting spam
I hope you are doing good. Thank you for replying me, I appreciate your time. I thought I could get the opportunity to share the following with you.
I ran/solved a time dependent ALE model in comsol and got postprocessing data, deformed geometry, etc. I am interested in this deformed geometry if I could use this as a geometry of another model. I will take the opportunity to make this more clear.
1. I would like to extract / export (or any other process/advice) the deformed geometry from the output of the ALE model at the end of the solution time.
2. I will make another model with this geometry. In this case the deformed geometry is the initial geometry of the new model.
3. Is this possible ? How ?
Any advice will be highly appreciated.
Have fun.
Aziz
Please login with a confirmed email address before reporting spam
Yes you can at any time save the models and then export/import your mesh, look at the "file export as mesh" or "file import as mesh" options
And run an indexed search for "import mesh" on your doc
To rerun a model on imported mesh you must first get it "analysed" in the sens you (COMSOL) must create the boundaries onto which you apply your physics.
Therefore COMSOl has 3 geometrical entities, this is often overlooked:
1)- raw geometry (the one you create, import) <=>
2)- analysed geometry (simplified by COMSOL, redundant volumes, surfaces, lines points are removed, items are split and reordered, elements are inexed in a given way, line directions are defined, surface normals as well, etc. <=>
3)- meshed Lines/Surfaces/Volumes of the analysed geometry with indexes to idetify which node belongs to which surface/line=boundary, and which element belongs to which Volume/Surface=Sub-Domain to apply the correct physics to these Nodes/elements
The bidirectionality link is not obvious and in fact not always possible without some human intervention
You see this also in the logic of the icons on top of the window:
One (1) for raw geometry,
Four (4) for analysed geometry (i.e Points, lines=Edges, surfaces=Boundaries, volumes=Sub-domains as defined for 3D, nameing "left-shift" for 2D respectively 1D)
One (1) for meshed geometry
Hope this helps
Good luck
Ivar
Please login with a confirmed email address before reporting spam
I am really interested to work on your reply posted on January 26, 2010.
I made two simple models to understand the scenario. First model was a stepped channel ( 10cm width x 50 cm long and 20cm x 100 cm). Water flowing into the channel and exit, solving for 0:0.1:2 time. Second model had channel shape 40 cm x 80 cm instead of 20 x100, time 2:0.1:4, all others are same. I took these two models on the matlab window one after another. I wrote proper matlab codes to feed the initial condition of the second model taken from the output solution of the first model .The results were validated, worked good.
I was encouraged to make a counter check with another set of models, in this case it was ALE. I used a similar process with ALE models but not making different geometry. In ALE at any different time steps the geometry will be different. For the first model time was 0:0.005:1 and 1:0.005:2 or 0:0.005:1 for the second model. It did not work.
A separate technique that I thought should work: From the first model output new geometry was created from the mesh, ale frame, it was deformed geometry at the end of solution time and different from the raw geometry. My understanding was - these would solve the mesh coordinates and associated values issues. Redefined the domain, subdomain and the boundaries, used the previous technique of feeding initial values to the deformed model. But this also did not work, I wondered, why ?
Using Solver Manager:
In the solver manager I used one model of each to create fem0 and fem1. In this case channel worked good but ALE didn't. ALE worked in different solver.
Any advice will be appreciated. Have fun.
Aziz
Please login with a confirmed email address before reporting spam
I have a similar problem of using the stored solution as the initial condition.......
I have a membrane, i structurally deformed by a dc voltage...
Now, i want to use this deformed position , in a furter step.... i.e i wnt to calculate eigen freq at this deformed postion.... plz help... how to proceed????
I'll be highly obliged..
Waiting.................
Please login with a confirmed email address before reporting spam
Thanks - Aziz
Please login with a confirmed email address before reporting spam
Thanku for ur time.... but still i'm in doubt.
I tried my best to follow you but i couldn't get any fruitful results. May u plz detail out ur last answer or may b (if u have) send me a model explaining what u said. i am a user of comsol3.5a.
waiting.
plz reply fast.
Please login with a confirmed email address before reporting spam
Thanks
Aziz
Please login with a confirmed email address before reporting spam
check the forum, for 3.5a there are several discussion on restarting/continuing an analysis with the solver sequencer
--
Good luck
Ivar
Please login with a confirmed email address before reporting spam
here i have attached a .mph file of my model.... Clearly some structural deformation is obtained after application of 15V voltage.... Now i want to calculate eigen freq of this membrane at this deformed position (not the initial position).......
how to proceed?
Regards
Archana
Attachments:
Please login with a confirmed email address before reporting spam
First of all your mesh seem to me far to coarse to obtain good results, but as a start it's probably OK. check that you ahve a few elelments in the thikness between your electrodes. Also t start with, do it in 2D with a beam its easier to debug the physics
Now in 3.5a from my understanding you must go via matlab to save your static case and then do a an eigenfrequency analysis linearisation from the stressed saved starting point.
in v4 it's by performing a double segregated solving , stationary followed by an eigenfrequency restarted from the stationary case
--
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 Eigen Frequency from Extracted Stiffness and Mass Matrices
- FORUM Regarding your Post "Initial conditons extracted from a saved file"
- BLOG Extracting Electrical Circuits from Electromagnetics Simulations
- KNOWLEDGE BASE Wrong number of DOFs in initial value
- KNOWLEDGE BASE Solving time dependent models with inconsistent initial values