CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   add/removal of grid lines (https://www.cfd-online.com/Forums/main/11852-add-removal-grid-lines.html)

George July 20, 2006 19:17

add/removal of grid lines
 
Hi everybody! I am writing a finite volume code for simulating the flow in an internal combustion engine and I will add or remove grid lines, while the piston moves back and forth. I have started implementing this whole procedure, but I think it would be better to check out also other people thoughts about this. So, can you suggest me any good article which describes the adding or removal of grid lines from a mesh?

Thank you in advance!

William Blake July 21, 2006 03:51

Re: add/removal of grid lines
 
This is probably the 500th reinvention of the wheel. Check

http://www.adapco-online.com

and

http://www.opencfd.co.uk/openfoam/index.html


George July 21, 2006 06:28

Re: add/removal of grid lines
 
Thank you for your response, but this is not what I was looking for. I am trying to find an article, which describes the way others have implemented this addition or removal of grid lines. And in these sites I found some articles, but not any of particular interest.

mar July 21, 2006 08:22

Re: add/removal of grid lines
 
I'm not sure that the best way of simulating the moving piston is adding and removing gridlines.. The problem in doing that lies in the conservativity of the interpolation you are performing.

probably youn can try with a deforming mesh.

Hi

William Blake July 21, 2006 10:22

Re: add/removal of grid lines
 
The combination of deforming mesh and cell layer removal should be ok.

You can download OpenFOAM and inspect the code where it is done. Another option is to use OpenFOAM. So there is probably no need for the reinvention :)

Mani July 21, 2006 14:34

Re: add/removal of grid lines
 
I feel like throwing in a smart-ass comment: What George is asking for are instructions to build (not invent) his own wheel, instead of using somebody else's. Reinvention would require him to re-create the concept of the wheel, and that's impossible, since he's already familiar with the concept. He is just asking for the best method to design one. ;)

George July 21, 2006 19:24

Re: add/removal of grid lines
 
That is true. I have almost implemented this by now, but I would just like to know how others see this whole thing. The method of deforming mesh is a good idea, but I think it gets too complicated. Maybe I will also use this method, we will see, but can you PLEASE suggest me any good article that discusses all these things and describes the way it is being done? Can you say in more details the thing about conservativity of the interpolation?

My opinion is that a researcher should build his own code or develop his own from an existing one, otherwise he or she would not completely understand how this whole CFD thing works and what happens if you change some things. It is very convenient to use others open-source codes, but then you will not have achieved anything. This is quite the difference between an engineer and a technician, the second one uses ready and tested means, while the first one comes up with the ideas.

TG July 22, 2006 09:28

Re: add/removal of grid lines
 
Baloney! Engineers don't go out to reinvent tools that already exist. They try to improve upon what others have done and they use the tools that others create in order to create yet better products. If you are a designing an engine you don't need to write your own CFD code with moving grids in order to design a better cylinder. Your time is better spent building on the works of others and not redoing what's already been done.

Jim_Park July 22, 2006 15:02

Re: add/removal of grid lines
 
If the boss says "get me those numbers" I'll use an appropriate code if I can find one and AFTER I've checked it out. Assuming of course that my slide rule won't do the job.

If he says, "we need to know how to calculate those numbers", I'd really want to study alternatives.

George July 23, 2006 09:25

Re: add/removal of grid lines
 
I agree with what you say, but in order to be able to develop something, you will have to be able to understand how a code works and not just see it as a "black box" with input and output.

mar July 24, 2006 02:12

Re: add/removal of grid lines
 
You can find an example of deforming meshes, but on a problem different from your, in

J.Young, J.C.S. Lai, Oscillation frequency and amplitude e ects on the wake of a plunging airfoil. AIAA JOURNAL 2004 42(10):2042-2052

George July 24, 2006 12:56

Re: add/removal of grid lines
 
I could not find this article, can you please send it to me? Thank you

Boorgloo July 24, 2006 15:12

Re: add/removal of grid lines
 
What is openfoam, does it simulate foam?

I amlooking for a software to simulate fowm flow in piston!!!

Boorgloo


Boorgloo July 24, 2006 15:23

Re: add/removal of grid lines
 
I think what you can do is to have your arrays using complex variable.

U = u_present(cell) + i.u_deleted(cell)

or

U(cell, 2)

then for the cells who are deleted

Re{U} = U(cell,1) = 0. Im{U} = U{cell,2} = velocity

Then when cells are deleted their real part is zero, and the previous values at deletion time are stored in the Imaginary part for later.

The equations are solved using the Real{} part only.

You can also rework the connectivity.

If {there is an imaginary part} then

the neighbour is the neighbour of the cell with imaginary part

endif

what do you think?

Boorgloo.


William Blake July 24, 2006 18:43

Re: add/removal of grid lines
 
Use a search engine like google ...

George July 24, 2006 19:40

Re: add/removal of grid lines
 
For the time being I am just using many different variables for the z-coordinate like z(i,j,k), zpast(i,j,k), zzpast(i,j,k), aaz(i,j,k) and the same for the different variables. Maybe I will try the method with the complex variable. The curiosity that I had was with the interpolation of the variables of the old time step (because at the new time step, the number of grid lines has changed, but the computation of the new flow field hasn't started), when the number of the grid lines changes and this is what I am dealing now. Any thoughts on that?

Hrvoje Jasak July 25, 2006 03:22

Re: add/removal of grid lines
 
Hi,

I understand your frustration and the lack of info you are after. In fact, it is pretty unlikely you will find a decent description in a publication because this is usually termed "not sufficiently scientific for a journal paper". Your best bet is a PhD Thesis from prof. Gosman's group at Imperial College from the SPEED project (mid to late 90s)., but I don't know which one.

If it helps, I am the one who implemented mesh layering and topological changes in OpenFOAM and would be happy to have a chat with you on the subject.

Incidentally, if done correctly, you do not need to re-map the data on layering action: it is a form of mesh motion where cells appear from zero volume and disappear back to zero volume when no longer needed.

Speak to me,

Hrv

Hrvoje Jasak July 25, 2006 03:25

Re: add/removal of grid lines
 
Here's a link to a recent paper from dr. Tommaso Lucchini and (prof?) Gianluca D'Errico at the Politecnico di Milano on in-cylinder engine simulations with moving valves, mesh layering etc in OpenFOAM:

http://www.foamcfd.org/resources/res...ucchDerrOK.pdf

You can also find some presentation slides/results on the same site.

Enjoy,

Hrv

George July 25, 2006 06:33

Re: add/removal of grid lines
 
Thank you for the information! Up to now I have implemented the addition and removal of grid lines and calculated all the x,y,z coordinates from the old time step (with the change of the number of grid lines and not) and from the new time step and I am trying to find the best interpolation method for the variables of the old time step (along with the temporal part of the source, SU). What I am thinking of is, when there is the need to add a grid line, a specific control volume, which is in the middle of the cylinder, I divide it into 2 control volumes, which have the same velocity, temperature, density etc. with the "parent" control volume. Then I have the the new number of grid lines and variables in the old time step and proceed to the new time step. Do you find it correct?

As I have seen, you have written many papers about meshes. It is pleasant to know that there is someone that I can ask some things. Thank you in advance!

Hrvoje Jasak July 25, 2006 06:53

Re: add/removal of grid lines
 
Not like that. What you want ot say is not the you have split the cell into two but that you have introduced a new cell for which the old-time volume was zero and which has inflated to half the volume of the "split cell" during the current time step.

Now execute mesh motion: you will need the old-time volume of the new cell (which is zero) and the volume swept by the newly created face in motion - starting from the position where the new cell volume would be zero to the current position. Because the old-time volume for the new cell is zero, this knocks out the old-time terms (great!) and all you are left with is the mesh motion.

Hope you vcan follow this because I haven't got a really good reference for the FVM on moving meshes. It may be in one of my papers or in the book by Ferziger and Peric. If your Croatian is not too bad, there is a Thesis form my student Zeljko Tukovic who did a lot of moving mesh stuff.

Enjoy,

Hrv


All times are GMT -4. The time now is 18:09.