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

Clarification in surfaceScalarField Initialization

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By tomf

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 31, 2019, 10:54
Default Clarification in surfaceScalarField Initialization
  #1
New Member
 
Join Date: Feb 2017
Posts: 5
Rep Power: 9
gsabhishek is on a distinguished road
Code:
surfaceScalarField rhoPhi
(
    IOobject
    (
        "rhoPhi",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
    ),
fvc::interpolate(rho)*phi
);
Here in the attatched example, is "fvc::interpolate(rho)*phi" just an initializer or does it mean that rhoPhi get automatically updated as rho varies (something like a function)


thanks
Attached Images
File Type: png Screenshot 2019-07-31 at 3.47.19 PM.png (45.0 KB, 61 views)
gsabhishek is offline   Reply With Quote

Old   August 1, 2019, 02:05
Default
  #2
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Breda, Netherlands
Posts: 636
Rep Power: 32
tomf will become famous soon enoughtomf will become famous soon enough
Send a message via MSN to tomf Send a message via Skype™ to tomf
Hi,

It means that rho (which is known at the cell centres) is interpolated to the face centers (where phi is known). Then they are multiplied to get rho*phi at the face centers. You now have the mass flux over the face of the cell.

Cheers,
Tom
vivek05 likes this.
tomf is offline   Reply With Quote

Old   August 1, 2019, 04:09
Default
  #3
New Member
 
Join Date: Feb 2017
Posts: 5
Rep Power: 9
gsabhishek is on a distinguished road
Hi,


Thanks for this... But what I am interested is in the general definition of the volScalarField or the surfaceScalarField. I want to know whether the function we are passing as an argument ( in this case "fvc::interpolate(rho)*phi"), is just to initialize the field or does openfoam use the function everytime rho is updated in the code
gsabhishek is offline   Reply With Quote

Old   August 1, 2019, 04:39
Default
  #4
Member
 
Hosein
Join Date: Nov 2011
Location: Germany
Posts: 93
Rep Power: 14
einstein_zee is on a distinguished road
Hey,

This is an object construction. And the constructor is called once, when the object is created. However, the content might change along the way...
einstein_zee is offline   Reply With Quote

Old   August 1, 2019, 04:42
Default
  #5
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Breda, Netherlands
Posts: 636
Rep Power: 32
tomf will become famous soon enoughtomf will become famous soon enough
Send a message via MSN to tomf Send a message via Skype™ to tomf
Hi,

I guess this depends on when the function is called. It can typically be within the createFields.H, which is usually at the start of the simulation, so it is initialized, but it can also be within the time loop.

A volScalarField is a field (basically a list) of scalars, where each scalar is defined for a volume (i.e. in the cell center)
A surfaceScalarField is a field of scalars, where each scalar is defined for a surface (i.e. in the face center).

Cheers,
Tom
tomf 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
Upwind Gradient Not Recognizing surfaceScalarField MajidHagh OpenFOAM 2 October 30, 2019 11:58
FMG initialization query Mohsin FLUENT 6 November 2, 2016 02:02
CFX Transient Initialization frossi CFX 1 June 17, 2016 09:31
Full Multigrid Initialization Mr.Goodcat FLUENT 0 March 17, 2016 06:43
Function returning uniform surfaceScalarField lichmaster OpenFOAM 3 June 25, 2012 03:46


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