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

assigning a value to the specific zone in OpenFOAM

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 11, 2013, 11:51
Default assigning a value to the specific zone in OpenFOAM
  #1
Senior Member
 
Daniel
Join Date: Mar 2013
Location: Noshahr, Iran
Posts: 348
Rep Power: 21
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, 08:02
Default
  #2
Senior Member
 
Daniel
Join Date: Mar 2013
Location: Noshahr, Iran
Posts: 348
Rep Power: 21
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


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
mass flow in is not equal to mass flow out saii CFX 12 March 19, 2018 05:21
[Commercial meshers] Mesh conversion problem (fluent3DMeshToFoam) Aadhavan OpenFOAM Meshing & Mesh Conversion 2 March 8, 2018 01:47
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 16:01


All times are GMT -4. The time now is 17:10.