|
[Sponsors] |
April 17, 2016, 04:49 |
|
#41 |
Senior Member
Join Date: Sep 2015
Location: Singapore
Posts: 102
Rep Power: 11 |
Hi Bruno,
Thanks for replying once again. I actually have two versions of OF installed (2.1.1 & 2.4.1). I was able to run the incompressible/simpleFoam/pipeCyclic test case in both versions successfully. However, since my ParaView is linked to v2.1.1 only, I am able to view the results only when I run the solver using v2.1.1 but I can see that the swirl has been implemented in both version by looking at the result files. At time=0, ParaView does not show the swirl boundary condition. So, you were right the first time: the BC is not reflected in ParaView at t=0 but passed to the solver during the first time step or during decomposePar. [My Linux distribution information Distributor ID: Ubuntu Description: Ubuntu 12.04.5 LTS Release: 12.04 Codename: precise I tried to run my own case and I was able to run it without any problems in v2.4.1 (I'm using rhoCentralFoam). I checked the results by checking the results files and the code has been implemented. Just some observations: (1) Both... Code:
operator == (200000); Code:
operator==(200000); (2) I removed the following statements since they were absent in the pipeCylic tutorial and it worked fine: Code:
codeInclude #{ #include "fvCFD.H" #}; codeOptions #{ -I$(LIB_SRC)/finiteVolume/lnInclude #}; When I added the #include statements, I got the following error after the first iteration: Code:
#0 Foam::error::printStack(Foam::Ostream&) in "/home/cae-usv/OpenFOAM/OpenFOAM-2.4.0/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #1 Foam::sigSegv::sigHandler(int) in "/home/cae-usv/OpenFOAM/OpenFOAM-2.4.0/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #2 ? in "/lib/x86_64-linux-gnu/libc.so.6" #3 Foam::fixedValueFvPatchField<double>::gradientInternalCoeffs() const in "/home/cae-usv/OpenFOAM/OpenFOAM-2.4.0/platforms/linux64GccDPOpt/lib/libfiniteVolume.so" #4 Foam::codedFixedValueFvPatchField<double>::evaluate(Foam::UPstream::commsTypes) in "/home/cae-usv/OpenFOAM/OpenFOAM-2.4.0/platforms/linux64GccDPOpt/lib/libfiniteVolume.so" #5 Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricBoundaryField::evaluate() in "/home/cae-usv/OpenFOAM/OpenFOAM-2.4.0/platforms/linux64GccDPOpt/bin/rhoCentralFoam" #6 ? in "/home/cae-usv/OpenFOAM/OpenFOAM-2.4.0/platforms/linux64GccDPOpt/bin/rhoCentralFoam" #7 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #8 ? in "/home/cae-usv/OpenFOAM/OpenFOAM-2.4.0/platforms/linux64GccDPOpt/bin/rhoCentralFoam" Segmentation fault (core dumped) Many thanks to everyone and especially, Bruno. |
|
April 17, 2016, 15:48 |
|
#42 | ||
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 |
Quick answers:
Quote:
Quote:
Did you change anything in the original source code files within OpenFOAM's source code? |
|||
April 18, 2016, 01:26 |
|
#43 |
Senior Member
Join Date: Sep 2015
Location: Singapore
Posts: 102
Rep Power: 11 |
Hi Bruno,
No, I have not changed any original source code files. |
|
July 22, 2016, 16:01 |
|
#44 |
New Member
Sam Salehian
Join Date: Jul 2016
Posts: 4
Rep Power: 10 |
Hello All,
I am interested in applying an unsteady and non uniform boundary condition for inflow. I want to define a function for the velocity profile such as: U(x)=U_0*(exp(y)*sin(2*pi*freq*time)) where y is the vertical position of inflow patch in a channel. I want to avoid using groovy boundary condition. I would appreciate if any one could also help me with this. Regards Last edited by SmokedJuggler; July 26, 2016 at 17:16. |
|
July 31, 2016, 02:16 |
|
#45 |
Senior Member
Join Date: Sep 2015
Location: Singapore
Posts: 102
Rep Power: 11 |
Hi Sam,
I managed to get the code below working following what was suggested earlier on this thread. It is a parabolic velocity profile. Code:
INLET { type codedFixedValue; value uniform (0 0 0); redirectType test; // user-defined name code #{ const fvPatch& boundaryPatch = this->patch(); const vectorField& Cf = boundaryPatch.Cf(); vectorField& v = *this; scalar Uc = 1; // centerline velocity, U_max scalar R = 0.019; // inlet radius forAll(Cf,faceI) { scalar x = Cf[faceI].x(), y = Cf[faceI].y(), rSq = x*x + y*y; v[faceI] = vector(0, 0, Uc*(1 - rSq/R/R)); } #}; } Code:
INLET { type codedFixedValue; value uniform (0 0 0); redirectType test; // user-defined name code #{ const fvPatch& boundaryPatch = this->patch(); const vectorField& Cf = boundaryPatch.Cf(); const scalar &t = this->db().time().value(); vectorField& v = *this; scalar U0 = 1; // centerline velocity scalar f = 1; // frequency forAll(Cf,faceI) { scalar y = Cf[faceI].y(); scalar u = U0*Foam::exp(y)*Foam::sin(Foam::constant::mathematical::twoPi*f*t); v[faceI] = vector(u, 0, 0); } #}; } |
|
February 27, 2017, 05:30 |
coded fixed or coded mixed boundary condition
|
#46 |
New Member
Sachin
Join Date: Sep 2016
Location: Poitiers,France
Posts: 17
Rep Power: 10 |
Hello Foamers,
I want to implement a boundary condition at electrode. N_P= K * Efield * N_P In this equation N_P and Efield " need to be taken from electrode at previous time step and K is dimensionedScalar fix value 1. is there anyone know how to implemrnt this BC? should I have to used codedfixed BC or some other BC? I am using openfoam 4.0. Thanks in advance..... |
|
February 28, 2017, 09:10 |
coded fixed or coded mixed boundary condition
|
#47 |
New Member
Sachin
Join Date: Sep 2016
Location: Poitiers,France
Posts: 17
Rep Power: 10 |
Hello Foamers,
I want to implement a boundary condition at electrode. N_P= K * Efield * N_P In this equation N_P and Efield " need to be taken from electrode at previous time step and K is dimensionedScalar fix value 1. is there anyone know how to implemrnt this BC? should I have to used codedfixed BC or some other BC? I am using openfoam 4.0. Thanks in advance..... |
|
October 7, 2019, 06:34 |
Previous time step
|
#48 |
Member
K
Join Date: Mar 2018
Posts: 34
Rep Power: 8 |
Thank you for the information on implementing time in the boundary condition!
I was wondering if someone has looked into how to import time step used by the solver while calculating the boundary condition using CodedFixedValue or Codedixed? Thanks in advance |
|
October 7, 2019, 07:54 |
|
#49 | |
Senior Member
Join Date: Sep 2015
Location: Singapore
Posts: 102
Rep Power: 11 |
Quote:
Simply use the following to obtain the time step. Code:
const scalar &t = this->db().time().deltaTValue(); USV |
||
October 7, 2019, 07:59 |
|
#50 |
Member
K
Join Date: Mar 2018
Posts: 34
Rep Power: 8 |
||
August 29, 2020, 05:46 |
calculate sphere velocity at each time step and apply it to inlet boundary condition
|
#51 |
Member
|
Dear friends,
I am solving the flow around the sphere (as a particle) inside a channel. I want to calculate the integral of the drag force over the sphere at each time step to calculate the velocity of the sphere V2 (F=m.(V2-V1)/dt) and then applied the obtained velocity (V2) at each time step to the inlet boundary as a portion of velocity boundary condition (U-V2). How can I do this? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Domain Imbalance | HMR | CFX | 5 | October 10, 2016 06:57 |
Can anyone give me some hint on how to make traction free boundary condition? | poplar | OpenFOAM | 3 | January 14, 2015 03:37 |
Boundary Conditions | Thomas P. Abraham | Main CFD Forum | 20 | July 7, 2013 06:05 |
Setting outlet Pressure boundary condition using CAFFA code | Mukund Pondkule | Main CFD Forum | 0 | March 16, 2011 04:23 |
How to set boundary condition in Fluent for the fo | Peiyong | FLUENT | 1 | November 10, 2006 12:44 |