|
[Sponsors] |
how to dump individual components of a vector |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 24, 2013, 15:57 |
how to dump individual components of a vector
|
#1 |
Senior Member
Vishal Nandigana
Join Date: Mar 2009
Location: Champaign, Illinois, U.S.A
Posts: 208
Rep Power: 18 |
Hello All,
I would like to know if it is possible to get the scalar values of a vector during the course of a simulation. For instance, I would like to dump the individual scalar velocity fields Ux, Uy, Uz, of the velocity vector U on the fly as the simulation runs. I understand that the "foamCalc components U" does this after the simulation is complete. Please let me know if there is any inbuilt utility in OF. I have been trying to implement this for a while now. Thanks Regards Vishal |
|
March 24, 2013, 16:17 |
|
#2 |
Senior Member
Join Date: Nov 2009
Location: Michigan
Posts: 135
Rep Power: 16 |
Add this somewhere in your solver:
volScalarField Ux ( IOobject ( "Ux", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), U.component(vector::X) ); Same for other two components |
|
March 24, 2013, 16:18 |
|
#3 |
Senior Member
Join Date: Nov 2009
Location: Michigan
Posts: 135
Rep Power: 16 |
refer the file write.H in the laplacianFoam solver
|
|
March 24, 2013, 16:25 |
|
#4 |
Senior Member
Vishal Nandigana
Join Date: Mar 2009
Location: Champaign, Illinois, U.S.A
Posts: 208
Rep Power: 18 |
Thanks very much, Omkar.
Regards Vishal |
|
March 24, 2013, 17:58 |
|
#5 |
Senior Member
Vishal Nandigana
Join Date: Mar 2009
Location: Champaign, Illinois, U.S.A
Posts: 208
Rep Power: 18 |
Hi Omkar,
I am looking to implementing the following Neumann boundary condition for the velocity on the walls of a surface du/dy = A*E_x, where E_x is the x-compoment of the electric Field which is obtained by solving another PdE and A is a constant. Now, from your earlier suggestion, I was able to extract E_x at every time step on the fly, I would like to know how to implement the above boundary condition in OF. Please let me know if you have any suggestions. Thanks Regards Vishal |
|
March 26, 2013, 07:57 |
|
#6 |
Senior Member
Join Date: Nov 2009
Location: Michigan
Posts: 135
Rep Power: 16 |
I have not done this before, but I can say you might have to modify the fixedGradient bc (is du/dy the normal gradient on the surface?)
swak4FOAM might be able to implement this, but I am not sure if groovyBC reads non-standard variables. If groovyBC works, then that's the easiest way. I can give it a shot over the weekend if you can upload or mail your files. |
|
March 26, 2013, 10:03 |
|
#7 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
March 26, 2013, 10:26 |
|
#8 |
Senior Member
Join Date: Nov 2009
Location: Michigan
Posts: 135
Rep Power: 16 |
Thanks, Bernhard. I guess then groovyBC will be able to do it.
By non-standard, I meant field variables that are not present in the standard package of openfoam i.e. user-defined field field variables |
|
March 26, 2013, 12:35 |
|
#9 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
As long as their name is unique and they are registered with the mesh (it is rather hard NOT to register them) groovyBC should find them
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
|
March 26, 2013, 23:21 |
|
#10 | |
Senior Member
Vishal Nandigana
Join Date: Mar 2009
Location: Champaign, Illinois, U.S.A
Posts: 208
Rep Power: 18 |
Quote:
"is du/dy the normal gradient on the surface?" Yes, it is the normal gradient. Attached please find the source code along with the solver conditions. In the initial guess ("0") folder, I would like to implement the following boundary condition on the DNAupperwall and DNAlower wall (the geometry is given in blockMesh file)for the velocity. du/dy (normal to the surface) = -Ex*gamma, where gamma = -2.2164 Please let me know, how to implement this. Thanks a lot for the help. Regards Vishal |
||
April 2, 2013, 22:19 |
|
#11 |
Senior Member
Join Date: Nov 2009
Location: Michigan
Posts: 135
Rep Power: 16 |
Hello,
Sorry for the late reply. I could achieve what you want by using groovyBC. You will have to install swak4Foam first though. Follow these steps: 1. untar 2. run blockMesh and DNAFoam (I have changed the timestep and endtime. Also add the ".so" files entry in controlDict) (ux gradient will be set equal to x-component of electrical field. you can modify the expression as you want) 3. run "wallGradU" 4. run "sample" (check out system/sampleDict) This will write electricField values, and value of wall gradients for the DNAupperwall patch in surfaces folder 5. Check the two values. The must be same (except for the sign) Let me know if this helps or you need anything otherwise |
|
April 4, 2013, 00:20 |
|
#12 | |
Senior Member
Vishal Nandigana
Join Date: Mar 2009
Location: Champaign, Illinois, U.S.A
Posts: 208
Rep Power: 18 |
Quote:
Thanks, very much Omkar. I will have a look and would get back to you soon. Thanks Regards Vishal |
||
April 17, 2013, 01:24 |
|
#13 |
Senior Member
Vishal Nandigana
Join Date: Mar 2009
Location: Champaign, Illinois, U.S.A
Posts: 208
Rep Power: 18 |
Hi Omkar,
I would like to create the following geometry in openfoam. A small circular hole is drilled through a block (cuboid in shape). Can you give me a heads up on how to create such a geometry in openfoam. Thanks Vishal |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
how to set periodic boundary conditions | Ganesh | FLUENT | 15 | November 18, 2020 06:09 |
How to define the list of vector when a vector has n components | fumiya | OpenFOAM | 1 | October 26, 2012 04:10 |
UDF for wall slipping | HFLUENT | Fluent UDF and Scheme Programming | 0 | April 27, 2011 12:03 |
Normal vector, slope and aspect angle | g_niro | Main CFD Forum | 0 | February 2, 2011 17:24 |
How to find the components of normal vector | coul | FLUENT | 0 | July 30, 2004 12:13 |