|
[Sponsors] |
How to cell field values to cells in setFields |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 23, 2017, 03:22 |
How to cell field values to cells in setFields
|
#1 |
Member
Upuli
Join Date: Feb 2016
Posts: 68
Rep Power: 10 |
Dear members
I want to know how to set the field values to cells using setFields. I used cellToCell in setFields. but it gives me errors. Thanking You rgds Upuli |
|
January 23, 2017, 04:55 |
|
#2 |
Senior Member
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 21 |
I do not understand what you want to achieve / you specify to little information. It always helps to post what exactly you tried to clarify your problem.
This is an example of a setFieldDict that I am using to initiate a spherical bubble in interFoam: Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 4.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object setFieldsDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // defaultFieldValues ( volScalarFieldValue alpha.water 1 ); regions ( sphereToCell { centre (0.0025 0.0025 0.001); radius 0.0005; fieldValues ( volScalarFieldValue alpha.water 0 ); } ); // ************************************************************************* // |
|
January 23, 2017, 11:04 |
|
#3 |
Member
Upuli
Join Date: Feb 2016
Posts: 68
Rep Power: 10 |
Thank you very much for your prompt reply. I want to define some field values for one cell in my geometry(box). I think cellToCell in setFields will do that. But I do not how to use it(which parameters are required in defining the cell)
Thanks |
|
January 23, 2017, 11:32 |
|
#4 |
Senior Member
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 21 |
And how do you wish to select that one cell? The answer will depend on that.
Some other ideas: 1) Use boxToCell with a tiny box around the cell you wish to select. 2) Create a set based on the cell indices and then use cellToCell*** 3) funkySetFields can use an arbitrary expression to select cells. ***cellToCell says (${FOAM_SRC}/meshTools/sets/cellSources/cellToCell): Code:
27 Description 28 A topoSetSource to select the cells from another cellSet. Code:
76 setName_(dict.lookup("set")) |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] sHM layer process keeps getting killed | MBttR | OpenFOAM Meshing & Mesh Conversion | 4 | August 15, 2016 04:21 |
Setting patch field values equal to internal field values | leroyv | OpenFOAM Programming & Development | 1 | October 21, 2014 16:49 |
killed "snappyHexMesh" | parkh32 | OpenFOAM Pre-Processing | 2 | April 8, 2012 18:12 |
[Netgen] Import netgen mesh to OpenFOAM | hsieh | OpenFOAM Meshing & Mesh Conversion | 32 | September 13, 2011 06:50 |
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues | michele | OpenFOAM Meshing & Mesh Conversion | 2 | July 15, 2005 05:15 |