CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM

conjugateHeatFoam, grid spacing and gradient calculation

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   May 4, 2010, 14:15
Default conjugateHeatFoam, grid spacing and gradient calculation
  #1
Senior Member
 
Ben K
Join Date: Feb 2010
Location: Ottawa, Canada
Posts: 140
Rep Power: 10
benk is on a distinguished road
Hi all, I'm using the conjugateHeatFoam solver in 1.5-dev.

Part of my model requires that I calculate the gradient of a field. I noticed that one of my gradient values (close to the interface between two regions), is giving me something a little odd, and so I began to investigate.

It appears to me that the conjuagteHeatFoam solver changes the grid spacing close to an interface for each submesh and I think this results in the wrong calculation of the gradient of a non-coupled field on the submesh.

For example, in my test case, I have 3 regions each 0.3m in length (this is a 1D problem) split into 50 nodes each. So, the node-node grid spacing should be 0.3/50 = 0.006 and then the boundary to node grid spacing should be 0.3/50/2 = 0.003.

BUT, when I do an Info << mesh.deltaCoeffs() << endl; on each mesh I do find that the node-node spacing is 0.006 but the boundary to node grid spacing gives an unexpected result on my submeshes.

For the submeshes, I get the following (unexpected) boundary output from mesh.deltaCoeffs():

For my first submesh:
Code:
    leftWall
    {
        type            calculated;
        value           uniform 333.333;
    }
    rightWall
    {
        type            calculated;
        value           uniform 166.667;
    }
    frontAndBack
    {
        type            empty;
    }
For my second submesh:
Code:
    leftWall
    {
        type            calculated;
        value           uniform 166.667;
    }
    rightWall
    {
        type            calculated;
        value           uniform 333.333;
    }
    frontAndBack
    {
        type            empty;
    }
But for my main mesh, I get the expected output:
Code:
    leftWall
    {
        type            calculated;
        value           uniform 333.333;
    }
    rightWall
    {
        type            calculated;
        value           uniform 333.333;
    }
    frontAndBack
    {
        type            empty;
    }
Is it normal that the mesh spacing is changing from 1/333.333 = 0.003 to 1/166.667 = 0.006 at the boundaries of my submeshes? And could this be the reason for my unexpected gradient value close to the interface?
benk is offline   Reply With Quote

Old   May 5, 2010, 16:06
Default
  #2
Senior Member
 
Ben K
Join Date: Feb 2010
Location: Ottawa, Canada
Posts: 140
Rep Power: 10
benk is on a distinguished road
I was able to fix this. In the [at|de]tachPatches.H files, all meshes must be included not just the main mesh.


I believe that these files included in the conjugateHeatFoam solver example are wrong because they only consider the main mesh, not the submeshes. For the majority of cases, it won't make a difference to the solution unless you plan to evaluate the gradient (or use the grid spacing close to the boundary) of a non coupled field on a submesh.
benk is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 02:34.