|
[Sponsors] |
October 5, 2020, 13:18 |
Using fvOption for adding momentum
|
#1 |
Senior Member
Farzad Faraji
Join Date: Nov 2019
Posts: 206
Rep Power: 8 |
Dear friends
I am using fvOption to add extra momentum in the domain and I use fvOption for this purpose, but It does not work properly. my fvOption is as follow; Code:
/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 6 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object fvOptions; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // momentumSource { type meanVelocityForce; active on; //on/off switch //cellSet sourceSet; meanVelocityForceCoeffs { selectionMode cellZone; cellZone farzadSulzerr; fields (U); Ubar ( 0. -1.0 0.); relaxation 1.0; } } // ************************************************************************* // Do you know what is my mistake? I have attached my cellZone, and also my simulation which I expect to make difference but fvOption has no effect. |
|
October 6, 2020, 11:32 |
|
#2 |
Senior Member
René Thibault
Join Date: Dec 2019
Location: Canada
Posts: 114
Rep Power: 7 |
I was able to do something similar like so and it was working, hope this help:
Code:
fixU { type vectorFixedValueConstraint; active true; selectionMode cellZone; cellZone firstCellU; volumeMode absolute; fieldValues { U (1.458308317 0 0); } } |
|
October 6, 2020, 14:43 |
|
#3 |
Senior Member
Farzad Faraji
Join Date: Nov 2019
Posts: 206
Rep Power: 8 |
Dear René Thibault
Thanks for your reply. Could you please tell me that if there is any fvOption(U) in your solver? I mean in Ueqn.C? Thanks, Farzad |
|
October 6, 2020, 14:57 |
|
#4 |
Senior Member
René Thibault
Join Date: Dec 2019
Location: Canada
Posts: 114
Rep Power: 7 |
What exactly does this code is fixing the component 'x' of 'U' at the first cell (I was setting a cellZone on the entire domain on the first cell from the wall with a topoSetDict file and using 'topoSet' command, like you probably did in a similar fashion way) at a fix value of 1.458..... At every time step, the value is carry on and fixed at this value at the cellZone set already.
By using the type 'vectorFixedValueConstraint', apparently you don't need to use the form 'vectorField& uSource = equ.source()' to apply the fixed value. Perform a test, and you'll see in your writing folder under 'U' file that the value will stay fix, the same, during the whole simulation in your cellZone. To answer your question about 'fvOption(U)' and 'Ueqn.C', that is a good question. The only thing that I can answer is I used the standard k-epsilon solver and didn't modify anything in the solver. Plus, is it possible to use this same technique with scalar value, like 'k' and 'epsilon' by using the type 'scalarFixedValueConstraint'. If you want to use an equation, maybe this post could help: vectorCodedSource with V momentum equation. Regards, |
|
October 6, 2020, 16:14 |
|
#5 |
New Member
Hesam Tofighian
Join Date: Mar 2019
Posts: 11
Rep Power: 7 |
Could anyone give me a good reference for fvOption usage in OpenFOAM?
|
|
October 7, 2020, 08:35 |
|
#6 | |
Senior Member
Farzad Faraji
Join Date: Nov 2019
Posts: 206
Rep Power: 8 |
Dear René Thibault
Thank you very much for your answer. I am using DPMFoam and according to below thread; How to add a source term for driving the flow in periodic model by DPMFoam? There is no fvOption in the Ueqn.C(Uceqn.C), and I need to add it to my solver, but I have not tested it yet. According to previous thread, adding fvOption is not enough and I have to do another actions also. Thanks, Farzad Quote:
|
||
October 7, 2020, 09:03 |
|
#7 |
Senior Member
René Thibault
Join Date: Dec 2019
Location: Canada
Posts: 114
Rep Power: 7 |
I use OpenFoam v1906 and I looked into 'DPMFoam.C' file and there is in fact, no 'fvOptions' framework.
Good luck with your work. Regards, |
|
October 20, 2020, 09:35 |
|
#8 |
Senior Member
Farzad Faraji
Join Date: Nov 2019
Posts: 206
Rep Power: 8 |
Dear René Thibault
Finally I decided to code instead of using fvOption, and I did the coding and I have add externalMomentum to the momentum equation in that specific region like this; Code:
forAll(mesh.C(),i) { scalar x = mesh.C()[i].component(0); scalar y = mesh.C()[i].component(1); scalar z = mesh.C()[i].component(2); if(x>0.096 && x<0.404 && y>0.10 && y<0.20 && z>0.0357 && z<0.0643) { externalMomentum[i] = (1.0 ,0.0 ,0.0); } } Code:
ExMom.H:10:22: error: no match for ‘operator=’ (operand types are ‘Foam::Vector<double>’ and ‘double’) externalMomentum[i] = (1.0 ,0.0 ,0.0); Thanks, Farzad |
|
October 20, 2020, 11:26 |
|
#9 |
Senior Member
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22 |
Code:
(1.0 ,0.0 ,0.0) Code:
externalMomentum[i] Code:
vector(1.0, 0.0, 0.0) |
|
October 20, 2020, 11:59 |
|
#10 |
Senior Member
René Thibault
Join Date: Dec 2019
Location: Canada
Posts: 114
Rep Power: 7 |
I agree with Joachim.
|
|
October 20, 2020, 12:31 |
|
#11 | |
Senior Member
Farzad Faraji
Join Date: Nov 2019
Posts: 206
Rep Power: 8 |
Thanks, It is solved.
Farzad Quote:
|
||
October 20, 2020, 13:55 |
|
#12 |
Senior Member
Farzad Faraji
Join Date: Nov 2019
Posts: 206
Rep Power: 8 |
Also please see this thread;
Using fvOption for adding momentum in pimpleFoam(changes in pimpleFoam example) thanks, Farzad |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Table bounds warnings at: END OF TIME STEP | CFXer | CFX | 4 | July 17, 2020 00:44 |
Question about adaptive timestepping | Guille1811 | CFX | 25 | November 12, 2017 18:38 |
Simulation of Axial Fan Flow using A Momentum Source Subdomain | Liam | CFX | 28 | July 16, 2013 09:24 |
Spray total droplet momentum calculation help | tarnsharma | AVL FIRE | 0 | July 19, 2012 09:17 |
Derivation of Momentum Equation in Integral Form | Demonwolf | Main CFD Forum | 2 | October 29, 2009 20:53 |