CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Using snGard (T) on coupled patch for conjugateHeatFoam solver!!! (https://www.cfd-online.com/Forums/openfoam/88285-using-sngard-t-coupled-patch-conjugateheatfoam-solver.html)

kamkari May 12, 2011 18:20

Using snGard (T) on coupled patch for conjugateHeatFoam solver!!!
 
Hi
I am using conjugate heat foam and I tried to calculate wall temperature gradient on the coupled patch using snGrad().
label patchi = mesh.boundaryMesh().findPatchID("right");
gradT.boundaryField()[patchi]=T.boundaryField()[patchi].snGrad();
The case is two adjacent cavities, one is solid and the other is liquid with natural convection.
But the result of wall gradient is much smaller than it should be!!!
I think there should be something wrong with using snGrad on the coupled patch since I did the same for boussinesqBuoyantFoam solver and it works correctly.
Fvsceme of snGrad is “corrected” and may be it uses the solid cells for calculating snGrad instead of using the cell value of boundary and its neighbor cell in fluid region and it results to wrong answer.
I would appreciate any help
Thanks in advance

benk May 13, 2011 09:14

I don't know what the solution to your problem is, but have you tried comparing the results before and after attaching the patches?

Also, I've found that it can help to use a harmonic interpolation scheme. In divSchemes, I have Gauss harmonic corrected.

kamkari May 13, 2011 10:55

Hi Benk
thank you for your reply,
I take your advice and tested both off and on for attached case in boundary file. also i changed fvScheme of snGral to Guass harmonic corrected but i didn't get any changes:(.
have you got any idea how i can find wallHeatflux on coupled patch??

thank you

benk May 13, 2011 11:04

Have you tried calculating it by hand?

Note: I also have ran into some trouble calculating gradients using this solver. I think you have to closely pay attention to the values of the transport coefficient and the mesh spacing for on and off patches.

kamkari May 21, 2011 10:24

I could finally find why calculated temperature gradient on the coupled patch is much smaller than it expected. snGrad works properly but I think that there is something wrong with conjugateheatFoam solver.
When I opened the T files (after running the program), I found that the temperature value of adjacent nodes to the couple boundary (internal field) is almost equal to the boundary value (coupled boundary)!!!!!. And science snGrad uses the difference of these two adjacent temperatures; the calculated gradient will be very small. I don’t know how I can fix it.
I really appreciate any help
Thanks

benk May 26, 2011 10:50

Quote:

Originally Posted by kamkari (Post 308688)
When I opened the T files (after running the program), I found that the temperature value of adjacent nodes to the couple boundary (internal field) is almost equal to the boundary value (coupled boundary)!!!!!. And science snGrad uses the difference of these two adjacent temperatures; the calculated gradient will be very small. I don’t know how I can fix it.

I think what you're saying is that you have pretty close to zero gradient on the internal patches? To me, this sounds more like a problem with your solver. It really could be anything, perhaps you're not doing a field.correctBoundaryConditions() or something like that. The only thing I can suggest is that you start with a simple problem and then build up from there.

kamkari May 28, 2011 00:35

Hi Benk
Thank you for your reply.
The problem I am solving is a natural convection in a cavity heated (10*10 cm) from one side. The heated boundary is a solid region with 2 mm thickness.
I have just added boussinesq approximation to the conjugateHeatFoam (rename to natFoam).
It seems like that the solution of solid region propagate to the first node of fluid field!!!!!!!!!!!
If you let me have your Email I will be able to send you the solver and the case
Best Regards

Jean El-Hajal May 28, 2011 18:03

Dear Kamkari,

I am not sure this is the issue but ...

Looking at the code, it looks like the conjugateHeatFoam solver is for laminar flow. Did you check if the flow is laminar ?

regards,

Jean

kamkari May 29, 2011 05:59

Hi jean
flow is laminar and it couldn't be the source of error.
i think it is solvers bug !!

benk May 29, 2011 10:35

Quote:

Originally Posted by Jean El-Hajal (Post 309641)
Looking at the code, it looks like the conjugateHeatFoam solver is for laminar flow. Did you check if the flow is laminar ?

Of course there's no reason why the solver can't be modified for completely different applications.

kamkari May 30, 2011 11:50

Hi benk
As I was searching about fvSchemes I found your explanation about harmonic interpolation scheme in the following thread:
http://www.cfd-online.com/Forums/ope...efficient.html
Since I have sharp changes in the transport coefficient (DT) between regions (Solid DT= 1e-2 & DT= 1e-7) it seems I have to use harmonic interpolation.
Could you please let me know how to implement harmonic in fvShcemes file. Should I just use it for interpolationSchemes or …?


Regards,

benk May 30, 2011 12:50

I explained this in post #2 of this thread: http://www.cfd-online.com/Forums/ope...tml#post307535

"In divSchemes, I have Gauss harmonic corrected"


All times are GMT -4. The time now is 23:49.