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

Fix initial condition in a volume

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

Reply
 
LinkBack Thread Tools Display Modes
Old   June 15, 2012, 04:51
Default Fix initial condition in a volume
  #1
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 496
Rep Power: 11
samiam1000 is on a distinguished road
Dear All,

I am trying to simulate an opening window. I succeded in setting the mesh movement and I am now ready for my simulation.

The point is that before moving the mesh I have to fix the initial condition. What I wanna do is to impose a certain temperature in the internal volume and a different one in the external volume.

I thought about a T file that looks like:

Code:
.
.
.
dimensions      [0 0 0 1 0 0 0];

internalField	  uniform 298;
volume_internal   uniform 273;
volume_external	  uniform 298;

boundaryField
.
.
.
where volume_internal and volume_external are two different cellZones.

If I don't write
Code:
 internalField	  uniform 298;
, I get an error. With this line, on the contrary, I have both the zones with the same value of 298!

But this does not work properly.

Any suggestion?

Thanks,
Samuele
samiam1000 is offline   Reply With Quote

Old   June 15, 2012, 16:08
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,005
Rep Power: 43
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by samiam1000 View Post
Dear All,

I am trying to simulate an opening window. I succeded in setting the mesh movement and I am now ready for my simulation.

The point is that before moving the mesh I have to fix the initial condition. What I wanna do is to impose a certain temperature in the internal volume and a different one in the external volume.

I thought about a T file that looks like:

Code:
.
.
.
dimensions      [0 0 0 1 0 0 0];

internalField	  uniform 298;
volume_internal   uniform 273;
volume_external	  uniform 298;

boundaryField
.
.
.
where volume_internal and volume_external are two different cellZones.

If I don't write
Code:
 internalField	  uniform 298;
, I get an error. With this line, on the contrary, I have both the zones with the same value of 298!

But this does not work properly.

Any suggestion?

Thanks,
Samuele
With "fix the initial condition" you mean "set the initial condition", right? (fixing for me is if the temperature in that zone is not allowed to change during the simulation)

One possibility is to use setFields (which you should know from the damBreak-tutorial). It can use other topoSetSources than boxToCell (I think the one you want is called zoneToCell but I'm not sure).The other possibility is funkySetFields which allows using expressions to set fields.

Both utilities allow you to set the field to an inhomogenous value. Then you start the simulation as usual
gschaider is offline   Reply With Quote

Old   June 15, 2012, 17:50
Default
  #3
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 496
Rep Power: 11
samiam1000 is on a distinguished road
Actually yes, I meant set instead of fix..

But, since you said it, is it possible to FIX the temperature in order to remain constant during the simulation?

Anyway, I'll try what you suggested in order to set the initial condition..

Thanks a lot,

Samuele
samiam1000 is offline   Reply With Quote

Old   June 18, 2012, 14:53
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,005
Rep Power: 43
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by samiam1000 View Post
Actually yes, I meant set instead of fix..

But, since you said it, is it possible to FIX the temperature in order to remain constant during the simulation?

Anyway, I'll try what you suggested in order to set the initial condition..

Thanks a lot,

Samuele
For fixing values: either forceEquation from swak4Foam (search the MessageBoard) or the runtime-selectable sources that are built into OF (check the release-notes). If you're lucky then the solver you use already has the runtime-selectable sources built in and you don't have to do any programming
gschaider is offline   Reply With Quote

Old   June 18, 2012, 17:19
Default
  #5
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 496
Rep Power: 11
samiam1000 is on a distinguished road
Im using either bupyantPimpleDyMFoam or chtMultiRegionDyMFoam..
samiam1000 is offline   Reply With Quote

Reply

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
Floating point exception error Alan OpenFOAM Running, Solving & CFD 10 April 6, 2012 14:02
Upgraded from Karmic Koala 9.10 to Lucid Lynx10.04.3 bookie56 OpenFOAM Installation 8 August 13, 2011 04:03
Parallel rasInterFoam openfoam_user OpenFOAM Running, Solving & CFD 4 November 1, 2008 05:14
Negative value of k causing simulation to stop velan OpenFOAM Running, Solving & CFD 1 October 17, 2008 05:36
Convergence moving mesh lr103476 OpenFOAM Running, Solving & CFD 30 November 19, 2007 15:09


All times are GMT -4. The time now is 05:58.