CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[blockMesh] How to define an volScalarField in part of the Mesh?

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By devlaam

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 15, 2013, 12:54
Default How to define an volScalarField in part of the Mesh?
  #1
New Member
 
Ruud Vlaming
Join Date: Aug 2013
Posts: 6
Rep Power: 13
devlaam is on a distinguished road
Hi,

I cannot find an example or solution for this probably very simple newbie problem. I work with electrostatics, but i do not think this is relevant, it is an general issue.

I defined two cubes of size 1 next to each other, called left and right. If can define a uniform charge density in both cubes. With
Code:
internalField   uniform 1e-3;
and that works well, but how do define it in just one cube? I tried adding an "internal plane" in the blockMeshDict, but that is not acceptable it seems. And even if it were, how do i designate that space, it seems only the faces can have names. Somehow i am missing something quite obvious here.

I really appreciate any help.

These are my test files:
Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1;

vertices
(   (1 0 0) //0
    (1 1 0) //1
    (0 1 0) //2
    (0 0 0) //3
    (1 0 1) //4
    (1 1 1) //5
    (0 1 1) //6
    (0 0 1) //7
    (1 2 0) //8
    (0 2 0) //9
    (1 2 1) //10
    (0 2 1) //11
);

blocks
(   hex (0 1 2 3 4 5 6 7)   (5 5 5) simpleGrading (1 1 1)
    hex (1 8 9 2 5 10 11 6) (5 5 5) simpleGrading (1 1 1) );

boundary
(
  topleft
  { type patch;
    faces ( (4 5 6 7) ); }

  topright
  { type patch;
    faces ( (5 10 11 6) ); }
    
  bottomleft
  { type patch;
    faces ( (3 2 1 0) ); }

  bottomright
  { type patch;
    faces ( (2 9 8 1) ); }

  frontleft
  { type patch;
    faces ( (4 5 1 0) ); }

  frontright
  { type patch;
    faces ( (5 10 8 1) ); }

  backleft
  { type patch;
    faces ( (2 6 7 3) ); }

  backright
  { type patch;
    faces ( (9 11 6 2) ); }

  leftleft
  { type patch;
    faces ( (0 4 7 3) ); }

  rightright
  { type patch;
    faces ( (9 11 10 8) ); }

// This does not work?    
//  middle
//  { type internal;
//    faces ( (1 2 6 5) ); }

);

mergePatchPairs
(
);
Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      rho;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 -3 1 0 0 1 0];

// how to define this only for the left cube???
internalField   uniform 1e-3;

boundaryField
{
  topleft
  { type fixedValue;
    value uniform 0; }

  topright
  { type fixedValue;
    value uniform 0; }
    
  bottomleft
  { type fixedValue;
    value uniform 0; }

  bottomright
  { type fixedValue;
    value uniform 0; }

  frontleft
  { type fixedValue;
    value uniform 0; }

  frontright
  { type fixedValue;
    value uniform 0; }

  backleft
  { type fixedValue;
    value uniform 0; }

  backright
  { type fixedValue;
    value uniform 0; }

  leftleft
  { type fixedValue;
    value uniform 0; }

  rightright
  { type fixedValue;
    value uniform 0; }
    
}
devlaam is offline   Reply With Quote

Old   October 17, 2013, 16:53
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi devlaam,

I'm guessing that you read the User Guide waaaay too fast

This is explained here: http://www.openfoam.org/docs/user/da...#x7-530002.3.3 (section "2.3.3 Setting initial field")

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   October 22, 2013, 11:14
Post
  #3
New Member
 
Ruud Vlaming
Join Date: Aug 2013
Posts: 6
Rep Power: 13
devlaam is on a distinguished road
Yep, guess you where right.
Works like a charm now.
The biggest problem for the newbies is, i think, that we all have a idea how this should work, but that is not the way it works ...
Thanks for your support!
wyldckat likes this.
devlaam is offline   Reply With Quote

Reply

Tags
internalfield, volscalarfield


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] No layers in a small gap bobburnquist OpenFOAM Meshing & Mesh Conversion 6 August 26, 2015 10:38
Define total mesh diclpacement in theta Direction omidiut CFX 1 November 10, 2013 05:28
Installing OF 1.6 on Mac OS X gschaider OpenFOAM Installation 129 June 19, 2010 10:23
Icemcfd 11: Loss of mesh from surface mesh option? Joe CFX 2 March 26, 2007 19:10
How to control Minximum mesh space? hung FLUENT 7 April 18, 2005 10:38


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