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

rho Constructor interFoam for creating a varying rho field

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 3 Post By santiagomarquezd

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 15, 2015, 11:24
Question rho Constructor interFoam for creating a varying rho field
  #1
Member
 
ali alkebsi
Join Date: Jan 2012
Location: Strasbourg, France
Posts: 82
Rep Power: 14
kebsiali is on a distinguished road
Hello Dear Foamers

I have a simple question
in interFoam in createFields.H the rho is constructed as

volScalarField rho
(
IOobject
(
"rho",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT
),
alpha1*rho1 + alpha2*rho2,
alpha1.boundaryField().types()
);
rho.oldTime();


my question is what do the last couple of commands do
1. alpha1.boundaryField().types()
2. rho.oldTime();


I'm trying to implement a variable rho1 and I'm comparing interFoam with compressibleInterFoam the later does not have those two commands which is why i was wondering, i have nearly 20 self made constructors which are created randomly (without knowing if i have to add somthing like blabla.oldTime(); or blabla.boundaryFiled().types() or not)
kebsiali is offline   Reply With Quote

Old   April 16, 2015, 11:24
Default
  #2
Member
 
ali alkebsi
Join Date: Jan 2012
Location: Strasbourg, France
Posts: 82
Rep Power: 14
kebsiali is on a distinguished road
please!
any response, suggestions ?
kebsiali is offline   Reply With Quote

Old   April 17, 2015, 05:07
Question Varying rho
  #3
Member
 
ali alkebsi
Join Date: Jan 2012
Location: Strasbourg, France
Posts: 82
Rep Power: 14
kebsiali is on a distinguished road
Hello everybody

I'm working with interFoam and i want to make a varibal phase density
for this task i started by constructing a volScalarField in creatFields as

volScalarField rhof
(
IOobject
(
"rhof",
runTime.timeName(),
mesh,
IOobject::NO_READ
),
mesh
);

before i put some equation instead of "mesh" but it didnt work because

when i call this rhof into the library incompressibleTwoPhaseMixture.C using
const volScalarField& rhof=U_.mesh().lookupObject<volScalarField>("rhof" );
so that rhof takes place of rho1
now the problem reported by terminal is that rhof is not an object of mesh
this appears when i execute the case as it gives other suggestions that are useable objects and all of them are those for which in the constructor it is as the one shown above with mesh as the last line.

now using this constructor shown above with mesh in the last line so that rhof can be callabe the code searches for a boundary condition for rhof

am i going in the right way or should i just delete everything and give up, nah just joking.

any suggestions are heartfully wellcome
kebsiali is offline   Reply With Quote

Old   March 18, 2016, 15:14
Default
  #4
Senior Member
 
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 15
babakflame is on a distinguished road
Quote:
Originally Posted by kebsiali View Post
Hello Dear Foamers

I have a simple question
in interFoam in createFields.H the rho is constructed as

volScalarField rho
(
IOobject
(
"rho",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT
),
alpha1*rho1 + alpha2*rho2,
alpha1.boundaryField().types()
);
rho.oldTime();


my question is what do the last couple of commands do
1. alpha1.boundaryField().types()
2. rho.oldTime();


I'm trying to implement a variable rho1 and I'm comparing interFoam with compressibleInterFoam the later does not have those two commands which is why i was wondering, i have nearly 20 self made constructors which are created randomly (without knowing if i have to add somthing like blabla.oldTime(); or blabla.boundaryFiled().types() or not)
Hi Fellows

Any progress in this question?

I have the same question.
babakflame is offline   Reply With Quote

Old   April 16, 2016, 20:28
Default
  #5
Senior Member
 
santiagomarquezd's Avatar
 
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 452
Rep Power: 23
santiagomarquezd will become famous soon enough
Quote:
Originally Posted by kebsiali View Post
Hello Dear Foamers

I have a simple question
in interFoam in createFields.H the rho is constructed as

volScalarField rho
(
IOobject
(
"rho",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT
),
alpha1*rho1 + alpha2*rho2,
alpha1.boundaryField().types()
);
rho.oldTime();


my question is what do the last couple of commands do
1. alpha1.boundaryField().types()
2. rho.oldTime();


I'm trying to implement a variable rho1 and I'm comparing interFoam with compressibleInterFoam the later does not have those two commands which is why i was wondering, i have nearly 20 self made constructors which are created randomly (without knowing if i have to add somthing like blabla.oldTime(); or blabla.boundaryFiled().types() or not)
Hi, Kebsiali, regarding these:

Code:
   42 // Need to store rho for ddt(rho, U)
   43 volScalarField rho
   44 (
   45     IOobject
   46     (
   47         "rho",
   48         runTime.timeName(),
   49         mesh,
   50         IOobject::READ_IF_PRESENT
   51     ),
   52     alpha1*rho1 + alpha2*rho2,
   53     alpha1.boundaryField().types()
   54 );
   55 rho.oldTime();
in createFields.H alpha1.boundaryField().types() implies copying the boundary conditions from alpha1, and rho.oldTime() forces to call the storeOldTimes() method in order to set the old time field required by ddt(rho, U) as is indicated in 42.

Regards!
kaifu, babakflame and meshman like this.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D.
Research Scientist
Research Center for Computational Methods (CIMEC) - CONICET/UNL
Tel: 54-342-4511594 Int. 7032
Colectora Ruta Nac. 168 / Paraje El Pozo
(3000) Santa Fe - Argentina.
http://www.cimec.org.ar
santiagomarquezd 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
problems after decomposing for running alessio.nz OpenFOAM 7 March 5, 2021 04:49
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
Error log vw.cfd OpenFOAM 6 August 7, 2009 05:44
How to set a time varying velocity field as a BC? Mikro OpenFOAM Pre-Processing 5 March 19, 2009 04:38
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 06:51


All times are GMT -4. The time now is 08:16.