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

assigning a value to the specific zone in OpenFOAM

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

Reply
 
LinkBack Thread Tools Display Modes
Old   December 11, 2013, 12:51
Default assigning a value to the specific zone in OpenFOAM
  #1
Senior Member
 
Daniel
Join Date: Mar 2013
Posts: 213
Rep Power: 13
Daniel_Khazaei will become famous soon enough
Hello foamers


I am trying to add a source term to the UEqn in icoFoam. Now I will describe my question in details:

1- I have a fluent mesh (.msh) which consist of two different zones.

2- I know how to add my source to the UEqn which is a function of beta.

3- beta has a value of zero in the first zone.

4- beta has a value of non-zero in the second zone.

5- Doing so, the solver will add the source term to the second zone, while beta = 0 ensures that the source term remains zero in the first zone.


beta will remain constant in the whole simulation, I have defined it as follow:

volScalarField beta
(
IOobject
(
"beta",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);

is there any way (like setField) to initiate beta before running the simulation according to the zones which are defined in the mesh?

thanks in advance

regards
Daniel_Khazaei is offline   Reply With Quote

Old   December 12, 2013, 09:02
Default
  #2
Senior Member
 
Daniel
Join Date: Mar 2013
Posts: 213
Rep Power: 13
Daniel_Khazaei will become famous soon enough
well, I have found a way by searching in OpenFOAM sources (src and utilities).

I have generated the cell ID numbers belong to that specific zone from cellSet utility. Then I have added a bit of code to icoFoam, so it can read that list and assign values acooriding to that ID list.


regards
Daniel_Khazaei 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
Mesh conversion problem (fluent3DMeshToFoam) Aadhavan OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 1 December 12, 2012 11:38
modify specific heat ratio in OpenFOAM Gitesh P OpenFOAM Running, Solving & CFD 0 June 25, 2012 05:52
Problem in running ICEM grid in Openfoam Tarak OpenFOAM 6 September 9, 2011 17:51
How to show the properties in the specific zone ID using UDF (Define_adjust) sagga18 Fluent UDF and Scheme Programming 2 December 12, 2009 17:01
mass flow in is not equal to mass flow out saii CFX 2 September 18, 2009 08:07


All times are GMT -4. The time now is 04:25.