CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > CFX

Find neighbouring cells by CEL expression

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By ghorrocks

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 29, 2020, 07:22
Smile Find neighbouring cells by CEL expression
  #1
New Member
 
Chris
Join Date: Jun 2017
Posts: 7
Rep Power: 8
cfdcar is on a distinguished road
Hello everybody,

i want to model the following :

If one cell exceeds a certain threshold, I want to insert to all adjacent cells a source term.

Do you know if that is possible with the use of CEL?

or do you have any suggestions how I could solve my problem ?
Is an additional flux through the cell wall an option in CFX?

thank you very much in advance
cfdcar is offline   Reply With Quote

Old   November 29, 2020, 16:52
Default
  #2
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
There is no simple way of doing exactly what you want.

But you might come close enough if you define an additional variable as a diffusive variable, then apply a source term to that variable based on your "certain threshold". The variable will then diffuse into adjacent cells and you can use some sort of threshold to pick that up. But this is relying on you to tune the diffusion to be equivalent to a cell thickness.

What do you mean by "flux through to cell wall option"? CFX has some variables like this, but I have no idea what you are trying to do or why you are trying to do it, so I cannot say if they are relevant.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Old   November 29, 2020, 17:55
Default
  #3
New Member
 
Chris
Join Date: Jun 2017
Posts: 7
Rep Power: 8
cfdcar is on a distinguished road
Thanks for your answer.
I already had the idea with the diffusive variable. Unfortunately, it doesn't work like that, because the cells are not the same size everywhere. And I did not find the right settings for the diffusion coefficient , so that really only the adjacent cells are targeted.
The additional diffusive variable is not reset after each time step and thus spreads further and further in the domain from the initial cell exceeding the threshold. Therefore I cannot formulate a threshold for the diffusive variable that only contains the adjacent cells.
I'm sorry I didn't write this in my first post that I have tried something like this already.

By "flux through the cell wall option" I mean that in CFX it might be possible to transmit an additional variable normal to one cell wall into the next cell.
I don't know if such a thing is possible but my understanding of the Fine Volume Method is that fluxes at the surfaces of each finite volume are calculated. If i could define fluxes just into the adjacent cells i dont need the source term in these cells

What variables do you mean? Maybe I can take a closer look at them.

And do you have maybe other ideas?
Some more information about my case will probably help you:
I have a diffusive additional variable with a very low diffusion coefficient to model a concentration of solids that stick to the wall over time. These are created by a positive flux on the wall boundary condition. If cells on the wall exceed a certain concentration, solids should also be deposited in the neighbouring cells. I want to achieve this with a source term in the neighbouring cells.
cfdcar is offline   Reply With Quote

Old   November 29, 2020, 23:48
Default
  #4
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
You should not try to model a process at such a low level. Any approach where you try to model progress cell by cell is bound to have problems with mesh independence, convergence and physical realism.

Also, CFX does not give you easy access to adjacent element arrays. So what you are proposing is really hard to do.

CFX is a partial differential solver, so you should express models like this as partial differential equations. Then effects like growth, motion and diffusion can be modelled using normal source, convection and diffusion terms.

For example, your comment "If cells on the wall exceed a certain concentration, solids should also be deposited in the neighbouring cells" is particularly troubling. This sounds like a diffusion process, and if it is it should be modelled using a diffusive variable.

Can you explain what you are doing in more detail? What are the solids sticking to the surface? What controls whether it sticks or not? How does it spread to the neighbouring areas? What makes it turn from a diffusive material to stationary, "stuck", non-diffusive material?
Opaque likes this.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Old   November 30, 2020, 04:15
Default
  #5
New Member
 
Chris
Join Date: Jun 2017
Posts: 7
Rep Power: 8
cfdcar is on a distinguished road
Thank you for your quick reply.
When you say there is no “easy access to adjacent element arrays” can you tell me the non-easy way ?
Probably only with Fortran programming, right?

Here are some more details about my case:

I simulate blood with various components, such as platelets, ADP and other biochemical substances. All these components are dissolved in blood and are modelled by convection-diffusion equations with additional variables. Interactions with each other, i.e. conversions from one biochemical substance to another are realised by positive and negative source terms. These are dependent on various parameters, e.g. shear stress or concentrations of other biochemical substances.

I would also like to introduce a variable that behaves according to the following equation:

\frac{\partial C}{\partial t} = S

Where C is the concentration and S is a source term, which is dependent on shear stress etc.
This equation should represent the concentration of platelets that attach to the wall and "grow" from there into the domain.
So far I have done this with a diffusive additional variable with a very very small diffusion coefficient(almost zerol). In order to get from this equation out of the CFX-Solver Therory guide (1.6.2. Diffusive Transport Equations for Additional Variables):

\frac{\partial \rho \varphi }{\partial t} =  \nabla (\rho D_{\varphi} \nabla \varphi)  + S_{\varphi}

to a equation that looks like this:

\frac{\partial \rho \varphi }{\partial t} =   S_{\varphi}

Is there another way to do this ?

The equation is initialised with zero at the beginning and the concentration builds up over time by a flux from the wall boundary condition. (There is a maximum concentration value and when this value is reached the flux is zero)
If the concentration in a cell is exceeding a specific threshold, i want to define a source term in the adjacent cells to account for the "growth into the domain".

In a next step I would also like to introduce a brinkman term to the momentum equation in the region of high concentrations of this additional variable. But first i need to solve the "growth into the domain" behavior
cfdcar is offline   Reply With Quote

Old   November 30, 2020, 04:31
Default
  #6
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
The non-easy way (ie, the only way I can think of to do what you are directly asking for) is by user fortran and accessing the adjacent element matrix in the MMS. I have no idea how to do this, other than knowing where to look and that with a LOT of work it can probably be done. Good luck if you decide to give it a go (you will need it)

This is a bit wacky, but have a look at the wall film model. It has some similarities with what you are trying to do and it might give you some ideas.

Another wacky idea is to do it as a multiphase model. When you reach your threshold you use a source term to generate some second phase stuff (it would have to be a fluid, so use a crazy high viscosity to stop it moving much), and the multiphase model will automatically handle if you generate enough second phase stuff that it spills over into adjacent elements.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Reply

Tags
adjacent cell, cel expression, cfx


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
[snappyHexMesh] SnappyHexMesh running killed! Mark JIN OpenFOAM Meshing & Mesh Conversion 7 June 14, 2022 01:37
How to use variable value in CEL expression correctly. Goenitz CFX 2 September 16, 2019 10:44
CEL expression in CFX pre Jane92 Main CFD Forum 1 June 3, 2016 02:48
Is there a limit for CEL expression length? fml2 CFX 2 March 27, 2012 02:20
CGNS lib and Fortran compiler manaliac Main CFD Forum 2 November 29, 2010 06:25


All times are GMT -4. The time now is 14:01.