|
[Sponsors] |
October 16, 2018, 04:27 |
rotating source term using fvOptions
|
#1 |
Senior Member
Join Date: Mar 2018
Posts: 115
Rep Power: 8 |
Hello
In my simulation, I need to add a rotating source term to momentum equations without modifying the code of the solver. Is it possible to use a rotating source term in fvOptions (has a distance R from the origin rotates about the origin (0,0,0) as a function of time and with given angular velocity)? Please, can you give me an example? PS: Without using MRF or Dynamic mesh. Last edited by anon_q; October 16, 2018 at 06:10. |
|
October 29, 2018, 11:12 |
|
#2 |
New Member
Join Date: Jan 2017
Posts: 22
Rep Power: 9 |
Hi!
I am trying to do this also, but still not successful. Even though, SRFSimpleFoam is not an option for you? Okubo |
|
October 29, 2018, 11:52 |
|
#3 |
New Member
Join Date: Jan 2017
Posts: 22
Rep Power: 9 |
Tried some variations of the code below (in .../constant/fvOptions), but it is still not working well...
As far as I understand, this implements a explicit source...maybe, it should be implicit to work (like SRFSimpleFoam)? Hope somebody can help... Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v1806 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object fvOptions; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // velocitySource { type vectorCodedSource; vectorCodedSourceCoeffs { selectionMode all; fields (U); name vectorSource; codeInclude #{ #}; codeCorrect #{ Pout<< "**codeCorrect**" << endl; #}; codeAddSup #{ vectorField& Usource = eqn.source(); vector rotation = vector(0, 1, 0); // rotation in rad/s const vectorField& radius = mesh_.C(); // center of cells (axis is considered passing through origin) const vectorField& U_ = mesh().lookupObject<volVectorField>("U"); Usource = - (rotation^(rotation^radius)) - 2.0*(rotation^U_); #}; codeSetValue #{ Pout<< "**codeSetValue**" << endl; #}; // Dummy entry. Make dependent on above to trigger recompilation code #{ $codeInclude $codeCorrect $codeAddSup $codeSetValue #}; } }// ************************************************************************* // |
|
March 30, 2023, 05:55 |
|
#4 | |
New Member
Ph.D.(c) Oğuzhan KIRIKBAŞ
Join Date: Mar 2017
Location: İstanbul
Posts: 17
Rep Power: 9 |
Did you get any progress with your code. I am struggling with the same issue. Code is working but the solution blows up very quick because of the large numbers produced by the additional source term.
Quote:
|
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Source Term due to evaporation in energy transport equation | styleworker | OpenFOAM Programming & Development | 3 | September 7, 2022 04:09 |
[OpenFOAM.org] Error creating ParaView-4.1.0 OpenFOAM 2.3.0 | tlcoons | OpenFOAM Installation | 13 | April 20, 2016 18:34 |
[Other] How to use finite area method in official OpenFOAM 2.2.0? | Detian Liu | OpenFOAM Meshing & Mesh Conversion | 4 | November 3, 2015 04:04 |
SparceImage v1.7.x Issue on MAC OS X | rcarmi | OpenFOAM Installation | 4 | August 14, 2014 07:42 |
DxFoam reader update | hjasak | OpenFOAM Post-Processing | 69 | April 24, 2008 02:24 |