Problem with snGrad() for heat flux.
I am simulating the gas laminar flow in straight rectangular channel with rhoCentralFoam (OF-2.2.2), I modified the utility wallHeatFlux and also renamed it to extract the heat flux for laminar flow, and get problem with snGrad() that was used to compute the normal gradient of temperature.
In the code I set surfaceScalarField heatFlux = (fvc::interpolate(-k))*(fvc::snGrad(T)); then I compile my utility and run it and get the heat fluxes at the surfaces and outlet are zero while it can produce the heat flux at inlet only. I just check heatFlux = fvc::interpolate(-k) so I have all values (not zero) of k at the surfaces but it I added (fvc::snGrad(T)) to heatFlux I got the results are zero for surface heat flux. This means (fvc::snGrad(T)) produced the value of zero for normal gradient temperature. What problem I get with snGrad() function. Can anyone help me to get the heat fluxes at the surfaces ? I use psiThemo model in simulation. |
Greetings Lee,
I honestly don't know what is the problem you're getting, because I don't get any problem. I'm guessing this is because you didn't share enough information for reproducing the same problem. I modified the wallHeatFlux utility this way:
Bruno |
Hi Bruno,
I modified the wallHeatFLux for laminar case with the rhoCentralFoam solver. in CreateFields.H Code:
autoPtr<psiThermo> pThermo Code:
volScalarField T Could you help me to find out the mistakes ? Thanks Best regards, SK |
Hi Lee,
This is the problem when people don't share a test case :( The utility will work if you have walls in your simulation case. Check the contents of the file "constant/polyMesh/boundary". If all patches are of type "patch" or if none of the patches are of type wall, then it's only natural that you don't have non-zero values near the walls that don't exist ;) For example, if you run this command in the tutorial case "compressible/rhoCentralFoam/biconic25-55Run35", after the mesh has been created: Code:
patchSummary -constant -noZero Code:
Valid fields: Best regards, Bruno |
Hi Bruno,
That's fine. It works. Thanks so much for your help. SK |
All times are GMT -4. The time now is 01:03. |