CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Phoenics (http://www.cfd-online.com/Forums/phoenics/)
-   -   accessing the source and sink per cell in patchs (http://www.cfd-online.com/Forums/phoenics/52321-accessing-source-sink-per-cell-patchs.html)

Noel February 28, 2009 12:32

accessing the source and sink per cell in patchs
 
Dear all, In the result file under the whole-field residuals, we can find the description of source, sinks & the nett sum of each PHI variables in their associated patchs.

As opposed to the result file which only shows the total source and sink over the whole cells of each patch, I need the value of source and sink in each cell of the Patch.

Are they stored in specific variable and is there any straightforward way in the GROUND station to access these values ?

Best Regards, Noel

Alex March 2, 2009 07:21

Re: accessing the source and sink per cell in patc
 
Dear Noel As far as I know, the values of source is obtain by numerical integration of transport properties at the boundaries or patch as used by PHOENICS. If you are solving the contunuity, momentum and energy equations, the values of the source refers to the overall mass flowing the patch and the corresponding overall momentum component, and the total energy. If I understood it correctly, the net source implies as if the values for mass balance, integral momentum theorem, and energy balance respectively for the whole solution domain. These mean the net source is not stored in the phi files, but was separately calculated in EARTH

As we are solving the problems iteratively, it is difficult to get zero net source for mass, momentum and energy balance. Convergence of the solution can be justified if the magnitude of the convergence criteria and the net transport properties balance is relatively small. More simplified explaination should be given in the PHOENICS documentation. Hope someone can correct me if I am wrong

Noel March 2, 2009 08:04

Re: accessing the source and sink per cell in patc
 
Alex, thank's for the reply.

If the source and sinks are separately calculated in EARTH, is there any way to retrieve these values using Main.for or Ground.for ?

Regards, Noel


mike March 3, 2009 07:07

Re: accessing the source and sink per cell in patc
 
You can call subroutine GETSOR from Group 19 Section 7 of GROUND (each of sweep section). The syntax is :

CALL GETSOR('patch name',variable index,net source)

So, CALL GETSOR('INLET',P1,GMASFR) will return the mass inflow rate via GMASFR for the patch named 'INLET'.


mike March 3, 2009 07:18

Re: accessing the source and sink per cell in patc
 
As mentioned in the other posting, the total source/sink can be retrieved via Subroutine GETSOR. Printout of the cell-wise sources/sinks can be obtained by means of the PHOENICS debug facilities. If you need to access the cell-wise sources directly in GROUND, this is best done by means of re-construction, and Subroutine GETCOV may be useful in this regard. The syntax is : GETCOV(NAME,PHI,CO,VAL), which returns the coefficient and value for the specified patch and variable name.

Noel March 3, 2009 11:36

Re: accessing the source and sink per cell in patc
 
Thank's a lot, Mike ! I just tried the Getcov Subroutine in Group 19 Section 7 of GROUND (Finish of sweep) to retrieve the value of CO and VAL, yet it only returns a scalar value (not in array) though the Getcov argument is an array.

I define my patch over 5 cells and set the CO and VAL in Group 13 of GROUND. So the CO and VAL should be an array of 5 elements. Is there any trick to get the array ?

Regards, Noel


mike March 3, 2009 11:48

Re: accessing the source and sink per cell in patc
 
GETCOV is not intended to access an array of CO and VAL values, only scalar values of CO and VAL.

I now realise I don't understand what you are trying to do. If CO and VAL are defined by you in Group 13 of GROUND, then you already have an array of values for CO and VAL, and so it should be trivial to re-construct the source/sink term, i.e. For example, S = CO*T*(VAL-Phi,p) for a non-mass-flow source.

Noel March 3, 2009 12:14

Re: accessing the source and sink per cell in patc
 
I indeed try to reconstruct S = CO*T*(VAL-Phi,p) using the convergent Phi,p. I just don't know how to get the value of CO and VAL of every patch and variable in the Group 19 (I only want to reconstruct them after it converges).

In the Group 13, the IF(NPATCH.EQ.'Patch') and IF(INDVAR.EQ. PHI) are used to get access to the corresponding CO and VAL and also the corresponding IXF, IXL, IYF and IYL.

I suppose we can't use IF(NPATCH.EQ.'Patch') and IF(INDVAR.EQ. PHI) in the Group 19 to get the corresponding L0F(CO), L0F(VAL), IXF, IXL, IYF and IYL cause they are sent by EARTH (just like the variable ISC and IGR).

Regards, Noel

Alex March 3, 2009 20:22

Re: accessing the source and sink per cell in patc
 
Dear Noel

I have one simple bad trick. It is not a good trick however. You can use the q1 file and give the name of the patch using the do loop.

regards

mike March 4, 2009 05:39

Re: accessing the source and sink per cell in patc
 
CO and VAL are refreshed for every variable after the residual errors are computed in EARTH on exit from Group 13 of GROUND (PHOENICS solves the finite-volume equations in correction form). Therefore, these are variables are not available in Group 19.

If S = CO*T*(VAL-Phi,p)is computed in Group 13, then this will correspond to the converged solution after a sufficient number of sweeps.

Noel March 4, 2009 07:09

Re: accessing the source and sink per cell in patc
 
Hi Mike, thank's for the suggestion.

I have COVAL of some PHI variables in the same patch, whose coefficient and values are set in the GROUND. In which section of Group 13 should I compute S = CO*T*(VAL-Phi,p) ?

Suppose I do it in Section 1 (the setting of CO), how can I obtain the corresponding VAL (knowing that VAL are also refreshed for every variable) ? If I am updating the CO of a PHI-X, the last updated VAL might belong to another PHI (I have no idea of the order of GROUND call from the EARTH).

Or do I have to store the VAL of every variable in another common array so that I can access them anytime in the Section 1 ?

Regards, Noel


mike March 4, 2009 10:03

Re: accessing the source and sink per cell in patc
 
For each IZ slab, Group 13 is visited for each variable in turn, first for CO, and then for VAL. I seem to recall that you can GET the CO while in the VAL section. If not, you can store the CO in the Co section, or alternatively, re-generate it in the VAL section. Then compute S in the VAL section.

Alex March 6, 2009 08:32

Re: accessing the source and sink per cell in patc
 
It seem that there is not much people interested to know more about the trick that I have mentioned.

The trick will produce the mass flow rate and its direction for each cell (for R1 -single fass) and surface forces (the sheat stress), heat transfer rate for wall, the entering enthalphy. It seem the discussion become so complex and the trick is good for beginners. You can check the results by comparing with the ground coding performed using PLANT by acquiring the values at the near wall cell.

maher9149 March 24, 2009 05:45

viscosité turbulent
 
dear mike : can you tell me the steps that I can do to change the formula for turbulent viscosity in the software Phoenics. or how I can use another formula to calculate.

maher9149 April 3, 2009 06:07

turbulent viscosity
 
hi if you how I can change the formula for turbulent viscosity in the software Phoenics. I want to write vt = (c * k / e) * f (k, e)

sulabh gupta July 10, 2010 01:45

Heat transfer coeffient
 
Hi mike plz help me i just want to know how to calculate the values of T cell in the formula Q=co(Tval-Tcell) over a geometry and what does it mean can we use it anywhere or any kind of geaometry wheter it is linear or pipe etc??


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