|
[Sponsors] |
August 16, 2010, 09:15 |
limit variable
|
#1 | |
Senior Member
Join Date: Jan 2010
Location: Stuttgart
Posts: 150
Rep Power: 16 |
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 |
||
August 16, 2010, 09:45 |
|
#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; } |
|
August 16, 2010, 10:02 |
|
#3 | |
Senior Member
Join Date: Jan 2010
Location: Stuttgart
Posts: 150
Rep Power: 16 |
Hi,
sorry I forgot the error message! Here it is: Quote:
|
||
September 1, 2010, 04:08 |
problem is solved
|
#4 |
Senior Member
Join Date: Jan 2010
Location: Stuttgart
Posts: 150
Rep Power: 16 |
My problem is still existing. Any ideas?
Last edited by Chrisi1984; September 1, 2010 at 07:46. |
|
September 1, 2010, 05:04 |
|
#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?
|
|
September 1, 2010, 07:47 |
|
#6 |
Senior Member
Join Date: Jan 2010
Location: Stuttgart
Posts: 150
Rep Power: 16 |
Sorry!
I am wrong. I did not solve the problem. I wanted to write this below an other thread!! Regards Chrisi |
|
September 6, 2010, 06:04 |
|
#7 | |
Senior Member
Join Date: Jan 2010
Location: Stuttgart
Posts: 150
Rep Power: 16 |
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 |
||
September 6, 2010, 09:34 |
|
#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?
|
|
September 7, 2010, 09:33 |
|
#9 |
Senior Member
Join Date: Jan 2010
Location: Stuttgart
Posts: 150
Rep Power: 16 |
You are right off course the loop over the cell zones is unnecessary!
Regards Chrisi |
|
September 17, 2010, 01:53 |
|
#10 |
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36 |
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. |
|
September 17, 2010, 04:44 |
|
#11 | |
Senior Member
Join Date: Jan 2010
Location: Stuttgart
Posts: 150
Rep Power: 16 |
Thank you for your suggestion.
But with T.max(300); I get this error: Quote:
|
||
September 17, 2010, 05:02 |
|
#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).
|
|
September 17, 2010, 05:39 |
|
#13 | |
Senior Member
Join Date: Jan 2010
Location: Stuttgart
Posts: 150
Rep Power: 16 |
Hi
I tried this too, but this also results in errors during compiling. Quote:
|
||
September 17, 2010, 11:29 |
|
#14 |
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36 |
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. |
|
February 19, 2019, 15:54 |
|
#15 | |||||
Senior Member
Hojatollah Gholami
Join Date: Jan 2019
Posts: 171
Rep Power: 7 |
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 02:55. |
||||||
February 23, 2019, 01:11 |
|
#16 | |
Senior Member
Hojatollah Gholami
Join Date: Jan 2019
Posts: 171
Rep Power: 7 |
I also test
Quote:
|
||
February 23, 2019, 01:13 |
|
#17 |
Senior Member
Hojatollah Gholami
Join Date: Jan 2019
Posts: 171
Rep Power: 7 |
Dear Chrisi1984
Did you solve this problem? Last edited by Hgholami; February 23, 2019 at 06:02. |
|
March 5, 2019, 10:00 |
|
#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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to limit a variable | ash | OpenFOAM Running, Solving & CFD | 1 | June 26, 2008 21:32 |
error in COMSOL:'ERROR:6164 Duplicate Variable' | bhushas | COMSOL | 1 | May 30, 2008 05:35 |
limit for a variable | Luis | CFX | 5 | February 12, 2008 06:55 |
Env variable not set | gruber2 | OpenFOAM Installation | 5 | December 30, 2005 05:27 |
Replace periodic by inlet-outlet pair | lego | CFX | 3 | November 5, 2002 21:09 |