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

Could you tell me about the gradU needed when determining the frictional drag?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 22, 2024, 07:00
Default Could you tell me about the gradU needed when determining the frictional drag?
  #1
New Member
 
Join Date: Nov 2022
Posts: 11
Rep Power: 4
fish man is on a distinguished road
Line 242 of force.cpp is used to calculate the frictional drag using the laminar flow model in OpenFOAM.

line 242 of force.cpp
-rho()*laminarT.nu*dev(twoSymm(fvc::grad(U)))

The fvc::grad(U) included in this expression is
postProcess -func “grad(U)”
is the same as the one calculated by postProcess -func “grad(U)”?

Thank you in advance.
fish man is offline   Reply With Quote

Old   August 23, 2024, 09:13
Default
  #2
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
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
Should be yes. The postProcess uses a pre-defined file. Hence we execute the grad function object which indeed does the following (gradTemplate.C):

Code:
template<class Type>
bool Foam::functionObjects::grad::calcGrad()
{
    typedef GeometricField<Type, fvPatchField, volMesh> VolFieldType;
    typedef GeometricField<Type, fvsPatchField, surfaceMesh> SurfaceFieldType;

    if (foundObject<VolFieldType>(fieldName_, false))
    {
        return store
        (
            resultName_,
            fvc::grad(lookupObject<VolFieldType>(fieldName_)),
            mesh_.changing() && mesh_.cache(resultName_)
        );
    }
    else if (foundObject<SurfaceFieldType>(fieldName_, false))
    {
        return store
        (
            resultName_,
            fvc::grad(lookupObject<SurfaceFieldType>(fieldName_)),
            mesh_.changing() && mesh_.cache(resultName_)
        );
    }

    return false;
}
As you can see it is fvc::grad(whatEverField).
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   August 25, 2024, 19:56
Smile
  #3
New Member
 
Join Date: Nov 2022
Posts: 11
Rep Power: 4
fish man is on a distinguished road
Hello
Thank you very much.
I now have a better understanding of "grad".
fish man is offline   Reply With Quote

Old   August 27, 2024, 05:34
Lightbulb
  #4
New Member
 
Join Date: Nov 2022
Posts: 11
Rep Power: 4
fish man is on a distinguished road
grad(U) derived by postProcess -func “grad(U)” and fvc::grad(U) in the source code had an average error of about 2.9 times when comparing values

It would be great if you could tell me why this is....
fish man is offline   Reply With Quote

Old   August 27, 2024, 07:20
Default
  #5
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
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
How you compare the data? How are you checking the grad from source code (what ever you mean here).

Make sure you have the same discretization schemes active
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   August 27, 2024, 21:36
Lightbulb
  #6
New Member
 
Join Date: Nov 2022
Posts: 11
Rep Power: 4
fish man is on a distinguished road
We modified force.c and force.h in
HTML Code:
src/functionObjects/forces/forces
to visualize gradU during analysis.
Then, after the analysis was finished, gradU was derived with
Code:
postProcess -func “grad(U)”
.
The above two gradUs were compared.
fish man is offline   Reply With Quote

Reply

Tags
gradu, openfoam


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
SMALL, GREAT and ROOTVSMALL - what is that? Dommy OpenFOAM Running, Solving & CFD 7 February 20, 2020 10:12
Why is there a great difference between numeca and cfx???? sukiska Fidelity CFD 0 October 12, 2011 11:21
Help needed with Cornell's Gambit airfoil tutorial AW FLUENT 6 February 26, 2010 23:42
Installing Open Foam and needed packages on shared disk for cluster environment k3di OpenFOAM Installation 1 July 8, 2009 08:06
Help needed with laminar couette flow boundary conditions bengt OpenFOAM Running, Solving & CFD 0 March 19, 2009 09:25


All times are GMT -4. The time now is 10:27.