|
[Sponsors] |
![]() |
![]() |
#1 |
New Member
Join Date: Feb 2016
Posts: 13
Rep Power: 10 ![]() |
Hello everyone,
I would want to set non-uniform values to the temperature field to selected cells. I suppose I may use fixedFieldValueConstraint in the fvOptions, as fixedTValues { type scalarFixedValueConstraint; active yes; selectionMode cellSet; cellSet myCellsSet; fieldValues { T 0.1; } } Is it possible to replace the constant "1.0" by a function of the cell positions ? Is it even possible to replace it by a time-dependent function ? Than you for your help ! Fanny |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 51 ![]() ![]() ![]() |
Simply. Yesno. What you can do is:
So probably you go with option #3. The only thing you need to do is to use setSet or topoSet to create the cellZone. The cellZone contains all cells you want to manipulate. To the other questions: I cannot find any number named 1.0. In the latest Foundation version (v9) you can apply a «function1» to the values of the cells and make it "what-ever" dependent. Code:
fixedTemperature { type fixedTemperatureConstraint; selectionMode all; phase gas; // Optional phase name // Uniform temperature constraint mode uniform; temperature constant 500; // Uniform temperature << you can make it TIME dependent // // Looked-up field temperature constraint // T T; // Temperature field name }
__________________
Keep foaming, Tobias Holzmann |
|
![]() |
![]() |
![]() |
![]() |
#3 |
New Member
Join Date: Feb 2016
Posts: 13
Rep Power: 10 ![]() |
Hi Tobi, and thank you very much for your reply.
Actually my variable T is not the temperature, but a scalar field I want to transport. (I can be anything, it doesn't mind). So I have a T-equation (the transport one) but no energy equation. Thus, I suppose I can not use fixedTemperatureConstraint, but I should use scalarFixedValueConstraint, isn't it ? I would want to write something like: Code:
fixedTValues { type scalarFixedValueConstraint; active yes; selectionMode cellSet; cellSet myCellsSet; fieldValues { T 0.1 * t * x ; } } Thanks Fanny Last edited by Tobi; September 15, 2021 at 09:13. Reason: Modified by Tobi: Added code tags |
|
![]() |
![]() |
![]() |
![]() |
#4 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 51 ![]() ![]() ![]() |
Ah okay, a passive scalar or any other field can be handled by using the other one. The special stuff about the temperature... guy is that it is directly applied to the enthalpy equation and you don't have to think about anything else.
I just checked the Foundation version v9 and the scalar... guy. It seems that you cannot use a time-dependency here as the entries are not of function1. Code:
porosityTurbulence { type fixedValueConstraint; selectionMode cellZone; cellZone porosity; fieldValues { k 1; epsilon 150; } } Code:
//- Field values HashPtrTable<objectFunction1> fieldValues_; Code:
fixedTValues { type scalarFixedValueConstraint; active yes; selectionMode cellSet; cellSet myCellsSet; fieldValues { T constan 34; // write constant wrong such as constan ... } }
__________________
Keep foaming, Tobias Holzmann |
|
![]() |
![]() |
![]() |
![]() |
#5 |
New Member
Join Date: Feb 2016
Posts: 13
Rep Power: 10 ![]() |
I am using the OF version v7.
Yes I had tried the "banana" method : fixedTValues { type scalarFixedValueConstraint; active yes; selectionMode cellSet; cellSet myCellsSet; fieldValues { T banana 34; } } returns --> FOAM FATAL IO ERROR: wrong token type - expected Scalar, found on line 28 the word 'banana' It seems that there is no other option than to input a scalar number. ![]() pre.cjk { font-family: "Nimbus Mono L", monospace } p { margin-bottom: 0.1in; line-height: 120% } |
|
![]() |
![]() |
![]() |
![]() |
#6 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 51 ![]() ![]() ![]() |
Its related to the fact that in v7 its not implemented as <Function1>:
Code:
// Private member data //- Field values List<Type> fieldValues_; Hence, its not possible to use it. Two options:
__________________
Keep foaming, Tobias Holzmann |
|
![]() |
![]() |
![]() |
![]() |
#7 |
New Member
Join Date: Feb 2016
Posts: 13
Rep Power: 10 ![]() |
OK. Thank you very much.
|
|
![]() |
![]() |
![]() |
![]() |
#8 |
New Member
Jarlath
Join Date: Apr 2018
Posts: 12
Rep Power: 8 ![]() |
Is there a ScalarMaxValueConstraint option?
The ScalarFixedValueConstraint sets the scalar to a fixed, non-changing value, right? |
|
![]() |
![]() |
![]() |
![]() |
#9 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 51 ![]() ![]() ![]() |
Correct, yes.
The ESI-OpenCFD version v2306 (openfoam.com) does not have such an fvOption. But you can simply derive it from, e.g., this one: https://gitlab.com/openfoam/openfoam...tTemperature.H If you use the cfd.direct version (openfoam.org), there is a function for that called limitMag: https://github.com/OpenFOAM/OpenFOAM...Mag/limitMag.H In principle you can also use the limitMag and compile it against ESI-OpenCFD version while resolving potential compiling issues based on naming convention changes or so on. Cheers, Tobi
__________________
Keep foaming, Tobias Holzmann |
|
![]() |
![]() |
![]() |
![]() |
#10 |
New Member
Jarlath
Join Date: Apr 2018
Posts: 12
Rep Power: 8 ![]() |
I think you had a typo!
The ESI-OpenCFD version v2306 (openfoam.com) does have such an fvOption https://www.openfoam.com/news/main-n...rs-and-physics |
|
![]() |
![]() |
![]() |
![]() |
#11 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 51 ![]() ![]() ![]() |
I don't get your statement, there does not exist a `scalarMinMax` fvOption for the ESI-OpenCFD version. The one you are referring to is only for the turbulent viscosity.
__________________
Keep foaming, Tobias Holzmann |
|
![]() |
![]() |
![]() |
![]() |
#12 |
New Member
Jarlath
Join Date: Apr 2018
Posts: 12
Rep Power: 8 ![]() |
Ahhh....you are correct. I got ahead of myself
I was specifically looking for an nuT limiter, which is now available, but the thread is about Scalar Limiters in general Thanks for the correction |
|
![]() |
![]() |
![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Openfoam Turbulent Car Simulation | meganrw | OpenFOAM Running, Solving & CFD | 0 | July 5, 2021 15:50 |
Film cooling problem | arun1994 | OpenFOAM | 0 | October 26, 2020 09:08 |
rSF: p divergence in combustor (wt negative value) | zonda | OpenFOAM Pre-Processing | 4 | April 10, 2018 06:59 |
[swak4Foam] Air Conditioned room groovyBC | Sebaj | OpenFOAM Community Contributions | 7 | October 31, 2012 14:16 |
Need help with boundary conditions: open to atmosphere | Wolle | OpenFOAM | 2 | April 11, 2011 07:32 |