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

Non-diffusive inflow boundary condition for transport equation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 23, 2016, 07:55
Default Non-diffusive inflow boundary condition for transport equation
  #1
Senior Member
 
Join Date: Oct 2013
Posts: 397
Rep Power: 19
chriss85 will become famous soon enough
I have implemented a boundary condition for the velocity field that acts as an inflow of a gas which I want to track with a transport equation. I don't use different thermophysical properties for it so MULES etc is not needed right now. The transport equation uses the mass fraction Y of the additional gas as primary variable which is solved for. It looks like this:

fvm::ddt(rho,Y)+fvm::div(rho*U,Y)-fvm::laplacian(turb->muEff(), Y)=0

As boundary for Y I'm using fixedValue with uniform 1 as value because the inflow consists purely of this gas. However, this leads to an additional diffusive flux because q = - turb->muEff()*grad(Y) is nonzero. I need to find a way to have a diffusive flux which is zero at the boundary.

Let's look at ways to solve this:
  1. Set diffusivity to zero at the boundary. I have already tested this and it works mostly but not with nonorthogonal cells where some correction schemes apply and the actual diffusivity is mixed with the diffusivity from the first cell layer as far as I can tell.
  2. Set diffusivity to zero at the boundary and in the first cell layer. This should be working at the expense of not having diffusion in the first cell layer. Easy to implement but not fully correct.
  3. Use an explicit scheme for the laplacian and set the flux vector to zero at the boundary. Also easy to implement at the cost of not having an implicit scheme anymore.
  4. Find some way to use different boundary conditions for different terms. No idea if this is possible, but this would be the ideal solution. Does anyone know if this is feasible somehow?
  5. Add an explicit correction term to subtract the diffusive flux again. This will probably have some numerical errors and won't be equal to a diffusive flux of exactly zero at the wall.
  6. Maybe there is some method to correct the flux vector of the laplacian term on the matrix level? Unfortunately my insight in OpenFOAM and the math of FVM is not deep enough to know what to do here.
  7. Further suggestions?
Right now I believe the best solution might be 1 in combination with 5, setting the diffusivity to zero at the boundary and explicitly subtract any flux which arises because of non-orthogonality correction schemes. I have yet to test this though.

I would be happy to have a discussion about this and similar topics.

Edit: I have done some tests with a fixedValue=1 boundary, solving only the transport equation without flow and found that it is best to use an additional explicit corrector term in which the diffusivity is zero everywhere except for the boundary. There is still a very small error but atleast in my case it is negligible (Mass fraction is ~1e-7 at the end of the simulation). Alternatively one could set the diffusivity to nonzero also in the first cell layer but the results at the end of the test are very similar and this stops diffusion between the first and second cell layer. I found it somewhat surprising that it doesn't suffice to set the diffusivity to zero in the first two cell layers to prevent incoming diffusion. If there is any interest I can show a comparison of the results.

Last edited by chriss85; February 24, 2016 at 04:59.
chriss85 is offline   Reply With Quote

Old   May 17, 2016, 11:30
Default non-orthogonal correction at boundary is ignored
  #2
New Member
 
Jianzhi Li
Join Date: Jul 2013
Location: Shanghai, China
Posts: 27
Rep Power: 13
epi_c is on a distinguished road
Send a message via Skype™ to epi_c
Hi @chriss85,

According to Jasak's PhD thesis, the non-orthogonal correction at boundary is ignored (Error Analysis and Estimation for the Finite Volume Method with Applications to Fluid Flows, 3.3.3.1). So I think just set diffusivity to zero at inlet boundary is sufficient.

On the other hand, I don't agree to set diffusivity to zero at inlet boundary. Since you are using convection-diffusion equation to model the transportation and mixing of the specified gas, diffusion is expected everywhere. The only thing you have to take care of is that Y at inlet must greater than Y at the first cell layer (maybe greater than 1 cause unbounded schemes). How do you think?

And, can you post the comparison of the results? Hope you still keep the results.
epi_c is offline   Reply With Quote

Old   May 23, 2016, 04:37
Default
  #3
Senior Member
 
Join Date: Oct 2013
Posts: 397
Rep Power: 19
chriss85 will become famous soon enough
Yes I still have the results luckily, although I actually don't use them now.

The target of this comparison was to find ways to suppress diffusion in a transport equation where the boundary is set to fixedValue 1.
This problem arises when there is an inflow of the transported gas. The convection term of the transport equation requires the fixedValue 1 boundary condition. At the same time one must prevent a diffusion from the wall into the fluid. In my case I couldn't have incoming diffusion when there is no inflow because I was modelling an ablation process where the medium is solid on the other side of the boundary.

The best way proved to be a fully implicit diffusion term plus an implicit diffusion term in which only the cells at the boundary (and possibly
first cell layer) have a nonzero diffusivity.
Attached Images
File Type: jpg results_lin.jpg (89.3 KB, 31 views)
File Type: jpg results_log.jpg (87.7 KB, 25 views)
chriss85 is offline   Reply With Quote

Old   June 8, 2020, 05:43
Default
  #4
New Member
 
Jiang Xiao
Join Date: Jan 2019
Posts: 2
Rep Power: 0
Xiao_Foam is on a distinguished road
The boundary condition which is so called totalFlowRateAdvectiveDiffusive type may can solve your problem, it is used as :
type totalFlowRateAdvectiveDiffusive;
phi phi;
rho rho;
massFluxFraction 1.0;
value uniform 1.0;

actually, it is just change the value of boundary, to insure that boundary value+diffusion =1.0
Xiao_Foam is offline   Reply With Quote

Reply


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
sliding mesh problem in CFX Saima CFX 46 September 11, 2021 08:38
Radiation in semi-transparent media with surface-to-surface model? mpeppels CFX 11 August 22, 2019 08:30
Calculation of the Governing Equations Mihail CFX 7 September 7, 2014 07:27
Question about boundary condition of 2D Burgers equation effort8 Main CFD Forum 0 January 29, 2012 21:55
RPM in Wind Turbine Pankaj CFX 9 November 23, 2009 05:05


All times are GMT -4. The time now is 08:35.