CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

fvOptions, non-uniform fixedValuesConstraint

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 15, 2021, 08:53
Default fvOptions, non-uniform fixedValuesConstraint
  #1
New Member
 
Join Date: Feb 2016
Posts: 13
Rep Power: 7
fanny is on a distinguished road
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
fanny is offline   Reply With Quote

Old   September 15, 2021, 09:02
Default
  #2
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Augsburg
Posts: 2,597
Blog Entries: 6
Rep Power: 47
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Simply. Yesno. What you can do is:

  • Manipulate the matrix of the solver / field directly by applying a point list and the value - but here you would need to constrain the enthalpy equation (as there is no temperature one)
  • Use the scalarFixedValueConstraint and apply it to the enthalpy equation but again, the constraint values need to be "enthalpy data". Just apply all single points to a cellZone and you are done
  • Use the fixedTemperatureConstraint and directly set the temperature (its equal to the above one but setting the temperature values rather than enthalpy)
  • Use a coded fvOption and do it there (similar to option #1)

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
Tobi is offline   Reply With Quote

Old   September 15, 2021, 10:00
Default
  #3
New Member
 
Join Date: Feb 2016
Posts: 13
Rep Power: 7
fanny is on a distinguished road
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 ;
    }
}
but it does not work, off course - the expression must be input differently but I don t know how..

Thanks
Fanny

Last edited by Tobi; September 15, 2021 at 10:13. Reason: Modified by Tobi: Added code tags
fanny is offline   Reply With Quote

Old   September 15, 2021, 10:19
Default
  #4
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Augsburg
Posts: 2,597
Blog Entries: 6
Rep Power: 47
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
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;                                                    
        }                                                                       
    }
However, in the source code it states:
Code:
        //- Field values                                                        
        HashPtrTable<objectFunction1> fieldValues_;
Therefore, it should be a function1 possibility. Try it by using:
Code:
fixedTValues
{
    type                   scalarFixedValueConstraint;
    active                yes;
    selectionMode  cellSet;
    cellSet               myCellsSet;
    fieldValues
    {
        T     constan 34;   // write constant wrong such as constan ...
    }
}
If it will return an error with possible options, the value is of type «function1» and you have a lot of freedom.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   September 16, 2021, 03:17
Default
  #5
New Member
 
Join Date: Feb 2016
Posts: 13
Rep Power: 7
fanny is on a distinguished road
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% }
fanny is offline   Reply With Quote

Old   September 16, 2021, 03:51
Default
  #6
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Augsburg
Posts: 2,597
Blog Entries: 6
Rep Power: 47
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
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:
  • Update the constrain class
  • Upgrade foam to v9 or v2106
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   September 16, 2021, 04:00
Default
  #7
New Member
 
Join Date: Feb 2016
Posts: 13
Rep Power: 7
fanny is on a distinguished road
OK. Thank you very much.
fanny is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Openfoam Turbulent Car Simulation meganrw OpenFOAM Running, Solving & CFD 0 July 5, 2021 16:50
Film cooling problem arun1994 OpenFOAM 0 October 26, 2020 10:08
rSF: p divergence in combustor (wt negative value) zonda OpenFOAM Pre-Processing 4 April 10, 2018 07:59
[swak4Foam] Air Conditioned room groovyBC Sebaj OpenFOAM Community Contributions 7 October 31, 2012 15:16
Need help with boundary conditions: open to atmosphere Wolle OpenFOAM 2 April 11, 2011 08:32


All times are GMT -4. The time now is 15:47.