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

modified stochasticDispersionRAS

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

Like Tree1Likes
  • 1 Post By CGuaq

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 15, 2022, 11:22
Default modified stochasticDispersionRAS
  #1
New Member
 
Charles Guaquiere
Join Date: Sep 2022
Posts: 9
Rep Power: 2
CGuaq is on a distinguished road
Hello,

I try to modify stochastic dispersion model on Open FOAM to improved my results concerning particles deposition. I found a tutorial from Chalmers University:

http://www.tfd.chalmers.se/~hani/kur..._Xu_Report.pdf

I changed the stochasticDispersionRAS.C and the stochasticDispersionRAS.H like in the tutorial but it used Open FOAM 4 and I use Open FOAM 9. My problem is on the following part of the code (from line 96 to 103):


const word turbName= IOobject::groupName
(
turbulenceModel:: propertiesName,
this->owner().U().group()
);
const turbulenceModel& turbModel = obr.lookupObject<turbulenceModel>(turbName);


I changed all "turbulenceModel" by "momentumTransportModel" concidering the modifications between Open FOAM 4 et 9 but "propertiesName" is no longer defined in momentumTransportModel.C and momentumTransportModel.H like it was on Open FOAM 4. I don't know how to modify this part of the code to make it works on Open FOAM 9.
I don't have enough experience developing code on OpenFoam yet, so please can someone help me ?

Kind regards,
francois likes this.
CGuaq is offline   Reply With Quote

Old   September 23, 2022, 12:20
Default
  #2
Senior Member
 
Francois Beaubert
Join Date: Mar 2009
Location: Lille, France
Posts: 147
Rep Power: 15
francois is on a distinguished road
Any idea where to find some helpful pointers on this particular point ?
francois is offline   Reply With Quote

Old   September 23, 2022, 23:05
Default
  #3
New Member
 
Chen Xiaoxiao
Join Date: Jun 2018
Location: China
Posts: 6
Rep Power: 6
SmileMax is on a distinguished road
Quote:
Originally Posted by CGuaq View Post
const word turbName= IOobject::groupName
(
turbulenceModel:: propertiesName,
this->owner().U().group()
);
const turbulenceModel& turbModel = obr.lookupObject<turbulenceModel>(turbName);
In fact, turbulenceModel:: propertiesName corresponds to the generic turbulence dictionary name, such as turbulenceProperties in OpenFOAM(.com) or momentumTransport in OpenFOAM(version 8+, .org) , and this->owner().U().group() corresponds to your phase name.

so you can use the following simplified form:

Code:
const word turbName= IOobject::groupName
(
    "momentumTransport.<phase name>"
);
SmileMax is offline   Reply With Quote

Old   September 26, 2022, 06:32
Default
  #4
New Member
 
Charles Guaquiere
Join Date: Sep 2022
Posts: 9
Rep Power: 2
CGuaq is on a distinguished road
Thanks for your reply,

Unfortunatly it does not work, are you sure it is momentumTransport.<phase name> and not momentumTransportModel.<phase name> ? Because OpenFOAM suggested me to use "momentumTransportModel_H" instead of "momentumTransport" when I compile the code.
Also, how can I find my phase name to replace in your simplified form because "phase name" is not declared.
Thank you in advance for your answer
CGuaq is offline   Reply With Quote

Old   September 26, 2022, 07:56
Default
  #5
New Member
 
Chen Xiaoxiao
Join Date: Jun 2018
Location: China
Posts: 6
Rep Power: 6
SmileMax is on a distinguished road
Quote:
Originally Posted by CGuaq View Post
Thanks for your reply,

Unfortunatly it does not work, are you sure it is momentumTransport.<phase name> and not momentumTransportModel.<phase name> ? Because OpenFOAM suggested me to use "momentumTransportModel_H" instead of "momentumTransport" when I compile the code.
Also, how can I find my phase name to replace in your simplified form because "phase name" is not declared.
Thank you in advance for your answer
You'd better be able to provide the error message output by the compiler.
SmileMax is offline   Reply With Quote

Old   September 26, 2022, 09:26
Default
  #6
New Member
 
Charles Guaquiere
Join Date: Sep 2022
Posts: 9
Rep Power: 2
CGuaq is on a distinguished road
Sorry it is my first time on CFD Online.

I think I found the solution by compararing files like shearStress.C or yPlus.C, so I changed my previous code into:


Code:
const word turbName= IOobject::groupName
                (
                    momentumTransportModel::typeName,
                    phaseName_
                );
The error message has disappeared since this modification. But now I have a new error message concerning the following part of the code (line 43 to 55):

Code:
yP_
    	(
    	IOobject
    	(
    	"yP",
    	this->owner_.mesh().time().typeName(),
    	this->owner_.mesh(),
    	IOobject::NO_READ,
    	IOobject::AUTO_WRITE
    	),
    	this->owner_.mesh(),
    	dimensionedScalar("yP", dimless, 0.0)
    	)
This is the error message:
error_message.jpg

i'm not sure what that means.
CGuaq is offline   Reply With Quote

Old   September 26, 2022, 09:33
Default
  #7
New Member
 
Chen Xiaoxiao
Join Date: Jun 2018
Location: China
Posts: 6
Rep Power: 6
SmileMax is on a distinguished road
Quote:
Originally Posted by CGuaq View Post
Sorry it is my first time on CFD Online.

I think I found the solution by compararing files like shearStress.C or yPlus.C, so I changed my previous code into:


Code:
const word turbName= IOobject::groupName
                (
                    momentumTransportModel::typeName,
                    phaseName_
                );
The error message has disappeared since this modification. But now I have a new error message concerning the following part of the code (line 43 to 55):

Code:
yP_
        (
        IOobject
        (
        "yP",
        this->owner_.mesh().time().typeName(),
        this->owner_.mesh(),
        IOobject::NO_READ,
        IOobject::AUTO_WRITE
        ),
        this->owner_.mesh(),
        dimensionedScalar("yP", dimless, 0.0)
        )
This is the error message:
Attachment 91684

i'm not sure what that means.
This seems to be a basic syntax error in the C++ language.
SmileMax is offline   Reply With Quote

Old   September 26, 2022, 10:45
Default
  #8
New Member
 
Charles Guaquiere
Join Date: Sep 2022
Posts: 9
Rep Power: 2
CGuaq is on a distinguished road
Do you have any idea what i can modify to make it works on OpenFOAM 9 ? I tried modifications but nothing works.
thank you in advance
CGuaq 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
[General] Extracting ParaView Data into Python Arrays Jeffzda ParaView 19 June 11, 2020 16:54
Problem while compiling modified simpleFoam solver mattiafc OpenFOAM Programming & Development 0 May 26, 2020 21:01
why in solve(UEqn == -fvc::grad(p)) UEqn.source() is not modified and UEqn.H() chang mAlletto OpenFOAM 1 January 1, 2019 12:59
Modified rhoCentralFoam slip boundary fails in parallel ChrisA OpenFOAM Programming & Development 0 June 25, 2014 21:28
Modified Equation for CFX algorithm Craig Johansen CFX 0 August 28, 2004 00:02


All times are GMT -4. The time now is 06:34.