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 Members List Search Today's Posts Mark Forums Read

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
Member
 
Join Date: Jun 2016
Posts: 93
Rep Power: 8
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: 563
Rep Power: 19
Yann 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

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
Wind turbine simulation Saturn CFX 58 July 3, 2020 02:13
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 07:43.