User experience - Default constraints

A subforum specific to the development of the OpenFoam-based workbenches ( Cfd https://github.com/qingfengxia/Cfd and CfdOF https://github.com/jaheyns/CfdOF )

Moderator: oliveroxtoby

Post Reply
User avatar
Roland
Posts: 333
Joined: Fri Aug 21, 2015 2:20 pm

User experience - Default constraints

Post by Roland »

Dear developers of FreeCAD's CfdOF WB,

We have now some experience with your FC WB/OF module. Congratulations with great work! We like to share some user experience.

It was only accidentally that we discovered that the current implementation of "object U" in the 0 folder at solver start by default sets the boundary conditions for unspecified faces at "slip" (so, by default this applies to the non-inlets, not-outlets or otherwise purposely constrained faces). Actually, we had expected those default constraints to be set at a type of "noSlip".

After we became aware of this matter, we repeated all our simulations, by manually editing each just written solver case, before actually running it. In the folder "case/0", we edited the file "U" as follows:

Code: Select all

    defaultFaces
    {
        type        slip;
        value       $internalField;
    }
to read:

Code: Select all

defaultFaces
    {
        type        movingWallVelocity;
        value       uniform (0 0 0);
    }
This is quite a complex workflow, in which errors can be made easily. Do you have suggestions with regard to the solution that we found?

If you agree with our approach, we suggest an option to be added to the WB, forcing the user to make an explicit choice for the constraint settings of the non-specified faces. And to make the editing possible inside the WB, rather than as an escape route in between two actions (between Write Case and Run Solver).

What is your view?

Best regards,

Roland (also on behalf of Sebastiaan)
thschrader
Veteran
Posts: 3129
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: User experience - Default constraints

Post by thschrader »

Why dont you adress all faces of the body with the boundary-conditions you need
before case-writing? After case writing I allways check the dict-files.
When there is a default entry in U-file, for me it is an indicator that i forgot something.
Sooo.. I can live with the current settings.
User avatar
Roland
Posts: 333
Joined: Fri Aug 21, 2015 2:20 pm

Re: User experience - Default constraints

Post by Roland »

@thschrader

Why dont you adress all faces of the body with the boundary-conditions you need
before case-writing?
Well, 98 faces? Of which only 10 or so can be touched / clicked from the outside when in the Task View to select boundary faces? (it's just one example).

Admittedly, one can draw up a bookkeeping system, listing all the faces. But what happens after a small change is made to your model, FreeCAD renaming all the faces ... redo the bookkeeping as well for 99+ (or-) faces again?

Perhaps, I made a proposal that is attractive under some circumstances.

Greetz,

Roland
thschrader
Veteran
Posts: 3129
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: User experience - Default constraints

Post by thschrader »

Roland wrote: Mon May 25, 2020 6:02 pm ...
Well, 98 faces? Of which only 10 or so can be touched...
...
Ok, thats a point. To be honest: my models are much simpler (building, antenna)
Thomas
User avatar
oliveroxtoby
Posts: 812
Joined: Fri Dec 23, 2016 9:43 am
Location: South Africa

Re: User experience - Default constraints

Post by oliveroxtoby »

Roland wrote: Mon May 25, 2020 11:09 am It was only accidentally that we discovered that the current implementation of "object U" in the 0 folder at solver start by default sets the boundary conditions for unspecified faces at "slip" (so, by default this applies to the non-inlets, not-outlets or otherwise purposely constrained faces). Actually, we had expected those default constraints to be set at a type of "noSlip".

After we became aware of this matter, we repeated all our simulations, by manually editing each just written solver case, before actually running it. In the folder "case/0", we edited the file "U" as follows:

Code: Select all

    defaultFaces
    {
        type        slip;
        value       $internalField;
    }
to read:

Code: Select all

defaultFaces
    {
        type        movingWallVelocity;
        value       uniform (0 0 0);
    }
This is quite a complex workflow, in which errors can be made easily. Do you have suggestions with regard to the solution that we found?
There are arguments either way for the default to be slip vs no-slip. It was originally intended to be simply a fall-back rather than used deliberately, but it is true that it can save quite a bit of time.
If you agree with our approach, we suggest an option to be added to the WB, forcing the user to make an explicit choice for the constraint settings of the non-specified faces. And to make the editing possible inside the WB, rather than as an escape route in between two actions (between Write Case and Run Solver).
Yes, I think the ideal would be to add an option in the boundary condition dialog for it to apply to the unselected faces. Then any existing boundary condition could be specified.

Please consider contibuting this change and issuing a pull request on the github project.

Thanks for the feedback!
User avatar
Roland
Posts: 333
Joined: Fri Aug 21, 2015 2:20 pm

Re: User experience - Default constraints

Post by Roland »

Thanks Oliver,
Please consider contributing this change and issuing a pull request on the github project.
I am not a coder. If I were, I would try to make such contribution. For now, my contribution is necessarily limited to sharing my experience, and making a suggestion.

Please accept.

Best regards,

Roland
User avatar
Roland
Posts: 333
Joined: Fri Aug 21, 2015 2:20 pm

Re: User experience - Default constraints

Post by Roland »

Dear FC/CfdOF developers

We discovered some more issues related to the topic of this thread.

Previously we assumed that for creating noSlip conditions for default faces it was sufficient to manually edit the case/0/U file. This was a mistake (for turbulent analyses). The required edits involve also the following files: k, nut, omega, createPatchDict.

Review of required edits

case/system/createPatchDict:

Code: Select all

    {
       name defaultFaces;
        patchInfo
        {
            type wall;
        }
        constructFrom patches;
        patches ( face2 );
    }
case/0/k:

Code: Select all

    defaultFaces
    {
        type        kqRWallFunction;
        value       $internalField;
    }
case/0/nut:

Code: Select all

    defaultFaces
    {
        type        nutkWallFunction;
        value       uniform 0;
    }
case/0/omega:

Code: Select all

    defaultFaces
    {
        type        omegaWallFunction;
        value       $internalField;
    }
case/0/U:

Code: Select all

    defaultFaces
    {
        type        movingWallVelocity;
        value       uniform (0 0 0);
    }
Proposal for adapting the FC GUI

For Menu / CfdOF / Fluid boundary, add tick box (and add the background code to execute this GUI command) as shown in the attached picture (note that selected boundary type and sub-type are mere accidental examples).
FC GUI adaptation.png
FC GUI adaptation.png (15.99 KiB) Viewed 6909 times
Roland/Sebastiaan
User avatar
oliveroxtoby
Posts: 812
Joined: Fri Dec 23, 2016 9:43 am
Location: South Africa

Re: User experience - Default constraints

Post by oliveroxtoby »

oliveroxtoby wrote: Wed May 27, 2020 9:10 am
Roland wrote: Mon May 25, 2020 11:09 am If you agree with our approach, we suggest an option to be added to the WB, forcing the user to make an explicit choice for the constraint settings of the non-specified faces. And to make the editing possible inside the WB, rather than as an escape route in between two actions (between Write Case and Run Solver).
Yes, I think the ideal would be to add an option in the boundary condition dialog for it to apply to the unselected faces. Then any existing boundary condition could be specified.

Please consider contibuting this change and issuing a pull request on the github project.

Thanks for the feedback!
Roland wrote: Mon Jun 01, 2020 10:13 am For Menu / CfdOF / Fluid boundary, add tick box (and add the background code to execute this GUI command) as shown in the attached picture (note that selected boundary type and sub-type are mere accidental examples).

FC GUI adaptation.png

Roland/Sebastiaan
This has now been done.
thschrader
Veteran
Posts: 3129
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: User experience - Default constraints

Post by thschrader »

oliveroxtoby wrote: Fri Aug 13, 2021 9:40 am ...
This has now been done.
FYI:
Just updated cfdof-wb/cfmesh/Hisa.
Installation works, cfmesh works, hisa works.
Thumbs up :)

System:
bluecfd-2020 and
OS: Windows 10 Version 1909
Word size of FreeCAD: 64-bit
Version: 0.20.25065 (Git)
Build type: Release
Branch: master
Hash: 4de2ad46b2b9c78ac2721a0dbea7c19306261095
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: German/Germany (de_DE)
Post Reply