CFD Online URL
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

Please help me specify the Desity and viscosity for each cell

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

Reply
 
LinkBack Thread Tools Display Modes
Old   December 4, 2005, 22:20
Default Dear all: I am eager to you
  #1
Senior Member
 
Guoxiang
Join Date: Mar 2009
Posts: 109
Rep Power: 7
liugx212 is on a distinguished road
Dear all:

I am eager to your help because I am a new learner in openfoam. I have a trouble that how to control the desity and viscosity for each cell for several days. So could you please give some advice and help?

my try to give code as:
scalarField& nuInternal = nu.internalField();
const scalarfield& nuInternal = nu.internalField();
forAll (nuInternal, celli)
{
}

Thanks deeply,
Guoxiang
liugx212 is offline   Reply With Quote

Old   December 4, 2005, 22:32
Default you can make: forAll(nu,cellI
  #2
Member
 
olivier Petit
Join Date: Mar 2009
Location: Göteborg, Sweden
Posts: 67
Rep Power: 7
olivier is on a distinguished road
you can make:
forAll(nu,cellI)
{
nu[cellI]=...
}
so you can change the value of nu in each cell.

enjoy
olivier is offline   Reply With Quote

Old   December 4, 2005, 22:54
Default Dear olivier baily: Thanks
  #3
Senior Member
 
Guoxiang
Join Date: Mar 2009
Posts: 109
Rep Power: 7
liugx212 is on a distinguished road
Dear olivier baily:

Thanks for your help!
Yes, I have tried just now. But there are some errors as follows. Also, I think the "rho", "E" are specified as the same way, right?

Again, Thanks and have great day.

Guoxiang


errors:

stressedFoam.C:115: error: 'scalarField' was not declared in this scope
stressedFoam.C:115: error: 'nuInternal' was not declared in this scope
stressedFoam.C:115: error: 'struct Foam::dimensionedScalar' has no member named 'internalField'
stressedFoam.C:116: error: expected initializer before '&' token


115: scalarField& nuInternal = nu.internalField();
116: const scalarfield& nuInternal = nu.internalField();
liugx212 is offline   Reply With Quote

Old   December 4, 2005, 23:49
Default You can't use internalField f
  #4
Member
 
olivier Petit
Join Date: Mar 2009
Location: Göteborg, Sweden
Posts: 67
Rep Power: 7
olivier is on a distinguished road
You can't use internalField function to a scalarField but you can use it with the volScalarField..
for each sacalarField you can change the value in the cell with the same way.
---
olivier
olivier is offline   Reply With Quote

Old   December 5, 2005, 02:35
Default Dear olivier baily: Sorry t
  #5
Senior Member
 
Guoxiang
Join Date: Mar 2009
Posts: 109
Rep Power: 7
liugx212 is on a distinguished road
Dear olivier baily:

Sorry to bore you again. I really a new comer so I have some questions. please do not mind me.

As you said, I modified as:
115: const volScalarField& nuInternal = nu.internalField();
116: forAll (nuInternal, celli)
117: {
118: nuInternal[celli] = 1;
119: }

But I was told as follows:
115: struct Foam::dimensionedScalar has no member named internalField
118: error: assignment of read-only location


Could you please give help again.
Thanks and sorry to bore you.
Guoxiang
liugx212 is offline   Reply With Quote

Old   December 5, 2005, 06:13
Default Try (haven't tried it myself):
  #6
Super Moderator
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,416
Rep Power: 15
mattijs is on a distinguished road
Try (haven't tried it myself):

scalarField& nuInternal = nu.internalField();

forAll (nuInternal, celli)
{
nuInternal[celli] = 1;
}
mattijs is offline   Reply With Quote

Old   December 5, 2005, 11:20
Default Dear Mattijs Janssens: Than
  #7
Senior Member
 
Guoxiang
Join Date: Mar 2009
Posts: 109
Rep Power: 7
liugx212 is on a distinguished road
Dear Mattijs Janssens:

Thanks for your help. There was said that:
error: 'struct Foam::dimensionedScalar' has no member named 'internalField'
for this line:
scalarField& nuInternal = nu.internalField();

I am findind where is error. Could you please give help again.

Thanks deeply,
Guoxiang
liugx212 is offline   Reply With Quote

Old   December 5, 2005, 12:30
Default Dear all: I am eager to get
  #8
Senior Member
 
Guoxiang
Join Date: Mar 2009
Posts: 109
Rep Power: 7
liugx212 is on a distinguished road
Dear all:

I am eager to get your help.
Please help me see the code again since I have no ideas to debug this.

// set the nu for each cell
116: volScalarField& nuInternal = nu.internalField();
forAll (nuInternal, celli)
{
if (componentValue[celli] > 0)
nuInternal[celli] = 0.3;
else nuInternal[celli] = 0.1;
}
// set the rho for each cell
125: volScalarField& rhoInternal = rho.internalField();
forAll (rhoInternal, celli)
{
if (componentValue[celli] > 0)
rhoInternal[celli] = 2000000;
else rhoInternal[celli] = 20000;
}

// set the E for each cell
134: volScalarField& EInternal = E.internalField();
forAll (EInternal, celli)
{
if (componentValue[celli] > 0)
EInternal[celli] = 7854;
else EInternal[celli] = 1000;
}

Error as:

stressedFoam.C:116: error: 'struct Foam::dimensionedScalar' has no member named 'internalField'
stressedFoam.C:125: error: 'struct Foam::dimensionedScalar' has no member named 'internalField'
stressedFoam.C:134: error: 'E' was not declared in this scope
stressedFoam.C:134: error: '<typeprefixerror>E' previously declared here



Thanks deeply,
Guoxiang
liugx212 is offline   Reply With Quote

Old   December 5, 2005, 16:28
Default Daer All: Please give piece
  #9
Senior Member
 
Guoxiang
Join Date: Mar 2009
Posts: 109
Rep Power: 7
liugx212 is on a distinguished road
Daer All:

Please give pieces of advice and help.

Thanks,
Guoxiang
liugx212 is offline   Reply With Quote

Old   December 8, 2005, 12:58
Default Dear all: I still not get s
  #10
Senior Member
 
Guoxiang
Join Date: Mar 2009
Posts: 109
Rep Power: 7
liugx212 is on a distinguished road
Dear all:

I still not get sucess. Could you please give some advice and help.

Thanks a lot.

Guoxiang
liugx212 is offline   Reply With Quote

Old   December 9, 2005, 06:11
Default dear Guoxiang, i am sorry t
  #11
Member
 
VVqf
Join Date: Mar 2009
Location: Braunschweig
Posts: 66
Rep Power: 7
vvqf is on a distinguished road
dear Guoxiang,

i am sorry to say it, but you do need do more programming. Check your src file, whether all needed .inc files are included. go into the error, locate and fix it.

if you don't get answer anymore, either it's too basic, or too difficult that nobody can answer.
vvqf is offline   Reply With Quote

Old   April 29, 2008, 05:42
Default The advice above, I've used th
  #12
New Member
 
Christian Andersen
Join Date: Mar 2009
Location: Aalborg, Denmark
Posts: 8
Rep Power: 7
christian_andersen is on a distinguished road
The advice above, I've used this for a Eddy-Break-up model for combustion.

It works fine when run on 1 CPU, but when I try to run it parallel - it fails!

Any advice? Does anyone know what the problem is?

Best
Christian Andersen
christian_andersen is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
turbulent viscosity limited to viscosity ratio Elizabeth FLUENT 13 December 16, 2014 09:57
turbulent viscosity limited to viscosity ratio... frank FLUENT 17 March 31, 2013 15:04
Turbulent viscosity Limited to viscosity ratio Adrian FLUENT 12 September 21, 2011 05:22
"turbulent viscosity limited to viscosity ratio" olivier FLUENT 9 May 14, 2008 10:48
turbulent viscosity limited to viscosity ratio of Hua FLUENT 6 April 24, 2003 17:45


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