CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Finite volume methods

Register Blogs Community New Posts Updated Threads Search

Like Tree19Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 15, 2023, 04:13
Default
  #141
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,831
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by hunt_mat View Post
1) Correct. The flux for the conservation of mass involves u only.
2) Essentially, the first cell is at dh/2.
3) There is a diffusion equation for the velocity. The negative velocity is diffused in at h=1.
4) Yes.





So, you confirm that x=0 is a face location, not a cell-centre location.
How do you compute (in both equations) the diffusive fluxes at x=0?
FMDenaro is offline   Reply With Quote

Old   September 15, 2023, 05:20
Default
  #142
Senior Member
 
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 178
Rep Power: 4
hunt_mat is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
So, you confirm that x=0 is a face location, not a cell-centre location.
How do you compute (in both equations) the diffusive fluxes at x=0?
The flux for the mass equation, the fluxes are just the velocity, and that's 0 at x=0. For the momentum, I use the same gradient from 0 to dx/2, as I do from dx/2 to 3dx/2.
hunt_mat is offline   Reply With Quote

Old   September 15, 2023, 05:53
Default
  #143
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,831
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by hunt_mat View Post
The flux for the mass equation, the fluxes are just the velocity, and that's 0 at x=0. For the momentum, I use the same gradient from 0 to dx/2, as I do from dx/2 to 3dx/2.
But at x=0 how is the formula for the diffusive flux?
FMDenaro is offline   Reply With Quote

Old   September 15, 2023, 06:04
Default
  #144
Senior Member
 
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 178
Rep Power: 4
hunt_mat is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
But at x=0 how is the formula for the diffusive flux?
I use the same value for the derivative at h=dh/2.
hunt_mat is offline   Reply With Quote

Old   September 15, 2023, 06:07
Default
  #145
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,831
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by hunt_mat View Post
I use the same value for the derivative at h=dh/2.
But you do not have the same computational stencil at x=0 since you have no longer nodes at x<0.
FMDenaro is offline   Reply With Quote

Old   September 18, 2023, 06:54
Default
  #146
Senior Member
 
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 178
Rep Power: 4
hunt_mat is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
But you do not have the same computational stencil at x=0 since you have no longer nodes at x<0.
At the first cell, I compute the derivative in the cell centre and I use that for the edge.
hunt_mat is offline   Reply With Quote

Old   September 18, 2023, 07:22
Default
  #147
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,831
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by hunt_mat View Post
At the first cell, I compute the derivative in the cell centre and I use that for the edge.
But how do you compute that? Do you introduce the bc value this way?
Expand explicitly the scheme in the first cell.
FMDenaro is offline   Reply With Quote

Old   September 18, 2023, 08:34
Default
  #148
Senior Member
 
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 178
Rep Power: 4
hunt_mat is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
But how do you compute that? Do you introduce the bc value this way?
Expand explicitly the scheme in the first cell.
I compute the derivative as:
\frac{\partial u}{\partial h}\approx\frac{u_{2}-u_{1}}{\frac{1}{2}(\delta h_{1}+\delta h_{2})}
hunt_mat is offline   Reply With Quote

Old   September 18, 2023, 09:20
Default
  #149
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,831
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by hunt_mat View Post
I compute the derivative as:
\frac{\partial u}{\partial h}\approx\frac{u_{2}-u_{1}}{\frac{1}{2}(\delta h_{1}+\delta h_{2})}
1 and 2 are the centers of the FV?
I am not sure what you did but if I assume that rhe node i=1 is at x=h/2, the face x=0 has a first order accurate derivative given by

du/dx=u1/(h/2)

since u=0 at x=0
FMDenaro is offline   Reply With Quote

Old   September 18, 2023, 10:17
Default
  #150
Senior Member
 
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 178
Rep Power: 4
hunt_mat is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
1 and 2 are the centers of the FV?
I am not sure what you did but if I assume that rhe node i=1 is at x=h/2, the face x=0 has a first order accurate derivative given by

du/dx=u1/(h/2)

since u=0 at x=0
The 1 and 2 are at the cell centres and the node at i=1 is at dh_1/2. The equation you provided does not solve the problem I mentioned.
hunt_mat is offline   Reply With Quote

Old   September 18, 2023, 11:04
Default
  #151
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,831
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by hunt_mat View Post
The 1 and 2 are at the cell centres and the node at i=1 is at dh_1/2. The equation you provided does not solve the problem I mentioned.
However, your previous formula is wrong for the flux at x=0.
What if you set to zero the diffusive flux at x=0? I suspect that u=0 as BC is not congruent. Physically you will have an increasing of the kinetic energy in the domain.
FMDenaro is offline   Reply With Quote

Old   September 18, 2023, 11:44
Default
  #152
Senior Member
 
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 178
Rep Power: 4
hunt_mat is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
However, your previous formula is wrong for the flux at x=0.
What if you set to zero the diffusive flux at x=0? I suspect that u=0 as BC is not congruent. Physically you will have an increasing of the kinetic energy in the domain.
So that means I have two boundary conditions at h=0. Won't this be unstable?
hunt_mat is offline   Reply With Quote

Old   September 18, 2023, 11:56
Default
  #153
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,831
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by hunt_mat View Post
So that means I have two boundary conditions at h=0. Won't this be unstable?



From a mathematical point, you have two equations, each one has its suitable BC depending on the mathematical classification.


From a physical point of view, I see that you let mass entering for the right side (u is negative), that means you have also kinetic energy (rho*u^2/2) increasing into the domain. If u=0 at the left side, there is no mass leaving the domain, right?
FMDenaro is offline   Reply With Quote

Old   September 18, 2023, 12:04
Default
  #154
Senior Member
 
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 178
Rep Power: 4
hunt_mat is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
From a mathematical point, you have two equations, each one has its suitable BC depending on the mathematical classification.


From a physical point of view, I see that you let mass entering for the right side (u is negative), that means you have also kinetic energy (rho*u^2/2) increasing into the domain. If u=0 at the left side, there is no mass leaving the domain, right?
Wrong in both cases. The mass of the system is constant. What I allow at h=1, is the stress free condition which allows the movement of the boundary.
hunt_mat is offline   Reply With Quote

Old   September 18, 2023, 12:25
Default
  #155
Senior Member
 
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 178
Rep Power: 4
hunt_mat is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
From a mathematical point, you have two equations, each one has its suitable BC depending on the mathematical classification.


From a physical point of view, I see that you let mass entering for the right side (u is negative), that means you have also kinetic energy (rho*u^2/2) increasing into the domain. If u=0 at the left side, there is no mass leaving the domain, right?
I put in zero flux at h=0, and I still get change.
hunt_mat is offline   Reply With Quote

Old   September 18, 2023, 12:29
Default
  #156
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,831
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by hunt_mat View Post
Wrong in both cases. The mass of the system is constant. What I allow at h=1, is the stress free condition which allows the movement of the boundary.
I never worked on this kind of problem, but that seems just like a piston moving in the negative direction in a closed system and compressing the flow. At a certain point compression should stop, you cannot have a constant mass in a volume going to zero.
What should be the difference from the classic gasdynamics problem for the simple wave case as shown in Zucrow?
FMDenaro is offline   Reply With Quote

Old   September 18, 2023, 12:31
Default
  #157
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,831
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by hunt_mat View Post
I put in zero flux at h=0, and I still get change.
Could you show the plots of your solution at several time instants?
FMDenaro is offline   Reply With Quote

Old   September 18, 2023, 16:09
Default
  #158
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,735
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
Do you set gradients or fluxes to 0 at x=0?

du/dx=0 is setting the boundary/face gradient to 0 which will constrain both the advective and diffusive flux.

You optionally can set the convective and diffusive fluxes individually to zero. This is the better way to go for FVM since FVM calls explicitly for face fluxes and not face gradients. But to answer your previous question, setting diffusive fluxes to zero does not give you too many constraints, it should have been one of the original constraints in the problem definition.
LuckyTran is offline   Reply With Quote

Old   September 19, 2023, 06:32
Default
  #159
Senior Member
 
Matthew
Join Date: Mar 2022
Location: United Kingdom
Posts: 178
Rep Power: 4
hunt_mat is on a distinguished road
Quote:
Originally Posted by LuckyTran View Post
Do you set gradients or fluxes to 0 at x=0?

du/dx=0 is setting the boundary/face gradient to 0 which will constrain both the advective and diffusive flux.

You optionally can set the convective and diffusive fluxes individually to zero. This is the better way to go for FVM since FVM calls explicitly for face fluxes and not face gradients. But to answer your previous question, setting diffusive fluxes to zero does not give you too many constraints, it should have been one of the original constraints in the problem definition.
I'm using a Lagrangian formalism, so I have no advective diffusion. I set the flux at h=0 to be zero, but I still have the same issue.
hunt_mat is offline   Reply With Quote

Old   September 19, 2023, 08:53
Default
  #160
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,735
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
Oh sorry, that's right you have only a diffusive flux in the lagrangian formulation. Now just keep in mind that you can set the flux to 0 without invoking any differencing scheme. This is the way.


The other way is to set the du/dx to zero and then interpolate it onto the face flux. This way introduces discretization errors and inconsistencies.
LuckyTran is offline   Reply With Quote

Reply

Tags
finite volume method


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
multiphaseEulerFoam FOAM FATAL IO ERROR qutadah.r OpenFOAM Running, Solving & CFD 11 December 10, 2021 20:18
SU2 7.0.7 Built on CentOS 7, parallel computation pyscript mpi exit error? EternalSeekerX SU2 3 October 9, 2020 18:28
Problem of simulating of small droplet with radius of 2mm liguifan OpenFOAM Running, Solving & CFD 5 June 3, 2014 02:53
Gradient evaluation in Finite Volume Methods yidongxia Main CFD Forum 7 August 6, 2012 10:23
Unstructured grid finite volume methods Marcus Main CFD Forum 3 December 5, 2000 00:25


All times are GMT -4. The time now is 15:56.