CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

How to override boundary condition type to zeroGradient

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 30, 2022, 18:08
Default How to override boundary condition type to zeroGradient
  #1
Senior Member
 
Join Date: Jun 2016
Posts: 102
Rep Power: 10
xuegy is on a distinguished road
Hello all,

I need to override the following boundary condition to "zeroGradient":
Code:
sidewall
    {
     	type            calculated;
        value           nonuniform List<scalar>
1914
(l�(��K���MTOd8���o?����>��^QɐѠ>�A�*Gļ��^]q�ˇ��(�Z�m���p�^?��㳾p�^^|A���PR�9���$
....
and I've tried these ways:
1. Manually edit the file. It works, but I want to do it automatically.
2. Use setExprBoundaryFields utility
Code:
pattern
{
    field   N1;
    expressions
    (
        {
            patch   sidewall;
            target  type;
            expression zeroGradient;
        }
    );
    keepPatches  true;
}
gives me
Code:
Processing field N1


--> FOAM FATAL IO ERROR: (openfoam-2112)
Wrong token type - expected string, found on line 25: word 'zeroGradient'

file: system/setExprBoundaryFieldsDict.pattern.expressions.expression at line 26.

    From Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::string&)
    in file primitives/strings/string/stringIO.C at line 53.

FOAM exiting
3. Use funkySetBoundaryField utility
Code:
Stress
{
    field N1;
    expressions
    (
        {
            patchName  sidewall;
            target     type;
            expression zeroGradient;
        }
    );
}
gives me (basically the same error)
Code:
Part: Stress working on field N1


--> FOAM FATAL IO ERROR: (openfoam-2112)
Wrong token type - expected string, found on line 25: word 'zeroGradient'

file: system/funkySetBoundaryDict.Stress.expressions.expression at line 25.

    From Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::string&)
    in file primitives/strings/string/stringIO.C at line 53.

FOAM exiting
From here, https://develop.openfoam.com/Develop.../-/issues/1762
Quote:
upcasting of word to string/fileName was added August-2019.
So is that a bug? or are these utilities simply can't change the boundary type?

Many thanks.
xuegy is offline   Reply With Quote

Old   October 3, 2022, 04:51
Default
  #2
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,238
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
Hi,

It sounds like a job for changeDictionary: https://www.openfoam.com/documentati...ictionary.html

Cheers,
Yann
Yann is offline   Reply With Quote

Reply


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
Wind turbine simulation Saturn CFX 60 July 17, 2024 06:45
Wrong flow in ratating domain problem Sanyo CFX 17 August 15, 2015 07:20
Question about heat transfer coefficient setting for CFX Anna Tian CFX 1 June 16, 2013 07:28
[swak4Foam] Air Conditioned room groovyBC Sebaj OpenFOAM Community Contributions 7 October 31, 2012 15:16
Pressure instability with rhoSimpleFoam daniel_mills OpenFOAM Running, Solving & CFD 44 February 17, 2011 18:08


All times are GMT -4. The time now is 21:35.