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

can I delete this piece of code from the twoPhaseEulerFoam?

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes
  • 1 Post By alexeym
  • 4 Post By alexeym

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 18, 2014, 17:39
Default can I delete this piece of code from the twoPhaseEulerFoam?
  #1
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 838
Rep Power: 17
sharonyue is on a distinguished road
Hi guys,

In twoPhaseEulerFoam , we see:
Code:
while (pimple.loop())
        {
            fluid.solve();
            fluid.correct();

            volScalarField contErr1
I looked into the code, it returns like this:
Code:
void Foam::diameterModel::correct()
{}
So I think it calculates nothing....so why add this here? Im confused. Any ideas? Thanks,
sharonyue is offline   Reply With Quote

Old   December 19, 2014, 10:16
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

If you take a look at description of the class

Code:
Class
    Foam::diameterModel
        
Description
    A2stract base-class for dispersed-phase particle diameter models.
you'll see that you should look at correct method in children of diameterModel class, such as IATE. In this class correct method is not so short.
sharonyue likes this.
alexeym is offline   Reply With Quote

Old   January 20, 2015, 05:59
Default
  #3
Member
 
Anurag
Join Date: Aug 2014
Location: Germany
Posts: 57
Rep Power: 11
anuragm is on a distinguished road
Hi Alexey,

I have a similar question about fluid.correct() and I do not follow your answer. Could you please explain it a little more?

Thanks
anuragm is offline   Reply With Quote

Old   January 20, 2015, 06:22
Default
  #4
Member
 
Ron
Join Date: Jul 2014
Location: Japan
Posts: 40
Rep Power: 11
ron_OFuser is on a distinguished road
Anurag, You need to dig into that. The function is a member of the referred base class.
ron_OFuser is offline   Reply With Quote

Old   January 20, 2015, 07:25
Default
  #5
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

Quote:
Originally Posted by anuragm View Post
I have a similar question about fluid.correct() and I do not follow your answer. Could you please explain it a little more?
Well, you can start with ron_OFuser's answer.

More detailed version is: what is fluid? It is variable of type twoPhaseSystem defined in createFields.H:

Code:
twoPhaseSystem fluid(mesh, g);
correct method of twoPhaseSystem does this:

Code:
void Foam::twoPhaseSystem::correct()
{
    phase1_.correct();
    phase2_.correct();
}
what are phase1_ and phase2_? They are properties of twoPhaseSystem of type phaseModel:

Code:
class twoPhaseSystem
:
    public IOdictionary
{
...
        //- Phase model 1
        phaseModel phase1_;
...
}
What correct method of phaseModel does? It calls correct method of dPtr_

Code:
void Foam::phaseModel::correct()
{
    return dPtr_->correct();
}
and dPtr_ is a pointer to diameter model

Code:
class phaseModel
:
    public volScalarField,
    public transportModel
{
...
        //- Diameter model
        autoPtr<diameterModel> dPtr_;
...
}
Currently there are 3 diameter models in twoPhaseSystem:

Code:
constantDiameter
isothermalDiameter
IATE
First two models really have empty correct method. The last however has non-empty correct method.

Is it a little bit more clear this time?
aee, meshman, wwzhao and 1 others like this.
alexeym is offline   Reply With Quote

Old   January 22, 2015, 20:15
Default
  #6
Member
 
Anurag
Join Date: Aug 2014
Location: Germany
Posts: 57
Rep Power: 11
anuragm is on a distinguished road
Many thanks for the detailed explanation. I really appreciate it.
anuragm 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
The FOAM Documentation Project - SHUT-DOWN holger_marschall OpenFOAM 242 March 7, 2013 12:30
How to make code run in parallel? cwang5 OpenFOAM Programming & Development 1 May 30, 2011 04:47
Open Source Vs Commercial Software MechE OpenFOAM 28 May 16, 2011 11:02
Small 3-D code Zdravko Stojanovic Main CFD Forum 2 July 19, 2010 10:11
Design Integration with CFD? John C. Chien Main CFD Forum 19 May 17, 2001 15:56


All times are GMT -4. The time now is 09:28.