- **OpenFOAM Running, Solving & CFD**
(*http://www.cfd-online.com/Forums/openfoam-solving/*)

- - **Calculation of phi if velocity field is known**
(*http://www.cfd-online.com/Forums/openfoam-solving/59974-calculation-phi-if-velocity-field-known.html*)

Hello,
I have a quick questHello,
I have a quick question on the calculation of 'phi' - I am using a modified channelOodles solver. I have two mesh regions in my domain. I am solving for the flow in first mesh region. I want to solve for the transport of a scalar in my second mesh region, where I would like to have the same phi field as that of mesh 1. Is it okay to just copy the velocity field from region 1 to region 2 (for some reasons I can't copy the phi field directly) and calculate phi2 as follows: phi2 = (fvc::interpolate(U2) & mesh2.Sf()); Please comment on my approach !! Thanks! Regards, Ankur |

Pretty bad. If you want to sePretty bad. If you want to see how bad it is, check the mass conservation on your second mesh.
You have to do much better than this, otherwise you will have boundedness problems in the scalar transport. Hrv |

Hello Hrv,
Could you pleaseHello Hrv,
Could you please suggest me something (to copy velocity field from mesh 1 to mesh 2) with which I can get accurate answers while solving for scalar transport ?? Thanks! Regards, Ankur |

Yes I can. In order to get coYes I can. In order to get conservative fluxes you will need to solve the pressure equation again on the new mesh - there is no other way of ensuring mass conservation.
On balance, I would say you are (much) better off solving the scalar transport on the same mesh. However, if you have no choice, have a look at my Thesis and you will find the details. There, I was doing adaptive mesh refinement (in FOAM, of course!) and show how to interpolate the components and solve the pressure equation to get mass conservation. Enjoy, Hrv |

Hello Hrv,
Thanks for the rHello Hrv,
Thanks for the reply. Here, I would like to mention something that I think I should have said before. Mesh 2 in my case is exactly twice of mesh 1 (Mesh 1 is a channel, mesh 2 is also a channel. Length of channel 2 is twice that of channel 1. Consider channel 2 to be of two parts - each part exactly equivalent to channel 1). My streamwise BC is periodic for channel 1, so basically I can just copy the velocity field of channel 1 to the two-parts of channel 2. So, if I am using the converged velocity field of channel 1 to get phi for channel 2, would I still have some mass conservation issues while solving scalar transport for mesh 2 ?? Regards, Ankur |

You cannot copy the cell centrYou cannot copy the cell centre velocity and interpolate it because you will have a mass conservation error. If the two meshes match exactly, you could find face correspondence between the two meshes (they basically need to be identical) and map that. In all other cases, you need to solve the pressure equation.
In any case, do whatever you think is good, calculate the flux divergence in each cell and compare it with the divergence of fluxes on the first mesh. That will tell you how wel you are doing - if the fluxes are not conservative, you will have trouble with scalar transport. Hrv |

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