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

How to define field in createFields.H fine in OF23x

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 15, 2015, 04:25
Default How to define field in createFields.H fine in OF23x
  #1
Member
 
Gitesh
Join Date: Jan 2010
Location: Finland
Posts: 73
Rep Power: 13
Gitesh P is on a distinguished road
Hello,

I am trying to define heat transfer coefficient in createFields.H file in twoPhaseEulerFoam solver of OF23x. Can any suggest how I can do that?

Regrads,
GP
Gitesh P is offline   Reply With Quote

Old   July 16, 2015, 07:37
Default
  #2
Senior Member
 
Join Date: Sep 2010
Posts: 226
Rep Power: 14
T.D. is on a distinguished road
Hi,


Two methods: as a "dimensionedScalar" or as a "volScalarField"
1) First Method:

in the file createField.H add:

///////////////////////////////////////////////////
dimensionedScalar h
(
transportProperties.lookup("h")
);
///////////////////////////////////////////////////
and then you need to define its value with dimensions in
the "transportProperties" file in the case/constant folder

2) sencond Method:

in the file createField.H add:
///////////////////////////////////////////////////
volScalarField h
(
IOobject
(
"h",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("h",dimensionSet(......),scalar( "your value"))
);
///////////////////////////////////////////////////
Note that "NO_READ" must be changed to "MUSt_READ" based
on your requirements.

Don't Forget to recompile the solver with "wmake" command in terminal.

Have Fun

Regards,
T.D.

Quote:
Originally Posted by Gitesh P View Post
Hello,

I am trying to define heat transfer coefficient in createFields.H file in twoPhaseEulerFoam solver of OF23x. Can any suggest how I can do that?

Regrads,
GP
T.D. is offline   Reply With Quote

Old   July 20, 2015, 04:22
Default
  #3
Member
 
Gitesh
Join Date: Jan 2010
Location: Finland
Posts: 73
Rep Power: 13
Gitesh P is on a distinguished road
Hello,

Thank you very much for your help. Now I am able to print the fields what I want. Do you have any idea how I can get the total cell volumes where I have fluid interface?

I mean in my case I need to calculate the total interracial area of interface. So need the cell volumes where the interface is there.

Regards,
GP
Gitesh P is offline   Reply With Quote

Old   December 24, 2020, 12:01
Default
  #4
New Member
 
Pratik
Join Date: May 2020
Posts: 11
Rep Power: 3
Pratik_21 is on a distinguished road
Hi,

I was trying the above-mentioned methods and they work. I get the file of the newly added field in the time steps folder but don't get the values in the timestep folders. It just shows the values that I mentioned in the 0 folder.

for curiosity, I used Info statement to print the values of the newly added variable on-screen, and there it shows the expected values. but then why I am not getting them in timestep folders?
Pratik_21 is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
''unknown radialModelType type Gidaspow'' PROBLEM WITH THE BED TUTORIAL AndoniBM OpenFOAM Running, Solving & CFD 2 March 25, 2015 18:44
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 06:51
How do I define a custom vector field? MHDWill FLUENT 0 September 29, 2007 17:04
ACCESS VIOLATION MHDWill FLUENT 1 September 23, 2007 02:51


All times are GMT -4. The time now is 19:45.