''matrix dimensions must agree'' in Navier-Stokes models

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

''matrix dimensions must agree'' in Navier-Stokes models

jeccy
Hello!

i have two Navier-Stokes Equations, coupled by the volume force, which is a function of the relative velocity (i.e. Fx = f(u1-u2) and Fy = g(v1-v2)). i receive the error ''matrix dimensions must agree''.
 
However, while i change the force into a constant, or a function of x and y, there is no error anymore.

pressure is constrained at points, suggested by a previous post here.

I appreciate any clue or discussion.

my settings: time dependent solver, MUMPS + Backward Euler

Thanks again!
Reply | Threaded
Open this post in threaded view
|

Re: ''matrix dimensions must agree'' in Navier-Stokes models

Precise Simulation
Administrator
It is very hard to say without any details information about your custom functions. Presumably u1/v1 and u2/v2 in your functions don't have the same dimensions or the output Fx does not have the same dimensions as the input (which is the requirement of custom functions).

For example, in the custom function "function [ result ] = myfun( x, y, t, T )" described in

https://www.featool.com/doc/physics#phys_coef_user

the shape of the result/output array "size(result)" must be the same as "size(x)", "size(y)" ... etc.

Reply | Threaded
Open this post in threaded view
|

Re: ''matrix dimensions must agree'' in Navier-Stokes models

jeccy
Thank you for your efforts and time to my post!
I was aware of the example mentioned, it was very helpful, while I am not very sure if I face the same problem. Because I suppose since u and v in my case are the results the model solved, and Fx is not loaded from other models where mesh or interpolation methods could be different, therefore they might have to be in the same dimension with other variables. Please correct me if I am wrong.  

I attach my model here for your information, since it is a very general model that can be used in others' cases as well. and the logic is elaborated in the following.
two-fluid model

It is a classic two-fluid model, where two phase fluids interpenetrate one another (i.e. smoke in air, suspended particles in water, etc. if someone is interested, i suppose this logic can be extended to 3 phases as well). one of the two fluids is under external force in a certain region. this force will drive this fluid to move. and the relative movement between two fluids will induce the other fluid to move by friction. My interest is the evolution of the concentration of the two phases.

the equations i used are two NS, with one convection-diffusion. therefore there are 7 variables to be solved in total in a 2D geometry: velocities and pressure for each fluid, and the concentration for one of the fluids. The equations are edited accordingly (please refer to my model). one of the main editions is that in the mass conservation, the concentration has to be included, as if each fluid is compressible in each grid.
besides, the two NS are coupled by the stokes drag force. the force is a function of relative velocity (u1-u2 and v1-v2) and concentration phi.

Here come the questions: what might be the variable that is not in the same dimension with others? And can I generate a m. file so that I can check the dimension of each variable in matlab?

Thanks again to everyone that reads here. I wish this is helpful to you.
Reply | Threaded
Open this post in threaded view
|

Re: ''matrix dimensions must agree'' in Navier-Stokes models

Precise Simulation
Administrator
Thank you for reporting. This seems to be due to a combination of multiple flow physics modes without out-flow boundaries with mean integral pressure correction. It should be addressed in the next update.
Reply | Threaded
Open this post in threaded view
|

Re: ''matrix dimensions must agree'' in Navier-Stokes models

jeccy
Thank you for the reply. Looking forward!
I will also update here once there is a solution.