|
[Sponsors] |
![]() |
![]() |
#1 | |
Senior Member
Join Date: Jan 2010
Location: Stuttgart
Posts: 150
Rep Power: 17 ![]() |
Hi all,
I want to limit the temperature. That mean that every value where T is smaller than 300K, should be set to 300K after every iteration. I thought something like this: Quote:
Can anyone help me? Best regards Chrisi |
||
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30 ![]() |
Without mentioning your error, you are looking for someone with psychic powers to help you... Anyways, I think the following code fragment would make more sense:
Code:
forAll(cells, iCells) { const label cellId = cells[iCells]; if (T[cellId] < 300) T[cellId]=300; } |
|
![]() |
![]() |
![]() |
![]() |
#3 | |
Senior Member
Join Date: Jan 2010
Location: Stuttgart
Posts: 150
Rep Power: 17 ![]() |
Hi,
sorry I forgot the error message! Here it is: Quote:
|
||
![]() |
![]() |
![]() |
![]() |
#4 |
Senior Member
Join Date: Jan 2010
Location: Stuttgart
Posts: 150
Rep Power: 17 ![]() |
My problem is still existing. Any ideas?
Last edited by Chrisi1984; September 1, 2010 at 06:46. |
|
![]() |
![]() |
![]() |
![]() |
#5 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30 ![]() |
Would you share it so that people can learn from this thread?
|
|
![]() |
![]() |
![]() |
![]() |
#6 |
Senior Member
Join Date: Jan 2010
Location: Stuttgart
Posts: 150
Rep Power: 17 ![]() |
Sorry!
I am wrong. I did not solve the problem. I wanted to write this below an other thread!! Regards Chrisi |
|
![]() |
![]() |
![]() |
![]() |
#7 | |
Senior Member
Join Date: Jan 2010
Location: Stuttgart
Posts: 150
Rep Power: 17 ![]() |
Hi,
Now I really found a possibility to limit the temperature. Quote:
I did this because h is approximately cp*T. Perhabs it helps somebody. Regardy Chrisi |
||
![]() |
![]() |
![]() |
![]() |
#8 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30 ![]() |
Why loop through the cellZones within the cellZone loop?
|
|
![]() |
![]() |
![]() |
![]() |
#9 |
Senior Member
Join Date: Jan 2010
Location: Stuttgart
Posts: 150
Rep Power: 17 ![]() |
You are right off course the loop over the cell zones is unnecessary!
Regards Chrisi |
|
![]() |
![]() |
![]() |
![]() |
#10 |
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 37 ![]() ![]() |
Hmm, why not a simple
T.max(300); P.S. Yes, max, it is not a typo. The max method is equivalent to max(T,300) looped over all cells. P.P.S. I have no idea why you are doing this, but it might make your energy equation unhappy :-)
__________________
Alberto Passalacqua GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541) OpenQBMM - An open-source implementation of quadrature-based moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. ![]() |
|
![]() |
![]() |
![]() |
![]() |
#11 | |
Senior Member
Join Date: Jan 2010
Location: Stuttgart
Posts: 150
Rep Power: 17 ![]() |
Thank you for your suggestion.
But with T.max(300); I get this error: Quote:
|
||
![]() |
![]() |
![]() |
![]() |
#12 |
Senior Member
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30 ![]() |
From your previous post I'm guessing you don't have an object T, since you used thermo.T. So you could try using thermo.T.max(300).
|
|
![]() |
![]() |
![]() |
![]() |
#13 | |
Senior Member
Join Date: Jan 2010
Location: Stuttgart
Posts: 150
Rep Power: 17 ![]() |
Hi
I tried this too, but this also results in errors during compiling. Quote:
|
||
![]() |
![]() |
![]() |
![]() |
#14 |
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 37 ![]() ![]() |
The correct syntax would be
thermo().T().max(300) but T is returned only as const, so it cannot be modified at this stage. You can either define a second method to return T without the const qualifier, or edit the thermo code and introduce the limitation there. Both solutions see quite messy ![]()
__________________
Alberto Passalacqua GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541) OpenQBMM - An open-source implementation of quadrature-based moment methods. To obtain more accurate answers, please specify the version of OpenFOAM you are using. ![]() |
|
![]() |
![]() |
![]() |
![]() |
#15 | |||||
Senior Member
Hojatollah Gholami
Join Date: Jan 2019
Posts: 171
Rep Power: 8 ![]() |
Dear Alberto
I add simple energy equation to icoFluid solver in OF-ext4.0 as: Quote:
Quote:
I also use Quote:
Quote:
Also I should note: Quote:
Last edited by Hgholami; February 20, 2019 at 01:55. |
||||||
![]() |
![]() |
![]() |
![]() |
#16 | |
Senior Member
Hojatollah Gholami
Join Date: Jan 2019
Posts: 171
Rep Power: 8 ![]() |
I also test
Quote:
|
||
![]() |
![]() |
![]() |
![]() |
#17 |
Senior Member
Hojatollah Gholami
Join Date: Jan 2019
Posts: 171
Rep Power: 8 ![]() |
Dear Chrisi1984
Did you solve this problem? Last edited by Hgholami; February 23, 2019 at 05:02. |
|
![]() |
![]() |
![]() |
![]() |
#18 |
Senior Member
Olivier
Join Date: Jun 2009
Location: France, grenoble
Posts: 272
Rep Power: 18 ![]() |
hello,
Now (2 year old...) you can use energyTransport function object on incompressible flow (see https://www.openfoam.com/releases/op...nd-physics.php) and also from even more years, limit T in fvOption file with "limitTemperature" type. Code:
limitT { type limitTemperature; active yes; selectionMode all; min 200; max 500; phase gas; //optional } olivier |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to limit a variable | ash | OpenFOAM Running, Solving & CFD | 1 | June 26, 2008 20:32 |
error in COMSOL:'ERROR:6164 Duplicate Variable' | bhushas | COMSOL | 1 | May 30, 2008 04:35 |
limit for a variable | Luis | CFX | 5 | February 12, 2008 05:55 |
Env variable not set | gruber2 | OpenFOAM Installation | 5 | December 30, 2005 04:27 |
Replace periodic by inlet-outlet pair | lego | CFX | 3 | November 5, 2002 20:09 |