|
[Sponsors] |
Please help me specify the Desity and viscosity for each cell |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 4, 2005, 22:20 |
Dear all:
I am eager to you
|
#1 |
Senior Member
Guoxiang
Join Date: Mar 2009
Posts: 109
Rep Power: 17 |
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 |
|
December 4, 2005, 22:32 |
you can make:
forAll(nu,cellI
|
#2 |
Member
olivier Petit
Join Date: Mar 2009
Location: Göteborg, Sweden
Posts: 67
Rep Power: 17 |
you can make:
forAll(nu,cellI) { nu[cellI]=... } so you can change the value of nu in each cell. enjoy |
|
December 4, 2005, 22:54 |
Dear olivier baily:
Thanks
|
#3 |
Senior Member
Guoxiang
Join Date: Mar 2009
Posts: 109
Rep Power: 17 |
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(); |
|
December 4, 2005, 23:49 |
You can't use internalField f
|
#4 |
Member
olivier Petit
Join Date: Mar 2009
Location: Göteborg, Sweden
Posts: 67
Rep Power: 17 |
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 |
|
December 5, 2005, 02:35 |
Dear olivier baily:
Sorry t
|
#5 |
Senior Member
Guoxiang
Join Date: Mar 2009
Posts: 109
Rep Power: 17 |
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 |
|
December 5, 2005, 06:13 |
Try (haven't tried it myself):
|
#6 |
Senior Member
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26 |
Try (haven't tried it myself):
scalarField& nuInternal = nu.internalField(); forAll (nuInternal, celli) { nuInternal[celli] = 1; } |
|
December 5, 2005, 11:20 |
Dear Mattijs Janssens:
Than
|
#7 |
Senior Member
Guoxiang
Join Date: Mar 2009
Posts: 109
Rep Power: 17 |
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 |
|
December 5, 2005, 12:30 |
Dear all:
I am eager to get
|
#8 |
Senior Member
Guoxiang
Join Date: Mar 2009
Posts: 109
Rep Power: 17 |
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 |
|
December 5, 2005, 16:28 |
Daer All:
Please give piece
|
#9 |
Senior Member
Guoxiang
Join Date: Mar 2009
Posts: 109
Rep Power: 17 |
Daer All:
Please give pieces of advice and help. Thanks, Guoxiang |
|
December 8, 2005, 12:58 |
Dear all:
I still not get s
|
#10 |
Senior Member
Guoxiang
Join Date: Mar 2009
Posts: 109
Rep Power: 17 |
Dear all:
I still not get sucess. Could you please give some advice and help. Thanks a lot. Guoxiang |
|
December 9, 2005, 06:11 |
dear Guoxiang,
i am sorry t
|
#11 |
Member
VVqf
Join Date: Mar 2009
Location: Braunschweig
Posts: 66
Rep Power: 17 |
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. |
|
April 29, 2008, 05:42 |
The advice above, I've used th
|
#12 |
New Member
Christian Andersen
Join Date: Mar 2009
Location: Aalborg, Denmark
Posts: 8
Rep Power: 17 |
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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
turbulent viscosity limited to viscosity ratio of | Hua | FLUENT | 7 | September 27, 2019 07:42 |
turbulent viscosity limited to viscosity ratio... | frank | FLUENT | 19 | December 15, 2015 23:54 |
"turbulent viscosity limited to viscosity ratio" | olivier | FLUENT | 11 | October 10, 2015 06:49 |
turbulent viscosity limited to viscosity ratio | Elizabeth | FLUENT | 13 | December 16, 2014 09:57 |
Turbulent viscosity Limited to viscosity ratio | Adrian | FLUENT | 12 | September 21, 2011 05:22 |