CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

How to change/set different boundary condition for particular cell region?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 3, 2021, 00:34
Default
  #21
Member
 
Sunag R A
Join Date: Jul 2019
Location: Bangalore, India
Posts: 82
Rep Power: 6
sunagra27 is on a distinguished road
Dear Robin,



Quote:

Certainly somewhere is a mistake, but it is getting difficult to spot without the case.


What points do you mean by points (face vertices)? It would be good to do pointSet from patch faceCentres so it gives you same number of faces as you give it the points.
I believe that these points are points of face vertices only. I created pointSet and also faceSet from these obtained pointSet. I have attached the difference in visualization from original (temp = 0) and obtained BC after creating patch from createPatch.

I will work with faceCentres directly to get pointSet and update the same.



Quote:
Nevertheless, I assume that you access the patch already in your function in ControlDict and that you also iterate over the patch faces. Then you can try to do something like this
Code:
forAll(mesh.boundary()[patch], facei)
{

const label& face = boundaryMesh[patch].start() + facei;
 }

I tried implementing the code in 0/patch/T, but it did not produce any result and gave me some errors related to this mainly "forAll" loop. I am trying to work with this.


Below is the implementation.

Code:

gland
    {
        type            codedFixedValue;
        value           #include "actualSkinData";
    name        glandsurface;

    code
    #{

    const fvPatch& mesh = this->patch();
    const vectorField& Cf = mesh.Cf();
    
    const fvBoundaryMesh& boundaryMesh = mesh.boundaryMesh();
    
    forAll(mesh.boundary()[patch], facei)
      {
            const label& face = boundaryMesh[patch].start() + facei;        // Face index
        
        }
    
    #};
    }
Images


https://drive.google.com/file/d/1i_q...ew?usp=sharing

1st image represents the temp values applied to the surface from external file and ran for 1 iteration. The pink dots are points which are extracted from controlDict #includeFunc surfaces. From this, faceCentres are also extracted.



https://drive.google.com/file/d/1zxf...ew?usp=sharing

2nd Image is the cropped image to show the difference between temp values of where it is divided.



https://drive.google.com/file/d/1aOB...ew?usp=sharing

3rd image is the patch divided image from points. Here green color represents the patch obtained after faceSet creation. In this, some faces with T=0 are missing.

https://drive.google.com/file/d/1pBI...ew?usp=sharing

4th image is the cropped image of the new BC. Comparing 2nd and 4th cropped images, along the edges of the temp gradient, some faces are not captured from pointSet.


I can provide you the complete case.


Regards,


Sunag R A.

Last edited by sunagra27; May 3, 2021 at 06:03.
sunagra27 is offline   Reply With Quote

Reply

Tags
boundary condition, chtmultiregionsimpefoam, heat and mass transfer, temperature


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Other] refineWallLayer Error Yuby OpenFOAM Meshing & Mesh Conversion 2 November 11, 2021 11:04
Fatal overflow in linear solver. iamnotfajar CFX 9 October 28, 2020 04:47
accessing internal cell gradient field at boundary when applying boundary condition vishalsacharya OpenFOAM Programming & Development 7 February 25, 2019 15:36
Problem in setting Boundary Condition Madhatter92 CFX 12 January 12, 2016 04:39
Warning 097- AB Siemens 6 November 15, 2004 04:41


All times are GMT -4. The time now is 18:59.