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.

How to use the solution for an outlet in one simulation as an input or initial value for an inlet in a second simulation

Please login with a confirmed email address before reporting spam

Hello everyone,


I would like to know if it is possible to separate a large problem (fluid flow through long channels with incompressible navier-stokes and diffusion/convection) into small segments (separate *.mph files) and then start to solve the problem by starting to solve for the 1. segment and use the solution of the outlet as an input or initial value for the inlet in the second segment, then the solution of the outlet in the second segment as input for the inlet of the 3. segment and so on.

Is there any way? Otherwise I seriously run into memory problems with the required mesh size.

Looking forward to any kind response!

Regards,

Matthias

4 Replies Last Post 29 janv. 2012, 17:21 UTC−5
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 11 sept. 2010, 11:19 UTC−4
Hi

I would say any problem can be subdivided into smaller ones and processed your way if they are independent, in the sens that the effects of analyse 2 on analyse 1 (done previously) if any, are known or expressed such that they are taking into account during analyse 1.

But if you can really cut you problem like that I suppose it means that you could express it differently and reduce a (or several) dimensions into some equations.

Think of structural: a thin shell, simulated in 3D is expensive in number of mesh elements, while using "shell" elements with only a surface gives about the same "structural" results, the "thickness" of the shell has been taken account to by modifying the physics equations of the "shell elements"

which of the variables changes along the channel ? or which remain constant across your channel section ? How could you reduce this i.e. to a1D model ?

--
Good luck
Ivar
Hi I would say any problem can be subdivided into smaller ones and processed your way if they are independent, in the sens that the effects of analyse 2 on analyse 1 (done previously) if any, are known or expressed such that they are taking into account during analyse 1. But if you can really cut you problem like that I suppose it means that you could express it differently and reduce a (or several) dimensions into some equations. Think of structural: a thin shell, simulated in 3D is expensive in number of mesh elements, while using "shell" elements with only a surface gives about the same "structural" results, the "thickness" of the shell has been taken account to by modifying the physics equations of the "shell elements" which of the variables changes along the channel ? or which remain constant across your channel section ? How could you reduce this i.e. to a1D model ? -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 11 sept. 2010, 13:30 UTC−4
Hi, if you put them all into one .mph file then it is relatively easy. Put each of them in a separate mdoel. You might find it easier to debug if you start off by having uniform input and outlet on each of your domains. Instead of just clicking "compute", open up Study and add a bunch more "Stationary" steps. The click on show default solver and you will see that what you are doing is solving all of the models, saving the data, and running the models again with the old data as initial values.

That was the hard part :-)

Next go through each of the Solvers and look at Dependent variables. For each Solver you want to solve now just for one model, not solve all of the models each time. At this point I would be tempted to click "Compute" and see if your memory is ok.

And now to link them up, use linear extrusion to map from the outlet of one to the inlet of the next. The linear extrusion will (erroneously?) appear as orange, but it is ok. Now click "Compute" again. Done.....

Except that Ivar has a good point. How do you know that the outlet of the properties from the one domain don't depend on the solution in the next domain. If you wanted to have something really tedious, you could try iterating where you do Model1-> Model2->Model3 passing data onwards, but then do Model3->Model1->Model2->Model3 and check if the answer has changed much. If it has then you need a more sophisticated domain decomposition.
Hi, if you put them all into one .mph file then it is relatively easy. Put each of them in a separate mdoel. You might find it easier to debug if you start off by having uniform input and outlet on each of your domains. Instead of just clicking "compute", open up Study and add a bunch more "Stationary" steps. The click on show default solver and you will see that what you are doing is solving all of the models, saving the data, and running the models again with the old data as initial values. That was the hard part :-) Next go through each of the Solvers and look at Dependent variables. For each Solver you want to solve now just for one model, not solve all of the models each time. At this point I would be tempted to click "Compute" and see if your memory is ok. And now to link them up, use linear extrusion to map from the outlet of one to the inlet of the next. The linear extrusion will (erroneously?) appear as orange, but it is ok. Now click "Compute" again. Done..... Except that Ivar has a good point. How do you know that the outlet of the properties from the one domain don't depend on the solution in the next domain. If you wanted to have something really tedious, you could try iterating where you do Model1-> Model2->Model3 passing data onwards, but then do Model3->Model1->Model2->Model3 and check if the answer has changed much. If it has then you need a more sophisticated domain decomposition.

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 11 sept. 2010, 15:13 UTC−4
Hi

the orange is if I remember a unit issue (red is syntax error in V4).

I have noticed that often the operators or functions require unitless input and is unitless on output, so I usually write

genext1(u[1/(m/s)])*1[m/s]

instead of simply

genext1(u)

which is mostly orange

But it does not always work ;)

--
Good luck
Ivar
Hi the orange is if I remember a unit issue (red is syntax error in V4). I have noticed that often the operators or functions require unitless input and is unitless on output, so I usually write genext1(u[1/(m/s)])*1[m/s] instead of simply genext1(u) which is mostly orange But it does not always work ;) -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 29 janv. 2012, 17:21 UTC−5
I am faced with a similar problem. Could you provide a sample .mph file?
I am faced with a similar problem. Could you provide a sample .mph file?

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.