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

Stress tensor

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 17, 2020, 15:21
Default Stress tensor
  #1
Senior Member
 
Join Date: Jul 2019
Posts: 148
Rep Power: 6
Bodo1993 is on a distinguished road
Hi, I am wondering how would I output the total stress tensor (normal + shear) from the openfoam simulation?
I am using openFoam v6 and I work with a multiphase solver, twoLiquidMixingFoam.
Reading through the forum, I got into the custom function object below that should be added to the controlDict file:
Code:
    Stress
    {
        libs 				("libutilityFunctionObjects.so");
        type 				coded;
        writeControl            	outputTime;
        writeInterval           	1;
        name            		StressTensor;

        
	codeExecute
        #{
		volTensorField gradU = fvc::grad(U);
		// stress tensor
		volTensorField tau = - mu * (gradU + gradU.T());
        #};
    }
However, I get an error below for "mu"
Code:
/opt/openfoam6/src/OpenFOAM/lnInclude/fundamentalConstants.H:73:36: note:   ‘Foam::constant::physicoChemical::mu’
     extern const dimensionedScalar mu;
                                    ^~
/opt/openfoam6/wmake/rules/General/transform:25: recipe for target 'Make/linux64GccDPInt32Opt/functionObjectTemplate.o' failed
make: *** [Make/linux64GccDPInt32Opt/functionObjectTemplate.o] Error 1
[0] 
[0] 
[0] --> FOAM FATAL IO ERROR: 
[0] Failed wmake "dynamicCode/StressTensor/platforms/linux64GccDPInt32Opt/lib/libStressTensor_fa6bcb9352550c3007ffd513d48777a6a88042f2.so"
[0] 
[0] 
[0] file: /home/abdallah/OpenFOAM/abdallah-6/Fall2020/Loc_size/DR25/system/controlDict.functions.Stress from line 152 to line 160.
I am not quite sure if it is recognizing that I want to use the mixture viscosity of the two phases. I am wondering, what is the proper way to call that mixture viscosity in the function object above. Thanks in advance.
Bodo1993 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
Stress tensor components ap FLUENT 1 August 15, 2023 03:41
simpleFoam tutorial PitzDaily using Reynolds stress tensor (LRR RASModel) dlahaye OpenFOAM Running, Solving & CFD 24 August 4, 2023 14:29
How do we write code for mean of reynolds stress tensor? srinivasvl81 Main CFD Forum 2 June 4, 2019 10:12
[ANSYS Meshing] Error in Workbench "Unable to attach to geometry file" Jeremie84 ANSYS Meshing & Geometry 70 October 25, 2017 16:03
Convergence of Reynolds Stress Tensor / Fluctuations in OpenFOAM Anne Lincke OpenFOAM Running, Solving & CFD 0 July 17, 2012 10:50


All times are GMT -4. The time now is 14:50.