|
[Sponsors] |
November 7, 2013, 00:55 |
|
#41 |
Senior Member
Srivathsan N
Join Date: Jan 2013
Location: India
Posts: 101
Rep Power: 13 |
Hi Philip,
I have been trying to re-write valueFraction for each face of my patch as symm(n*n). I have a very basic doubt. Is it better to write a new BC (derived from directionMixed (maybe?)) where this definition of valueFraction is changed as symm(n*n) while looping over all faces of the patch? If yes, where do I make the changes? In the 'updateCoeffs' section? Thanks.
__________________
Regards, Srivaths |
|
September 15, 2014, 12:28 |
|
#42 | |
New Member
Join Date: Jul 2013
Posts: 7
Rep Power: 13 |
Hi,
Quote:
- a zero gradient for the normal component of the displacementThe newDirectionMixed looked like the perfect solution. However, when I ran it with my solver, I got the following error: Code:
--> FOAM FATAL IO ERROR: Cannot find 'value' entry on patch symr of field U in file "/home/salwa/OpenFOAM/salwa-extend-3.0/run/tutorials/solidMechanics/elasticThermalSolidFoam/flosse_test1/0/U" which is required to set the values of the generic patch field. (Actual type newDirectionMixed) Please add the 'value' entry to the write function of the user-defined boundary-condition or link the boundary-condition into libfoamUtil.so file: /home/salwa/OpenFOAM/salwa-extend-3.0/run/tutorials/solidMechanics/elasticThermalSolidFoam/flosse_test1/0/U::boundaryField::symr from line 64 to line 69. From function genericFvPatchField<Type>::genericFvPatchField(const fvPatch&, const Field<Type>&, const dictionary&) in file fields/fvPatchFields/basic/generic/genericFvPatchField.C at line 71. FOAM exiting Code:
gradientInternalCoeffs cannot be called for a genericFvPatchField (actual type newDirectionMixed) on patch symr of field U in file "/home/salwa/OpenFOAM/salwa-extend-3.0/run/tutorials/solidMechanics/elasticThermalSolidFoam/flosse_test1/0/U" You are probably trying to solve for a field with a generic boundary condition. From function genericFvPatchField<Type>::gradientInternalCoeffs() const in file fields/fvPatchFields/basic/generic/genericFvPatchField.C at line 811. FOAM exiting Code:
symr { type newDirectionMixed; refValue uniform 0; refGrad uniform 0; nHat (1 0 0); normalValueFraction 0; tangentialValueFraction 1; value uniform (0 0 0); } Thanks, |
||
September 17, 2014, 11:02 |
|
#43 | |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,097
Rep Power: 34 |
Hi Sliwa,
Quote:
To achieve what you want, use directionMixed like this: Code:
myPatch { type directionMixed; refValue uniform ( 0 0 0 ); refGradient uniform ( 0 0 0 ); valueFraction uniform ( 0 0 0 1 0 1 ); // (I - sqr(n)) value uniform ( 0 0 0 ); You can see that to fix the value in the normal direction valueFraction = sqr(n), whereas to fix the value in the tangential directions valueFraction = I - sqr(n). Best regards, Philip |
||
September 17, 2014, 11:03 |
|
#44 | |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,097
Rep Power: 34 |
Quote:
yes you should derive a new boundary condition from directionMixed and set the valueFraction in the constructor or, if the mesh is moving/changing, in updateCoeffs. See for example, fixedDisplacementZeroShear in $FOAM_SRC/solidModels.fvPatchVectorFields in foam extend. Best regards, Philip |
||
September 18, 2014, 11:55 |
|
#45 |
New Member
Join Date: Jul 2013
Posts: 7
Rep Power: 13 |
Thank you, Philip! That worked.
|
|
August 9, 2015, 22:10 |
|
#46 |
New Member
Amir
Join Date: Jul 2011
Location: Shiraz
Posts: 15
Rep Power: 15 |
Hi Dear Foamers
I'm trying to use no-stress wall boundary condition and I used: Code:
type directionMixed; refValue uniform (0 0 0); refGradient uniform (0 0 0); valueFraction uniform (0 0 0 1 0 0); I would appreciate if anyone could help me |
|
August 12, 2015, 12:09 |
|
#47 |
New Member
Amir
Join Date: Jul 2011
Location: Shiraz
Posts: 15
Rep Power: 15 |
any answer guys ?
|
|
August 12, 2015, 12:48 |
|
#49 |
New Member
Amir
Join Date: Jul 2011
Location: Shiraz
Posts: 15
Rep Power: 15 |
Thanks a lot Philip
It was very Helpful |
|
December 3, 2015, 19:02 |
|
#50 | |
Member
Saurabh Tandon
Join Date: Nov 2015
Location: Austin
Posts: 43
Rep Power: 11 |
Quote:
Interesting explanation for the changing the refGradient in the directionMixed BC. If we include this code in the data can we give any values in directionMixed condition in the 0/U file? Is it possible to set a nonuniform value for the valuefraction in a similar manner using tensor fields. Thank you. Saurabh |
||
December 3, 2015, 19:07 |
|
#51 |
Member
Saurabh Tandon
Join Date: Nov 2015
Location: Austin
Posts: 43
Rep Power: 11 |
Hi Philip
Just another doubt. Can we use funkySetFields with directionMixed BC. I am getting an error when I try to do that. This is the error: --> FOAM FATAL IO ERROR: "ill defined primitiveEntry starting at keyword 'valueFraction' on line 29 and ending at line 41" Thank you. |
|
December 4, 2015, 20:40 |
Yes you can code with C++ many great thing in OF
|
#52 |
Member
Nicolas Lussier Clément
Join Date: Apr 2009
Location: Montréal, Qc, Canada
Posts: 61
Rep Power: 17 |
Yes Saurabh you can do this,
If you want to this you want to define a summetric tensor field as a variable initialize it corectly with all the constructors and add it to the maping function if you want to be able to use it in parallèle. You can always look at boundary condition source code to give you great exemple, ther is plenty of them. But valueFraction is alrethy a symmTensorField !?? I'm not shure what is your objectif in creating your new dirrectionMixed boundary condition. I dont konw about funkysetfield I did not use it yet. Out of curiosity why do you want to do this ? What are you tring to accomplish ? Not shur what you mean by including the code in the data ? Hope this was usfull |
|
December 4, 2015, 22:09 |
|
#53 |
Member
Saurabh Tandon
Join Date: Nov 2015
Location: Austin
Posts: 43
Rep Power: 11 |
[QUOTE=ubald;576267]Yes Saurabh you can do this,
If you want to this you want to define a summetric tensor field as a variable initialize it corectly with all the constructors and add it to the maping function if you want to be able to use it in parallèle. You can always look at boundary condition source code to give you great exemple, ther is plenty of them. But valueFraction is alrethy a symmTensorField !?? I'm not shure what is your objectif in creating your new dirrectionMixed boundary condition. I dont konw about funkysetfield I did not use it yet. Out of curiosity why do you want to do this ? What are you tring to accomplish ? Not shur what you mean by including the code in the data ? Hi Nicolas Thank you for replying so quickly. I will take a look the deifnition of the codes and see if I can compile my own BC. I am trying to use openFoam for magnetic decay simulations and my BC doesnot have a symm tensor in value fraction. Please peruse my post: http://www.cfd-online.com/Forums/ope...groovy-bc.html This might give you more context to what I am trying to do. Thanks again for the help. |
|
October 20, 2016, 01:36 |
directionMixed for fluid-fluid interface
|
#54 |
New Member
Praveen Srikanth
Join Date: Jul 2012
Location: West Lafayette, IN
Posts: 23
Rep Power: 14 |
Hello,
I am trying to use the conjugate heat transfer solver to compute phase change at a liquid-vapor interface. I have implemented the phase change models into the solver with just a normal velocity at the interface for the phase change. However, I have vapor flow over the interface which would create a viscous shear on the surface of the liquid. The boundary condition for the problem is essentially equal tangential velocities on either side of the interface and equal tangential shear stresses. Added to this is the fixed value in the normal direction. I was thinking that this would be possible to be implemented using the directionMixed boundary condition. However I am not sure how the value fraction would look for such a scenario. Is it possible to use directionMixed for such a BC? I am hoping someone with some experience would be able to direct me in the right direction. As far as I know there does not seem to be any similar boundary conditions in OF. Thanks so much for your time Praveen |
|
November 17, 2017, 14:24 |
|
#55 |
Member
behzad Ghasemi
Join Date: Sep 2013
Location: Iran
Posts: 56
Rep Power: 13 |
Hi,
I don't know i'm in right thread or not by the way I want to solve equation and obtain B that is defined like . I've implemented the equation in my base solver. Now i want to test functionality of the new solver but i have some boundary condition problem before testing. For example if i want to get in boundaries i need to set and . Can i use directionMixed BC for this? How can i implement this BCs? Thanks in advance, Behzad |
|
November 18, 2017, 20:16 |
I think it is better to start a new tread
|
#56 |
Member
Nicolas Lussier Clément
Join Date: Apr 2009
Location: Montréal, Qc, Canada
Posts: 61
Rep Power: 17 |
Hi Behzad,
OpenFOAM is 3D by défaut 1D and 2D case are achieve by setting special BC. The equations you share seem to be 2D. You need first to specify your equations in 3D then figure ought what type of BC you need. Fixed, gradient, mixed !! Then you'll know what to look for. It seems to me that you should start a new thread. Wright the hole set of equations for your problem with detail on the boundary condition you want to use. Or a link in an article relevant to your case. It is better to use vector notation then component details as OF use vector and tensor notation. Add me on your new tread please as it seems interesting. NLC Last edited by nlc; November 20, 2017 at 11:28. |
|
November 18, 2017, 20:36 |
|
#57 | |
Member
behzad Ghasemi
Join Date: Sep 2013
Location: Iran
Posts: 56
Rep Power: 13 |
Quote:
Thanks for kind reply. as you mentioned OF operates in 3D my case is 2D and I'll set front and back plane as empty and that's not the problem. I showed component details for clarifying the variable relations and boundary conditions. any way I'll open new thread and add you there. Kind regards, Behzad |
||
November 19, 2017, 07:25 |
|
#58 | |
Member
behzad Ghasemi
Join Date: Sep 2013
Location: Iran
Posts: 56
Rep Power: 13 |
Quote:
This is the link of new thread. https://www.cfd-online.com/Forums/op...tml#post671506 |
||
January 11, 2019, 12:32 |
spatially varying mixed boundary condition
|
#59 |
New Member
Nilay Kulkarni
Join Date: May 2018
Posts: 24
Rep Power: 8 |
Hello,
I have a doubt regarding mixed boundary condition. The available mixedFvPatchField I have to specify fixed Value and a normal gradient. I want to apply a mixed BC to a wall to simulate mass diffusion across it. Thus boundary condition to vary along the wall for varying mass fraction gradients and mass fraction values in cells neighboring the wall. Is there a boundary condition that provides this facility? I have attached the boundary condition equation below where Cmucus is the mass concentration which undergoes convection-diffusion and the coefficients of Cmucus are constants. Capture.PNG Thank you |
|
June 11, 2019, 05:35 |
|
#60 |
Member
Join Date: Apr 2019
Location: India
Posts: 81
Rep Power: 7 |
Hello Everyone
I am unable to understand the mixed boundary condition clearly. I have a vertical wall and I want to set the x-component of velocity to be u = 0 and y-component of velocity to be set as dv/dx = 0. In order to achieve this, I have implemented the following sideWall { type directionMixed; refValue uniform (0 0 0); refGradient uniform (0 0 0); valueFraction uniform (0 0 0 0 0 1); } but, when I plot I see non-zero values for the x-component. Kindly, please help me. With Thanks & Regards, Pavithra. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
mixed difference | Shuo | Main CFD Forum | 1 | September 3, 2008 02:25 |
mixed convection | sumesh | FLUENT | 0 | March 7, 2008 01:00 |
Mixed CPU/GPU computing | Joe | Main CFD Forum | 4 | September 20, 2006 13:04 |
Direction mixed bc | evgenii | OpenFOAM Pre-Processing | 1 | November 30, 2005 05:37 |
mixed convection | raj calay | Main CFD Forum | 6 | April 21, 1999 23:33 |