how to dump individual components of a vector
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 |
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 |
refer the file write.H in the laplacianFoam solver
|
Thanks very much, Omkar.
Regards Vishal |
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 |
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. |
Quote:
|
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 |
Quote:
|
2 Attachment(s)
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 |
1 Attachment(s)
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 |
Quote:
Thanks, very much Omkar. I will have a look and would get back to you soon. Thanks Regards Vishal |
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 |
All times are GMT -4. The time now is 15:49. |