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

How to cell field values to cells in setFields

Register Blogs Community New Posts Updated Threads Search

Like Tree6Likes
  • 6 Post By floquation

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 23, 2017, 03:22
Default How to cell field values to cells in setFields
  #1
Member
 
Upuli
Join Date: Feb 2016
Posts: 68
Rep Power: 10
upuli is on a distinguished road
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
upuli is offline   Reply With Quote

Old   January 23, 2017, 04:55
Default
  #2
Senior Member
 
floquation's Avatar
 
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 21
floquation will become famous soon enough
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
        );
    }
 );


// ************************************************************************* //
floquation is offline   Reply With Quote

Old   January 23, 2017, 11:04
Default
  #3
Member
 
Upuli
Join Date: Feb 2016
Posts: 68
Rep Power: 10
upuli is on a distinguished road
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
upuli is offline   Reply With Quote

Old   January 23, 2017, 11:32
Default
  #4
Senior Member
 
floquation's Avatar
 
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 21
floquation will become famous soon enough
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.
And needs the dictionary entry "set":
Code:
 76     setName_(dict.lookup("set"))
floquation is offline   Reply With Quote

Reply


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
[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


All times are GMT -4. The time now is 19:49.