CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

About the influence of the mass source term on the momentum equation and coding

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 16, 2023, 09:02
Default
  #21
New Member
 
DuanYabo
Join Date: Jul 2022
Posts: 16
Rep Power: 3
DuanYB is on a distinguished road
Thank you both for your answers, which really helped me a lot.

Now I know that adding only the mass source term will change the momentum of the system, but it will not change the momentum equation established for solving the problem, right?

Thanks!
DuanYB is offline   Reply With Quote

Old   May 17, 2023, 18:58
Default
  #22
Member
 
Hosein
Join Date: Nov 2011
Location: Germany
Posts: 93
Rep Power: 14
einstein_zee is on a distinguished road
Hi all,

I found this discussion useful! And I checked up on literature a bit and this is my understanding... I think it largely depends on the nature of your source terms you want to consider. Assuming you are dealing with an incompressible flow which means that there are either no density variations or they are very negligible, the continuity equation is the so-called divergence free version. Now adding mass to your system will locally imbalance your continuity which in turn you can consider that by adding an additional term in your continuity equation. So the question is whether you should add another term in momentum conservation or not. And here I think is the point where the nature of your source term matters. If addition of that mass in your system is gonna largely change the density then you should also add another term representing the effect of that added mass on the momentum equation(note that \rho \mathbf{U} is the momentum per unit volume). This way it also contradicts the first assumption of dealing with an incompressible flow! maybe one needs to switch to compressible formulation. On the other hand if addition of that mass has negligible effect on density variations (more compatible with incompressible flow assumption) one may not add an additional source term in momentum equation. Since you mentioned you are using simpleFoam, this means by default you are considering your flow to be incompressible and looking into simpleFoam solver you notice that the continuity equation is not solved directly but rather indirectly through the pressure equation. So in my opinion if the second scenario is of your interest, you should add your source term in pEqn.H and not change UEqn.H at all. As I said this is an assumption you are making that your mass source term will have negligible effects on density hence it could still be considered as incompressible flow. There might be another issue with your source term being explicit which will ruin the diagonal dominance of the resulting system of equations which in that case you may consider an implicit source term to treat that issue. Looking into combustion/reacting solvers in OF will give you a better image on that. hope this helps...
einstein_zee is offline   Reply With Quote

Old   May 19, 2023, 12:05
Default
  #23
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 668
Rep Power: 14
Tobermory will become famous soon enough
Quote:
Assuming you are dealing with an incompressible flow which means that there are either no density variations or they are very negligible, the continuity equation is the so-called divergence free version
But you CAN have a momentum source in an incompressible flow - indeed, it's a common approach for adding in an inlet that is too small to resolve properly with the mesh. In that case, the continuity equation is simply \nabla \cdot U = S, where S is the mass source term. This is totally fine in an incompressible flow - the pressure adjusts accordingly.

The tricky bit is that there is no density equation to solve in the incompressible solver, and so there is no simple way of dropping in the mass source. Instead, you need to add the source term into the pressure-corrector expression, which clearly can't be done using an fvOptions source term ... you have to play with the pEqn instead.

As regards the momentum equation - we are agreed - you can add mass without momentum, i.e. do not need to add any compensating source term in the momentum equation ... but you need to be aware that, by doing this, you will dilute the momentum in the rest of the flow and that adding mass with no momentum is often unphysical. The impact that this has on the conditions in the domain depends on your boundary conditions (constant pressure, constant velocity etc).
Tobermory is offline   Reply With Quote

Old   May 21, 2023, 04:13
Default
  #24
New Member
 
DuanYabo
Join Date: Jul 2022
Posts: 16
Rep Power: 3
DuanYB is on a distinguished road
Hi Tobermory, Hosein and Zeinab:

After so many days of discussion with you and consulting relevant literature, I have gained a new understanding of this issue. Now please point out the mistakes in my understanding.

All my current references are sourced from Moukalled's books. Due to the lack or rarity of similar problems in real life, it is difficult to solve them.

Firstly, according to Reynolds transport theory, it can be inferred that

\left ( \frac{dm}{dt}  \right ) _{MV} =\int_{V}^{} \left [\frac{D\rho }{Dt} +\rho \nabla \cdot \mathbf{\mathit{v} }   \right ]  dV=\frac{S}{V}  \qquad  (1)

Equation 1 is the derivation process of the continuity equation,where S is the mass source term, MV the material volume.

So the momentum equation should be

\left ( \frac{dmv }{dt}  \right ) _{MV}=\int_{V}^{}\left [\frac{\partial }{\partial t }\left [ \rho v \right ]  +\nabla \cdot \left \{ \rho vv \right \}-f \right ]  dV =\frac{S}{V} v+m\frac{\partial v}{\partial t}   \qquad (2)

Because I am solving incompressible, steady, and inviscid problems, equations (1) and (2) are integrated and simplified

\nabla \cdot v =S  \qquad (3)
\nabla \cdot \left \{vv \right \}=Sv-\nabla p \qquad (4)

I'm not sure if the formula we pushed is correct. Could you please help me take a look. If there are any errors, please help me point them out.
Thanks very much
Quote:
Originally Posted by Zena27 View Post
Zeinab
,
Quote:
Originally Posted by Tobermory View Post
Tobermory
, and
Quote:
Originally Posted by einstein_zee View Post
Hosein
.
Attached Images
File Type: png 1684654229057.png (13.7 KB, 6 views)
DuanYB is offline   Reply With Quote

Old   October 19, 2023, 23:47
Post
  #25
New Member
 
DuanYabo
Join Date: Jul 2022
Posts: 16
Rep Power: 3
DuanYB is on a distinguished road
Now my teacher believes that my derivation is incorrect (even though I have already obtained good results using the above formula). He believes that d (mv)/d (t) in the momentum equation should be equal to the force acting on the control body.
The main basis is that if the momentum equation I derived is written in a non-conservative form, the v * div (v) on the left hand side exactly offsets the S * v on the right hand side, which is too coincidental. So he thinks that my momentum equation has two forms of the same thing on the left and right sides, which is incorrect.
So I am currently searching for new literature to see if there are other methods to derive the correct momentum equation.
Additionally, if only the continuity equation is modified without modifying the momentum equation, the program will report an error.
DuanYB is offline   Reply With Quote

Old   October 20, 2023, 06:54
Default
  #26
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 668
Rep Power: 14
Tobermory will become famous soon enough
Your teacher is right ... you have just proved in effect that 1=1.

I am not sure what your overall aim is, but if you want to derive a conservation expression for momentum, then just look in a basic Fluid Mechanics book and you will find a simple expression of Newton's 2nd law: force is the rate of change of momentum, e.g.:
\rho  \frac{D U_i}{D t} = \frac{\partial \sigma_{ij}}{\partial x_j} + B_i
where \sigma_{ij} is the Cauchy stress tensor (you can expand this out in terms of the normal and shear stresses) and B_i is the body force. This should be your starting point rather than the continuity equation.

If you want to add source terms to the equations, then there is a mass source term in the continuity equation, and a separate and unrelated momentum source in the momentum equation. Note that it is perfectly possible to inject mass into a domain with no momentum. You have to decide, when injecting the source mass, what momentum you want to give it.

Hopefully you are clearer now ...
Tobermory is offline   Reply With Quote

Old   October 20, 2023, 08:08
Default
  #27
New Member
 
DuanYabo
Join Date: Jul 2022
Posts: 16
Rep Power: 3
DuanYB is on a distinguished road
Thank you for your reply again and for following my question.

Can I assume that the momentum source term in my question is caused by increasing mass? To calculate the momentum source term,do you think my following ideas are correct?

The premise of your above formula is that the mass in the material volume remains constant during dt time (which is also the meaning of dm/dt=0 in the continuity equation). For the momentum equation,
d(mv)/dt=m * dv/dt+v * dm/dt.
Due to the fact that for the vast majority of real-world problems, dm/dt=0, d (mv)/dt=ma=F (F refers to the pressure and body force in your formula).

But in my problem, the quality is constantly increasing, i.e., dm/dt=S0. So in the momentum equation, the added momentum source term is (delta m) * v, right? (My question is not a practical one, it is an equivalent substitution to solve problems in other subject, but it is very important and involves whether I can graduate with a PhD.)

Please help me check it again, as I believe this explanation is correct.

THANKS THANKS THANKS !!!
DuanYB is offline   Reply With Quote

Old   October 20, 2023, 11:06
Default
  #28
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 668
Rep Power: 14
Tobermory will become famous soon enough
Quote:
Originally Posted by DuanYB View Post
But in my problem, the quality is constantly increasing, i.e., dm/dt=S0. So in the momentum equation, the added momentum source term is (delta m) * v, right?
No. I think you are tying yourself up in the logic, confusing the cause for the effect. Let's go back to the equations ... and write the for a control volume and not a mass system, i.e. consider partial differentials, since the functions are functions of space and time. Your continuity and momentum equations are (assuming constant density, steady state, inviscid flow):
\frac{\rho_0 \partial U_j}{\partial x_j} = S_{mass}

\frac{\partial \rho_0 U_i U_j}{\partial x_j} = -\frac{\partial p}{\partial x_i} + S_{mom}

i.e.

\rho_0 U_i S_{mass} + \rho_0 U_j \frac{\partial U_i}{\partial x_j} =  
- \frac{\partial p}{\partial x_i}
+ S_{mom}

Now the first term (what you have called delta m . U) is the expression of the effect of adding the mass in the continuity equation ... but it is not itself a source term (i.e. it is not itself adding momentum). The momentum change comes from the force term and the S_mom term.

I think that you get more understanding from leaving the momentum equation in its conservative form, integrating over the control volume and using the Gauss divergence theorem to get:

\int_V{\frac{\partial \rho_0 U_i U_j}{\partial x_j}}dV = 
-\int_V{\frac{\partial p}{\partial x_i}}.dV + \int_V{S_{mom}}.dV

in other words
\sum_f{\phi_f U_{i,f}} = -\sum_f{p S_{fi}}  + S_{mom}. V_p

where the sums are over all the faces f of the control volume, \phi_f is the face mass flux and S_{fi} is the projection of the face area in the i direction. As per one of my earlier posts, in a steady incompressible flow, like the one you are considering, the flow adjusts instantaneously to any changes and so the impact of a mass and momentum injection depends entirely on your boundary conditions - i.e. on what you do with velocity and pressure at the boundaries. The velocity and pressure in the field then react accordingly.
Tobermory is offline   Reply With Quote

Old   October 21, 2023, 03:10
Default
  #29
New Member
 
DuanYabo
Join Date: Jul 2022
Posts: 16
Rep Power: 3
DuanYB is on a distinguished road
Thank you again for your answer, which made me a lot clearer.

So back to the initial question. The mass source term has no effect on the form of the momentum equation (at least in a conserved form), as the mass source term appears in div(ρUU) term, right?

Additionally, does the momentum source term depend on the boundary conditions ? In this way, there should be no momentum source term in my problem. My problem only has two boundary, i.e., inlet and outlet. On the inlet, set U fixed value and p zerogradient; on the outlet, set U zerogradient and p fixed value.

But I tried to modify only the continuity equation in simpleFoam, and this program always reported an error when solving U in the Time=2 step. It's a strange phenomenon, I'll delve deeper into it.

If you know any helpful information for me, please reply to me. Thanks, thanks, thanks!!!
DuanYB is offline   Reply With Quote

Reply

Tags
equation construction, mass source term, openfoam, simplefoam, source term


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Expanding an Implicit Scalar Source term to a Vector or Tensor ScalarVectorTensor OpenFOAM Running, Solving & CFD 1 October 18, 2023 02:31
Solve poisson equation just add a source term nandiganavishal OpenFOAM Running, Solving & CFD 18 November 14, 2022 09:12
Adding two terms in the momentum equation in in chtMultiRegionSimpleFoam zahraa OpenFOAM Pre-Processing 0 June 13, 2015 12:42
Mass flow rate boundary condition for continuity equation for oscillating flow p07ip705 Main CFD Forum 0 February 28, 2013 01:33
FEM fortran codes for coupled mass momentum energy Amit Main CFD Forum 1 May 17, 2005 20:38


All times are GMT -4. The time now is 06:28.