CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Native Meshers: blockMesh

How to define an volScalarField in part of the Mesh?

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By devlaam

Reply
 
LinkBack Thread Tools Display Modes
Old   October 15, 2013, 11:54
Default How to define an volScalarField in part of the Mesh?
  #1
New Member
 
Ruud Vlaming
Join Date: Aug 2013
Posts: 4
Rep Power: 2
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, 15:53
Default
  #2
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 7,088
Blog Entries: 32
Rep Power: 70
wyldckat is a jewel in the roughwyldckat is a jewel in the roughwyldckat is a jewel in the rough
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, 10:14
Post
  #3
New Member
 
Ruud Vlaming
Join Date: Aug 2013
Posts: 4
Rep Power: 2
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

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
No layers in a small gap bobburnquist OpenFOAM Native Meshers: snappyHexMesh and Others 2 November 25, 2012 08:54
Icemcfd 11: Loss of mesh from surface mesh option? Joe CFX 2 March 26, 2007 18:10
Free surface boudary conditions with SOLA-VOF Fan Main CFD Forum 10 September 9, 2006 12:24
UDF FOR UNSTEADY TIME STEP mayur FLUENT 3 August 9, 2006 10:19
How to control Minximum mesh space? hung FLUENT 7 April 18, 2005 09:38


All times are GMT -4. The time now is 03:29.