|
[Sponsors] | |||||
|
|
|
#1 |
|
Member
Join Date: May 2017
Posts: 38
Rep Power: 10 ![]() |
Hello everybody,
I would like to understand how surfaceToCell works in topoSet for a cellSet source. surfaceToCell is composed of of this arguments: - surface - outsidepoint - cut - inside - outside - near - curvature I don't understand the meaning of these arguments except "surface". Someone can help me? Thanks in advance |
|
|
|
|
|
|
|
|
#2 |
|
Senior Member
|
Hi,
Code:
$ src $ pwd $HOME/OpenFOAM/OpenFOAM-4.1/src $ find . -name 'surfaceToCell.*' ./meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C ./meshTools/sets/cellSources/surfaceToCell/surfaceToCell.H ./meshTools/lnInclude/surfaceToCell.C ./meshTools/lnInclude/surfaceToCell.H $ less ./meshTools/sets/cellSources/surfaceToCell/surfaceToCell.H Code:
//- Name of surface file
const fileName surfName_;
//- Points which are outside
const pointField outsidePoints_;
//- Include cut cells
const bool includeCut_;
//- Include inside cells
const bool includeInside_;
//- Include outside cells
const bool includeOutside_;
//- Determine inside/outside purely using geometric test
// (does not allow includeCut)
const bool useSurfaceOrientation_;
//- If > 0 : include cells with distance from cellCentre to surface
// less than nearDist.
const scalar nearDist_;
//- If > -1 : include cells with normals at nearest surface points
// varying more than curvature_.
const scalar curvature_;
|
|
|
|
|
|
|
|
|
#3 | |
|
Member
Join Date: May 2017
Posts: 38
Rep Power: 10 ![]() |
Quote:
Thank you for your help. but it is not yet clear for me. If we take for example the motorbike tutorials, the outsidepoints are outside the moto but inside the domain, outside the moto and outside the domain or inside the moto? About the cut cells, how it is possible to choose the cells cut by motorbike surface? Inside, I think it's inside the motorbike but, in this case there are not cells inside. Outside I think it's outside the motorbike but in the domain. near I understand and I don't understand the function of curvature. |
||
|
|
|
||
|
|
|
#4 |
|
Senior Member
|
Hi,
Now it is not clear to me, what you are asking. You started from cellSet source in topoSet, i.e. you were selecting CELLS. Now you talk about points (though maybe it was my mistake to include this property in example). You have surface. You can select cells of a computation domain, that are inside this surface, outside this surface, and cut by this surface. To define meaning of "inside" and "outside", you can use either reference point, or surface orientation. Curvature works only for nearDist. And it means the following: Code:
Info<< " Selecting cells with cellCentre closer than "
<< nearDist_ << " to surface and curvature factor"
<< " less than " << curvature_ << endl;
|
|
|
|
|
|
|
|
|
#5 |
|
Member
Join Date: May 2017
Posts: 38
Rep Power: 10 ![]() |
in my previous message I wanted to apply surfaceToCell in the motorbike case to understand. But I'm agree with you it wasn't clear. Do you know this tutorial?
|
|
|
|
|
|
|
|
|
#6 |
|
Senior Member
|
It is MUCH easier to understand if you really try to apply this topoSet to your problem and then post your cognitive dissonances.
I know the tutorial. |
|
|
|
|
|
|
|
|
#7 |
|
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 14 ![]() |
For future reference, the following tutorials in v1912 contain examples of `surfaceToCell`:
mesh/foamyHexMesh/flange/system/topoSetDict-background multiphase/interFoam/laminar/waves/mangroveInteraction/system/setFieldsDict Code:
surfaceToCell
{
file "./constant/triSurface/seaweed.stl";
outsidePoints ((2 0.25 0.15));
includeCut true;
includeInside true;
includeOutside false;
nearDistance -1;
curvature -100;
fieldValues
(
volScalarFieldValue MangrovesIndex 1
);
}
__________________
The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki/Journal Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak/Primer Governance Bugs/Features: OpenFOAM (ESI-OpenCFD-Trademark) Bugs/Features: FOAM-Extend (Wikki-FSB) Bugs: OpenFOAM.org How to create a MWE New: Forkable OpenFOAM mirror |
|
|
|
|
|
|
|
|
#8 |
|
New Member
Guanqi
Join Date: Mar 2025
Location: uk
Posts: 9
Rep Power: 2 ![]() |
Hi Alexey,
I extruded a 0.5 mm thick solid shell from the external surface of a fluid mesh region (see attached shell image). The external surface is named as "fluidToSolid", and in the extruded solid, both the inner and outer walls are named by "fluidToSolid". I'd like to separate the two surfaces (inner wall vs. outer wall) using topoSet and then rename them using createPatch. No matter how I played with the settings in topoSetDict, I cannot have expected results. Below are my codes. Do you have any idea? Thanks a lot for your help in advance. Guanqi Code:
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 10
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class dictionary;
object topoSetDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
actions
(
{
name inner-cells;
type cellSet;
action new;
source surfaceToCell;
sourceInfo
{
file "constant/geometry/fluidToSolid.stl";
outsidePoints (
(0.151308 0.00186969 0.208)
);
includeCut false;
includeInside true;
includeOutside false;
nearDistance -1; // cells with centre near surf
// (set to -1 if not used)
curvature -100; // cells within nearDistance
// and near surf curvature
// (set to -100 if not used)
}
}
{
name inner-wall;
type faceSet;
action new;
source cellToFace;
sourceInfo
{
set inner-cells;
option all;
}
}
{
name inner-wall;
type faceSet;
action subset;
source patchToFace;
sourceInfo
{
name "fluidToSolid";
}
}
);
// ************************************************************************* //
Code:
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 10
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class polyBoundaryMesh;
location "1e-05/polyMesh";
object boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
5
(
fluidGraftInlet
{
type wall;
inGroups List<word> 1(wall);
nFaces 32;
startFace 17454;
}
fluidVeinInlet
{
type wall;
inGroups List<word> 1(wall);
nFaces 56;
startFace 17486;
}
fluidVeinOutlet
{
type wall;
inGroups List<word> 1(wall);
nFaces 44;
startFace 17542;
}
fluidToSolid
{
type wall;
inGroups List<word> 1(wall);
nFaces 17480;
startFace 17586;
}
solid_to_fluid
{
type patch;
nFaces 0;
startFace 35066;
}
)
// ************************************************************************* //
|
|
|
|
|
|
![]() |
| Tags |
| cellset, openfoam, surfacetocell, toposet |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [OpenFOAM.com] Multiple Installation Issue: Parallel Processing No Longer Works | dancfd | OpenFOAM Installation | 11 | November 20, 2018 17:08 |
| [GAMBIT] Gambit works on Windows, but not in Linux | victorz | ANSYS Meshing & Geometry | 8 | April 14, 2013 21:40 |
| Parallel runs with sonicDyMFoam crashes (works fine with sonicFoam) | jnilsson | OpenFOAM Running, Solving & CFD | 0 | March 9, 2012 07:45 |
| git problem: 1.7.x works but 1.6.x not | af631717 | OpenFOAM Installation | 2 | August 23, 2010 06:22 |
| ARTICLES AND WORKS CONCERNING CFD OF LIQUID-LIQUID DISPERSION AND DROPS SIZE IN AGITATED SYSTEMS.. | tim | Main CFD Forum | 1 | June 22, 1999 09:07 |