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.

time dependent solver and not converged step

Please login with a confirmed email address before reporting spam

Hi
i am coupling fluid flow and heat transfer in comsol. my geometry consists of a U-pipe with water flowing within, embedded in a cylinder of grout .
i need to have very fine meshing in the U-pipe due to the model sensitivity to number of mesh elements wherever convection and conduction are interfering with each other.
in a transient study i get the error: last step not converged if i increase the number of mesh elements but if i run it with normal meshing it is OK.

i would appreciate if anyone let me know how to solve this issue

cheers
ASAL

13 Replies Last Post Feb 2, 2012, 4:56 p.m. EST
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 Jan 23, 2012, 1:54 a.m. EST
Hi

Thermal flow is rather complex, and requires very fine mesh, AND very short time stepping, (perhaps try a "intermediate" time stepping and not the defult "free", see solver - tiem steppng su-node) particularly if you are in a turblent mode (or with convection)

Often it's worth to start with smaller models, these solve quicker, to get the model running, then increase the size (and RAM and time to solve requirements) to get to the final solution

--
Good luck
Ivar
Hi Thermal flow is rather complex, and requires very fine mesh, AND very short time stepping, (perhaps try a "intermediate" time stepping and not the defult "free", see solver - tiem steppng su-node) particularly if you are in a turblent mode (or with convection) Often it's worth to start with smaller models, these solve quicker, to get the model running, then increase the size (and RAM and time to solve requirements) to get to the final solution -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jan 23, 2012, 8:01 p.m. EST
Thanks Ivar.
actually i could run the model with relatively coarse meshing and big time steps but when i tried to make them finer, could not run the model anymore and i get the well known error. last time step is not converged.
i am using direct solver MUMPS or PARDISO
Thanks Ivar. actually i could run the model with relatively coarse meshing and big time steps but when i tried to make them finer, could not run the model anymore and i get the well known error. last time step is not converged. i am using direct solver MUMPS or PARDISO

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jan 29, 2012, 7:17 p.m. EST

Hi

Thermal flow is rather complex, and requires very fine mesh, AND very short time stepping, (perhaps try a "intermediate" time stepping and not the defult "free", see solver - tiem steppng su-node) particularly if you are in a turblent mode (or with convection)

Often it's worth to start with smaller models, these solve quicker, to get the model running, then increase the size (and RAM and time to solve requirements) to get to the final solution

--
Good luck
Ivar


Hi Ivar,
thanks a lot. which solver do you recommend for transient heat transfer and fluid flow?
[QUOTE] Hi Thermal flow is rather complex, and requires very fine mesh, AND very short time stepping, (perhaps try a "intermediate" time stepping and not the defult "free", see solver - tiem steppng su-node) particularly if you are in a turblent mode (or with convection) Often it's worth to start with smaller models, these solve quicker, to get the model running, then increase the size (and RAM and time to solve requirements) to get to the final solution -- Good luck Ivar [/QUOTE] Hi Ivar, thanks a lot. which solver do you recommend for transient heat transfer and fluid flow?

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jan 29, 2012, 11:52 p.m. EST
Hello Asal,

I am trying to model the exact same phenomenon. My model consists of two study steps. In my model, I model the U-tube using a thin conductive shell element and I don't model the pipe thickness or the carrier fluid. Instead, I make a stationary analysis to obtain the fluid velocity distribution along the tubes in the three dimensions (X, Y, Z) and then use this distribution in the time dependent analysis to model the heat input. I have three temperature dependent variables; vel, Tf and T. vel is the velocity distribution (thin conductive shell 1), Tf is the temperature of the fluid (thin conductive shell 2) and T is the temperature of the domains (grout and soil). So, I use two thin conductive shells and one heat transfer node for my model.

Stationary analysis just solves the first thin conductive shell with the dependent variable vel. Time dependent study consists of solving the second thin conductive shell (Tf) and heat transfer (T).

In order to model the borehole heat exchanger, I need to input a constant heat rate (let's say 15-25W per meter of borehole length) to the carrier fluid. To achieve this, I am using a boundary condition on the edges of pipe inlet: Tf_outlet + delta_T. In this way, I am adding constant heat to the system (calculated via delta_T).

This model was created a while ago and I could run this model in COMSOL v3.5a. However, in v4.2a, I have some complications. Although I use exactly the same solver configuration, I can't get the same results. I tried a lot of different configurations to get reliable results. In some of my runs, the fluid temperature (Tf) begins to decrease after some time. In others, the fluid temperature rises to a certain value and then oscillates (+/- 10degC) throughout the duration of the analysis.

I am using PARDISO for the stationary analysis, which takes a couple of seconds. For the time dependent study step, I use a segregated solver. Tf is solved by PARDISO direct solver, and T is solved by the Iterative Solver BICGStab. For the iterative solver, I use Multigrid and for the Coarse solver of Multigrid node, I again use PARDISO direct solver. During solving, COMSOL uses approximately 8 Gb RAM.

Another thing is, lately whenever I try to run this analysis; it automatically switches to MUMPS solver. I could not understand why this is the case. In this case, COMSOL uses all of system memory (24 Gb).

I am wondering what kind of boundary conditions do you use (i.e. for heat input). Are you modeling the U-tube (with pipe thickness) and also the fluid as a domain? Is there any simplification in your model? I am using full 3D geometry (modeling the U-bend also).

In my model, I did not have any problems with meshing, but I have some problems with solver configurations as stated above.

--
Tolga
Hello Asal, I am trying to model the exact same phenomenon. My model consists of two study steps. In my model, I model the U-tube using a thin conductive shell element and I don't model the pipe thickness or the carrier fluid. Instead, I make a stationary analysis to obtain the fluid velocity distribution along the tubes in the three dimensions (X, Y, Z) and then use this distribution in the time dependent analysis to model the heat input. I have three temperature dependent variables; vel, Tf and T. vel is the velocity distribution (thin conductive shell 1), Tf is the temperature of the fluid (thin conductive shell 2) and T is the temperature of the domains (grout and soil). So, I use two thin conductive shells and one heat transfer node for my model. Stationary analysis just solves the first thin conductive shell with the dependent variable vel. Time dependent study consists of solving the second thin conductive shell (Tf) and heat transfer (T). In order to model the borehole heat exchanger, I need to input a constant heat rate (let's say 15-25W per meter of borehole length) to the carrier fluid. To achieve this, I am using a boundary condition on the edges of pipe inlet: Tf_outlet + delta_T. In this way, I am adding constant heat to the system (calculated via delta_T). This model was created a while ago and I could run this model in COMSOL v3.5a. However, in v4.2a, I have some complications. Although I use exactly the same solver configuration, I can't get the same results. I tried a lot of different configurations to get reliable results. In some of my runs, the fluid temperature (Tf) begins to decrease after some time. In others, the fluid temperature rises to a certain value and then oscillates (+/- 10degC) throughout the duration of the analysis. I am using PARDISO for the stationary analysis, which takes a couple of seconds. For the time dependent study step, I use a segregated solver. Tf is solved by PARDISO direct solver, and T is solved by the Iterative Solver BICGStab. For the iterative solver, I use Multigrid and for the Coarse solver of Multigrid node, I again use PARDISO direct solver. During solving, COMSOL uses approximately 8 Gb RAM. Another thing is, lately whenever I try to run this analysis; it automatically switches to MUMPS solver. I could not understand why this is the case. In this case, COMSOL uses all of system memory (24 Gb). I am wondering what kind of boundary conditions do you use (i.e. for heat input). Are you modeling the U-tube (with pipe thickness) and also the fluid as a domain? Is there any simplification in your model? I am using full 3D geometry (modeling the U-bend also). In my model, I did not have any problems with meshing, but I have some problems with solver configurations as stated above. -- Tolga

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jan 30, 2012, 1:25 a.m. EST
Also, I have another question. From my readings on this forum, I know that one should set the boundary conditions as smooth functions whenever he can. For the model I tried to explain above, do you think setting the temperature boundary condition as I stated could cause a problem?

The temperature boundary condition for the inlet edges are set to outlet temperature plus a constant. Outlet temperature is obtained by an average coupling variable of outlet edges. From my understanding, this sets the boundary condition for the inlet temperature as outlet + delta_T at all times. Thus, both inlet and outlet temperatures should increase throughout the model runtime, which is 30 days. The slope of the temperature curve is steeper for the first few days, and then it should become pretty gentle (log-linear).

Would this kind of boundary condition cause a problem and is there a way to apply this boundary condition with smooth transition?

--
Tolga
Also, I have another question. From my readings on this forum, I know that one should set the boundary conditions as smooth functions whenever he can. For the model I tried to explain above, do you think setting the temperature boundary condition as I stated could cause a problem? The temperature boundary condition for the inlet edges are set to outlet temperature plus a constant. Outlet temperature is obtained by an average coupling variable of outlet edges. From my understanding, this sets the boundary condition for the inlet temperature as outlet + delta_T at all times. Thus, both inlet and outlet temperatures should increase throughout the model runtime, which is 30 days. The slope of the temperature curve is steeper for the first few days, and then it should become pretty gentle (log-linear). Would this kind of boundary condition cause a problem and is there a way to apply this boundary condition with smooth transition? -- Tolga

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 Jan 30, 2012, 1:42 a.m. EST
Hi

you have many questions I can give some hints for a few, T (or any cte BC) values from start: smoothing is often better, but if you respect a minimum mesh density versus heat diffusion and time steps COMSOl is rather good to come over the initial turn on shock.

I mostly let COMSOl choose the default solver when I get rather convinced I have checked all other items that could be wrong, then only I start to see if I should change the sovler.

But reasdd also carefully the KB, use "time step" as search. And be waware that comments for any physics based on i.e. diffusion equations apply for all physics using the diffusion equation, do not limit your lecture to THE physics you intend to use

--
Good luck
Ivar
Hi you have many questions I can give some hints for a few, T (or any cte BC) values from start: smoothing is often better, but if you respect a minimum mesh density versus heat diffusion and time steps COMSOl is rather good to come over the initial turn on shock. I mostly let COMSOl choose the default solver when I get rather convinced I have checked all other items that could be wrong, then only I start to see if I should change the sovler. But reasdd also carefully the KB, use "time step" as search. And be waware that comments for any physics based on i.e. diffusion equations apply for all physics using the diffusion equation, do not limit your lecture to THE physics you intend to use -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jan 30, 2012, 2:32 a.m. EST
Thank you Ivar for your comments.

Do you think I could find a way to smooth the boundary condition in this particular problem? Could you also be more specific about minimum mesh density versus heat diffusion and time steps. How can I calculate the minimum mesh density / time steps to properly configure the solver? Many thanks.


--
Tolga
Thank you Ivar for your comments. Do you think I could find a way to smooth the boundary condition in this particular problem? Could you also be more specific about minimum mesh density versus heat diffusion and time steps. How can I calculate the minimum mesh density / time steps to properly configure the solver? Many thanks. -- Tolga

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 Jan 30, 2012, 3:17 a.m. EST
Hi

do a search on the FORUM about "heat diffusivity" alpha = k/rho/Cp and dz<sqrt(alpha*Dt) Nagi has given several interesting commentsabout this

to have the temperature our heat load start at "0" and increase rapidly use a step() function, and adapt the smoothing period, you might also add half the smoothing period to the offset to start at "0" and not at 50% of step for t=0

Note that adding a step function for diffusion equations works fine (if your time stepping and mesh denisty agree for the rise time, but if it's boundary loads on a structural analysis you want to perform, then use a "slow" ramp/smooting time, as else you might excite many higer frequency modes and your structure will ring and oscilalte for ever

--
Good luck
Ivar
Hi do a search on the FORUM about "heat diffusivity" alpha = k/rho/Cp and dz

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jan 30, 2012, 3:32 p.m. EST
Thank you again. I'll look into mesh size and Fourier number relationship.

Is there a direct way to acquire the average mesh size of a specific edge/boundary/domain? (such as a parameter that returns the mesh size) Or should I guess it via assigned minimum/maximum element size in the mesh/size node?

And I am still confused about my inlet edge temperature boundary condition. As it depends on the temperature of another edge in the model (outlet - by model coupling average), how will I be able to write a step function for it?

Will COMSOL be able to impose the effect of change in this boundary condition in the steps it is not solving, as it is calculating several time steps? I am curios about the in-between these time steps.

Regards,

--
Tolga
Thank you again. I'll look into mesh size and Fourier number relationship. Is there a direct way to acquire the average mesh size of a specific edge/boundary/domain? (such as a parameter that returns the mesh size) Or should I guess it via assigned minimum/maximum element size in the mesh/size node? And I am still confused about my inlet edge temperature boundary condition. As it depends on the temperature of another edge in the model (outlet - by model coupling average), how will I be able to write a step function for it? Will COMSOL be able to impose the effect of change in this boundary condition in the steps it is not solving, as it is calculating several time steps? I am curios about the in-between these time steps. Regards, -- Tolga

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 Jan 30, 2012, 4:00 p.m. EST
Hi

check the doc about the COMSOL variable "h" the average mesh edge length, or just lot "h" on the domain of your meshed model. You have also the mesh statistics

By looping your model with one edge depending on another you make your model highly non-linear, with a bit of luck the iterative solver will manage to converge, but you might need to tweak the solver and or time steps and BC variations a bit

Check the log and the convergence plots while solving to see how COMSOL is stepping through your solutions

--
Good luck
Ivar
Hi check the doc about the COMSOL variable "h" the average mesh edge length, or just lot "h" on the domain of your meshed model. You have also the mesh statistics By looping your model with one edge depending on another you make your model highly non-linear, with a bit of luck the iterative solver will manage to converge, but you might need to tweak the solver and or time steps and BC variations a bit Check the log and the convergence plots while solving to see how COMSOL is stepping through your solutions -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jan 30, 2012, 4:22 p.m. EST
Hello Ivar,

Thank you about the "h" variable.

Although I don't have convergence issues with the model, I get unrealistic results in average edge probes of the inlet and outlet. The temperatures begin to drop after some time step (around 1 to 2 days of operation time).

My time stepping was as: range(0,1[min],15[min]) 30[min] range(1[h], 1[h], 30[d])

Now I will try with power time steps as: 0 2^{range(-1, 1, 22)}

I hope that makes a difference.

--
Tolga
Hello Ivar, Thank you about the "h" variable. Although I don't have convergence issues with the model, I get unrealistic results in average edge probes of the inlet and outlet. The temperatures begin to drop after some time step (around 1 to 2 days of operation time). My time stepping was as: range(0,1[min],15[min]) 30[min] range(1[h], 1[h], 30[d]) Now I will try with power time steps as: 0 2^{range(-1, 1, 22)} I hope that makes a difference. -- Tolga

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jan 30, 2012, 4:34 p.m. EST
Another thing is, does anybody knows why does the solver switches to MUMPS instead of PARDISO? I run this model in a single computer (i7 quad core, 24GB RAM). And COMSOL used to run the very same model using PARDISO solver, but now it is switching to MUMPS although PARDISO is selected in each direct linear solver node.

--
Tolga
Another thing is, does anybody knows why does the solver switches to MUMPS instead of PARDISO? I run this model in a single computer (i7 quad core, 24GB RAM). And COMSOL used to run the very same model using PARDISO solver, but now it is switching to MUMPS although PARDISO is selected in each direct linear solver node. -- Tolga

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Feb 2, 2012, 4:56 p.m. EST
Hi Tolga,

the inlet boundary condition looks fine to me, at this stage i have constant inlet temperature but i should improve it soon.




Hi Tolga, the inlet boundary condition looks fine to me, at this stage i have constant inlet temperature but i should improve it soon.

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.