Computational Fluid Dynamics is the Future
  • Main Page
    • Purpose of Website
    • About Me >
      • My PhD Thesis
      • My Teaching at the American University of the Middle East
      • My Teaching at the University of Sharjah
      • My Books & Codes
      • My CFD Projects
      • My SolidWorks Projects
      • My Family
      • In the Living Memory >
        • Family who contributed to My Personality
        • Lecturers Who Contributed to My Personality
      • Testimonials
    • CFD2012 Blog
    • معلومات عن الموقع
    • Page Contact >
      • Feedback Form
  • Research
    • C++ for Excel
    • Undergrad Stage Advice >
      • Cheat Sheet
      • Dealing with Dyslexia
      • Work/Research Placement
    • Masters Stage Advice >
      • PIV Lab
      • Prototype Modelling Lab
      • Field Trips 2006
      • Fuel Atomization Lab
      • Cardiff Airbus Seminar
      • Research Labs
      • GT Onsite Trips
      • On-Site Visits
    • PhD Stage Advice >
      • CFD Modelling >
        • Online CFD Codes
        • CFD Mandatory Reading List >
          • CFD Book Reviews >
            • Turbulence book Reviews
          • Turbulence Modelling Books
          • Finite Element Reading List
        • Eulerian and Lagrangian Descriptions
        • Multigrid Method
        • Finite Volume Method
        • Quantum Physics
        • Navier-Stokes Equations >
          • Atmospheric
          • CFD Simulation Validation
        • Numerical Methods >
          • Numerical Methods Book Reviews
          • Derivatives of Different Orders
          • Vector Calculus
          • Solvers >
            • Iterative Method
          • Data Structures
        • Grid Classification >
          • Mesh Geneation Book Reviews
          • Delaunay Trangulation
        • Reactive Flows >
          • Anaerobic Digestion
          • Combustion Theory Notes
          • Combustion Book Reviews
          • Swirl Flow and Combustion
          • Combustion Reading List
          • Working with Mixtures
          • Combustion Theory
      • Experimentation for CFD >
        • Diffusion Sensors
        • Experimental Wind Tunnels >
          • Wind Tunnel Walk Around
          • Wind Tunnels Books
      • Design of Experiment
      • Optimization
      • My Teaching Activities
      • Google Scholar Profile
      • Yearly Upgrade Report
      • Attending Regular Seminars >
        • Publication Reading
        • Making a Presentation
        • Research Collaboration Fundamentals >
          • Writting a Publication
          • Trip Planning
      • Supervisor Guidance >
        • Studies Budget >
          • Making a Pause for Your Studies
      • Thesis Writting >
        • Putting Together the Thesis
        • List of Symbols
        • Thesis Abstract
        • Thesis Rational and Finding the Gap
        • Thesis Literature Review
        • Thesis Methodolgy
        • Thesis Hypothesis
        • Thesis Conclusion
        • Thesis Check List
      • Referencing >
        • LaTeX
        • EndNote >
          • Setting Up EndNote with Google
          • EndNote Selecting Reference Method
      • Ideal Image of the VIVA >
        • Dealing with Correction Obstactles
        • Thesis Corrections
    • Postdoc >
      • Whitelee Windfarm
      • Dumbarton Scottish Maritime Museum
      • Meetings and Negotiating
      • Student Recommendations
      • Team Work
      • Writting a Research Proposal
      • Conference Organization
      • Research Networking
      • Supervising Students >
        • Types of PhD students >
          • Mind Mapping
    • Research Trends
    • Photoshop >
      • Inserting Text in Photoshop
      • Using Brush in Photoshop
      • Using Blur in Photoshop
    • Microsoft Office Skills >
      • Flow Chart
      • Microsoft Outlook
      • Making a Poster
      • Power Point
      • Making Gantt Chart
      • Mircosoft Word Thesis Layout >
        • Adding Rear Color in Word
        • Applying a Border Line in Word
        • Steps to Write a Thesis
        • Document Heading
        • Applying Chapter Headings
        • Document Footer
        • Using Text Box
        • Using Quick Parts
      • Microsoft Excel >
        • Reading Data into Excel
    • Jobs Search >
      • Jobs Requirments >
        • Requesting Copy of Reference
        • Work Email Formats
        • Regular Rejection Excuses >
          • Email Job Replies
      • CFD Job Sites >
        • Other Jobs Sites
      • Telephone Job Interview
      • Interview Clothing
  • ANSYS-Flow Modelling
    • ANSYS CFX Tutorials >
      • ANSYS CFX Introductory Tutorials >
        • Boundary Conditions
        • ANSYS CFX Introductory 2
      • ANSYS-CFX Porous Media >
        • ANSYS-CFX Porous Media Models
        • ANSYS-CFX Porous Media Bugs
      • ANSYS CFX Single Domain Wind Turbines >
        • ANSYS CFX Double Domain Wind Turbines
        • Rotating Wind Turbine
        • Wind Turbine Stress Analysis
      • ANSYS-CFX Turbo Machinery >
        • ANSYS-CFX Pump Simulation
        • ANSYS-CFX Turbine Cooling >
          • Steps to Model Gas Turbine Blades
      • ANSYS-CFX Formula One CAR >
        • Car Aerodynamics Books
      • ANSYS-CFX Heat Exchanger >
        • ANSYS-CFX Finned Heat Exchanger
        • Phase Change Heat Exchangers
        • Shell and Tube Heat Exchangers
        • Heat Exchangers Reading List
        • ANSYS CFX Heat Exchanger Tube Wear
        • ANSYS CFX Thermal Radiation
      • ANSYS CFX Combustion >
        • ANSYS-CFX Gas Turbine Combustor
        • ANSYS-CFX Multiphase Combustion Modelling
        • ANSYS CFX Flamelet
      • ANSYS-CFX Spary Modelling >
        • ANSYS-CFX Spray Modelling in Car Engines
        • ANSYS-CFX Resolving Multiphase Interface
        • ANSYS CFX Fluid/Solid Transport
        • ANSYS-CFX Air Assisted Sprays
        • Applying a Function of Time
        • ANSYS CFX Rosin Rammler
        • ANSYS CFX Nukiyama Tanasawa
        • SAUTER MEAN DIAMETER
      • ANSYS Geophysical Simualtions >
        • ANSYS Modelling Terrain
      • ANSYS-CFX Tank Sloshing
      • ANSYS Combustion Engines >
        • Setting up ICE Simulation
        • Applying Radiation in the Engine
      • ANSYS-CFX Pelton Turbine
      • ANSYS Flow Modelling Throttle Valve
      • ANSYS-CFX Immersed Solid
      • ANSYS CFX Changing Airfoil Para
      • ANSYS Flow around Buildings
      • ANSYS CFX Compressible Flows
      • ANSYS CFX Solid Particles
      • ANSYS Horizontal Francis Turbine
      • ANSYS-CFX Kaplan Turbine
      • ANSYS-CFX Hair Dryer
      • Types of Flaps >
        • Wings
    • ANSYS-FLUENT >
      • ANSYS FLUENT Simulation Setup >
        • ANSYS FLUENT Boundary Conditions
      • ANSYS FLUENT UDF
      • ANSYS-FLUENT Heat Exchanger Tutorial
    • ANSYS Design Modeller >
      • Blade Modelling >
        • Modelling a Turbine Blade
        • ANSYS Blade Modelling
        • ANSYS BladeGen Axial Compressor
        • ANSYS BladeGen Centrifugal Compressor
      • ANSYS Design Modeler Operations
      • ANSYS Design Modeler Boolean Operations
      • Design Modeller for Turbo Machinery
    • ANSYS CFX Meshing >
      • ICEM >
        • ICEM Introductory Tutorials
        • ICEM Surfacing
        • ICEM Parallel Meshing and Repair
        • ICEM Theory
      • Importing External Geometry to ANSYS
      • ANSYS CFX Types of Meshing >
        • Mesh (Refinement/Relevance)
        • Mesh Number of Cells
        • Mesh Types
        • Mesh Sizing
      • CFX Meshing Online Material
    • ANSYS Simulation Setup >
      • ANSYS CFX Lang CEL >
        • ANSYS-CFX Time Dependent Boundary Conditions
        • Applying a time dependent Velocity Profile
        • Inserting Equation into ANSYS
      • Workbech File Structure
      • Dealing With Memory Problems >
        • Calculating Resources
        • Calculation Guide Lines
      • Applying a Source Term
      • Applying a Velocity Profile to BC
      • Varabile Dependent Boundary Condition >
        • Time dependent Boundary Condition
        • Temperature Dependent Boundary Condition
      • Applying a Riged Body
      • CFX Data Transfer
      • CFX User Functions
      • ANSYS CFX Material Addition
    • ANSYS CFX Steady/Unsteady >
      • ANSYS CFX Time Stepping
      • Time Step Planning
      • Adaptive Time Stepping
      • Length Scale
      • Time Scale
      • Number of Iterations
      • CFL Condition
      • ANSYS CFX Transient Blade Flow
    • ANSYS CFX Data Analysis >
      • ANSYS CFX Moving Mesh >
        • ANSYS Dynamic Mesh
        • ANSYS CFX GGI Interface
      • CFD-Post >
        • CFX Point Parameter
        • ANSYS Parameter Analysis
        • Fatigue Life Optimization with ANSYS nCode DesignLife
        • ANSYS-CFX Probe Tool
        • Exporting Plane Data
        • CFD-Post Parameters
        • Using FFT for Data Analysis
        • Finding Paramters of a Close Surface
        • Histograms in CFD-Post
        • Extracting Data from a Stream Line
        • Transient or Seqence in CFD-Post
        • Linear Data Analysis in CFD-Post
        • CFD-Post Point Cloud
      • ANSYS Making Movies
      • ANSYS CFD-Post Data Loading
      • ANSYS-CFX Data Importing for Analysis
      • ANSYS Loading Simulation Data
      • ANSYS CFX Analysis Tools
      • ANSYS and Excel Data Analysis
      • Using Report Viewer
    • ANSYS Simulation Validation >
      • Flow Validation Around a Cylinder
      • Grid Sensitivity Analysis >
        • ANSYS-FLUENT Time Dependent Boundary Condition
      • Validation Steps
    • ANSYS Blogs >
      • ANSYS HPC
      • ANSYS Stress Analysis >
        • Wing Stress Analysis
        • ANSYS Mechanical APDL
        • Tail Fin Stress Analysis
        • ANSYS Stress Analysis Material >
          • Assigning Boundary Conditions
        • ANSYS Friction Modelling
        • ANSYS Static Structure
        • ANSYS Rigid Dynamics
        • ANSYS Explicit Dynamics
        • ANSYS Assembly Manager >
          • ANSYS Rigid Dynamics
  • MATLAB
    • MATLAB Control Circuits
    • MATLAB GUI
    • MATLAB Fourier Transform >
      • MATLAB Fourier Transform
    • MATLAB Numerical Analysis >
      • Newton Raphson Method
      • MATLAB Derivatives
      • Coding MATLAB EQUATIONS
    • MATLAB APPLICATION >
      • MATLAB Time Dependent Beams
      • MATLAB Hydrulic Circuts Losses
      • MATLAB Sensitivity Analysis
      • MATLAB Water Resources
      • MATLAB Reciprocating Engine
      • MATLAB Ready Polygon Data
      • MATLAB Aerofoil Lift Calculation
      • MATLAB Gas Diffusion
      • MATLAB Studying Drag
      • MATLAB Fuel Droplet Studies
      • MATLAB Atmospheric
      • MATLAB Gas Turbine Code
      • MATLAB Combustion
      • MATLAB Spray Modelling
      • MATLAB Moving Sets of Data
      • MATLAB Applying Non-Slip Conditions
      • MATLAB Fuel Gas Diffusion
      • MATLAB Landing Gear
      • MATLAB Beam Analysis >
        • MATLAB Bending of Plates
      • MATLAB Wind Analysis
      • MATLAB Code for Solar Radiation
      • MATLAB SIMULATION
    • MATLAB Data Analysis >
      • Adding Descriptive Text to Images
      • MATLAB Multiplying Two Functions
      • MATLAB Image Analysis >
        • MATLAB Image Simulation
      • MATLAB Movies >
        • MATLAB Cameras
      • MATLAB Plotting Functions
      • MATLAB PDF Methods
      • MATLAB Adding Two Functions
      • MATLAB Area Segmintation
      • MATLAB Reading Data In and Out
      • MATLAB Functions Written by User
      • COUPLING MATLAB WITH SOFTWARE
    • MATLAB FlOW MODELLING >
      • MATLAB Continuity Equation
      • MATLAB Navier Stokes Equations >
        • Navier Stokes U Velocity in 2D
      • MATLAB Flow Diffusion
      • Gauss Seidel Matlab
      • MATLAB Partical Motion
      • Matlab Gauss Elimination
      • MATLAB Ideal Gas Equation
      • MATLAB Fluid Properties
      • MATLAB Gauss-Seidel Method
      • MATLAB Boundary Layer
      • MATLAB Infinitesimal strain theory
      • MATLAB Stream Functions >
        • MATLAB Studying Vorticity
        • MATLAB 2D Heat Diffusion
      • MATLAB Atmospheric Analysis
      • MATLAB Crank Nicolson
      • Building Codes >
        • MATLAB Data Generation Algorithm
        • MATLAB DNS Subsonic Code
        • MATLAB Runge Kutta
        • MATLAB DNS Sonic Code
        • MATLAB DNS Incompressible Code
      • MATLAB Flow Applications
      • MATLAB Species Concentration
      • MATLAB Wind Flow Analysis
      • MATLAB Turbulence Modelling
      • MATLAB VECTOR FIELD PLOTS >
        • Vector Fields Sites
        • MATLAB Vector Arrow Function
        • MATLAB Vector Gradient
    • MATLAB Working with Different Coordinates >
      • MATLAB Cylindrical Coordinates
      • MATLAB Spherical Coordinates
    • MATLAB Algebric Operations >
      • MATLAB Diagonal Matrix Construction
      • MATLAB Applying Shear to a Box
      • MATLAB Rotating a Set of Points
      • MATLAB Translation
      • MATLAB Scaling a Box
    • MATLAB MESH GENERATION >
      • MATLAB GEOMETRICAL MODELLING
      • MATLAB Geometric Operations
      • MATLAB Mesh Simulation
      • Delaunay Trangulation >
        • Mesh Genration Code Trials
      • MATLAB Uniform Mesh
    • MATLAB PDE Problems >
      • MATLAB Vibrations Modelling >
        • MATLAB Harmonic Motion
        • Molecular vibration
      • MATLAB Solving ODEs
    • MATLAB Reading List
  • SolidWorks
    • AutoDesk 3ds Max
    • AutoCAD
    • Aircraft Design >
      • Aircraft Design Data Base 1
      • Aircraft Structures Books
      • Aircraft Cutaway Drawings
      • Aerodynamics Book Reviews
  • Programs
    • STAR-CCM+ Tutorials
    • FORTRAN90 >
      • The Netlib
      • Salome-Platform
    • CHEMKIN
    • OpenFoam >
      • OpenFOAM Installation
      • OpenFoam Links
    • C++ >
      • C++ Compiling Your First Code
      • C++ Delaunay Triangulation

Example Calculating Solar Radiation on a Site in relation to Date, Lines of Latatuide and longatuide, and time of day

clc
clear
%Date Matrix 2011 was 365 days
e=0.0167;
a=149.57;
c=360;
tou=3;
p=365.25;
aa=0.033988;
bb=0.0003486;
cc=0.0000050;
S0=1368;
RAV=149.6;
Julian_Day=(1:1:365);
FYI_R=23.45;
lk=360/365;
ap=(2*pi)/360;
%city of york Latitude: 53.9586; Longitude: -1.0842
for i=1:365;
for j=1:24;
    M(i,j)=c*(Julian_Day(i)-tou)/p;
    v(i,j)=M(i)+aa*sin(ap*M(i))+bb*sin(2*ap*M(i))+cc*sin(3*ap*M(i));
    R(i,j)=a*(1-(e)^2)/(1+(e)*cos(ap*v(i)));
    S(i,j)=(S0)*(RAV/R(i))^2;
    Solar_Declination_Angle(i,j)=FYI_R*cos(ap*(lk*(Julian_Day(i)-173)));
end
end

figure('Position',[100 100 1700 900])
plot(M,v)
grid on
longitude=-1.0842;
latitude=53.9586;
% longitude=123.1;
% latitude=49.25;
tt=8;
for i=1:365;
    k=13;
for j=1:24;
    vb(i,j)=sin(ap*latitude)*sin(ap*Solar_Declination_Angle(i,j))-cos(ap*latitude)*cos(ap*Solar_Declination_Angle(i,j))*cos(ap*((c*(j+tt))/24)-ap*longitude);
    Local_Elevation_Angle(i,j)=asin(vb(i,j))/ap;
    if (j<=12)
    Zenith_Angle(i,j)=0.25*2*pi-Local_Elevation_Angle(i,j);
    vb2(i,j)=(cos(ap*latitude)*sin(ap*Zenith_Angle(i,j)));
    vb1(i,j)=(sin(ap*Solar_Declination_Angle(i,j))-cos(ap*Zenith_Angle(i,j))*sin(ap*latitude))/vb2(i,j);
    Azimuthal_Angle(i,j)=acos((vb1(i,j)))/ap;
    elseif (j>12)
    k=k-1;
    Zenith_Angle(i,j)=2*pi-Zenith_Angle(i,k);
    vb2(i,j)=(cos(ap*latitude)*sin(ap*Zenith_Angle(i,j)));
    vb1(i,j)=(sin(ap*Solar_Declination_Angle(i,j))-cos(ap*Zenith_Angle(i,j))*sin(ap*latitude))/vb2(i,j);
    Azimuthal_Angle(i,j)=acos((vb1(i,j)))/ap;
    end
    vb3(i,j)=-tan(ap*latitude)*tan(ap*Solar_Declination_Angle(i,j));
    h0(i,j)=acos(vb3(i,j))/ap;
    h0p(i,j)=((2*pi)/360)*h0(i,j);
end
end

figure('Position',[100 100 1700 900])
plot(Azimuthal_Angle(55,1:24),Local_Elevation_Angle(55,1:24),'--');
title('when will i get it right','FontSize',14)
xlabel('Azimuthal Angle')
ylabel('Local Elevation Angle')
grid on

figure('Position',[100 100 1700 900])
plot(Solar_Declination_Angle(55,1:24),'--');
grid on

figure('Position',[100 100 1700 900])
plot(Zenith_Angle(55,1:24),'--');
grid on


for i=1:365;
for j=1:24;
   EAVG(i,j)=(S(i,j)/pi)*(h0p(i,j)*sin(ap*latitude)*sin(ap*Solar_Declination_Angle(i,j))+cos(ap*latitude)*cos(ap*Solar_Declination_Angle(i,j))*sin(ap*h0(i,j)));
end
end


figure('Position',[100 100 1700 900])
cv=(0:15:360);
for i=1:365;
plot(cv(1:24),Local_Elevation_Angle(i,1:24));
set(gca,'XLim',[45 315],'YLim',[0 70]);
grid on
axis equal
hold on
end
xlabel('Angle')
ylabel('Local Elevation Angle')
hold off
pause(20)
close all


a2=0;
b2=0;
c2=0.5;
Hour_of_day=(1:1:24);
for i=1:365;
for j=1:24;
   SS(i,j)=S(i,j);
   SekmaH(i,j)=a2*randn(1,1);
   SekmaM(i,j)=b2*randn(1,1);
   SekmaL(i,j)=c2*1.1*randn(1,1);
   SekmaSB(i,j)=5.67*10^(-8);
   EIR(i,j)=0.99;
   ALBEDO(i,j)=26;
   TR(i,j)=(0.6+0.2*sin(ap*Local_Elevation_Angle(i,j)))*(1-0.4*SekmaH(i,j))*(1-0.7*SekmaM(i,j))*(1-0.4*SekmaL(i,j));
   K1(i,j)=-S(i,j)*TR(i,j)*sin(ap*Local_Elevation_Angle(i,j));
   K2(i,j)=ALBEDO(i,j)*K1(i,j);
   K(i,j)=K1(i,j)+K2(i,j);
   T(i,j)=25*sin(0.13*Hour_of_day(j))+300;
   b(i,j)=98.5;
   I3(i,j)=EIR(i,j)*SekmaSB(i,j)*(T(i,j))^4;
   I1(i,j)=-(1-ALBEDO(i,j))*SS(i,j)*TR(i,j)*sin(ap*Local_Elevation_Angle(i,j));
   I2(i,j)=b(i,j)*(1-0.1*SekmaH(i,j)-0.3*SekmaM(i,j)-0.6*SekmaL(i,j));
   Net_Radiation(i,j)=I1(i,j)+I2(i,j);
end
end
figure('Position',[100 100 1700 900])
plot(Hour_of_day,Net_Radiation(1,1:24))
Hold on
plot(Hour_of_day,K1(1,1:24))
plot(Hour_of_day,K2(1,1:24))
plot(Hour_of_day,I3(1,1:24))
plot(Hour_of_day,I2(1,1:24))
plot(Hour_of_day,I1(1,1:24))
xlabel('Local Time (h)','FontSize',12)
ylabel('Flux (W/m2)','FontSize',12)
title('Typical Diurnal Variation of Radiative Fluxes at the Surface','FontSize',12)
grid on

for i=1:365;
for j=1:24;
  positive=randn(1,1);
  CPD(i,j)=1004.67;
  MAIR(i,j)=2;
  rr(i,j)=0.87;
  CP(i,j)=CPD(i,j)*(1+0.84*rr(i,j));
  MWATER(i,j)=1025;
 
  if (positive>=0)
  LV(i,j)=+2.5*10^(6);
  elseif (positive<0)
  LV(i,j)=-2.5*10^(6);
  end
Sensible_Heat_Flux(i,j)=CP(i,j)*MAIR(i,j)*(T(i,j)-300);
Latent_Heat_Flux(i,j)=LV(i,j)*MWATER(i,j);
Bowen_Ratio(i,j)=Sensible_Heat_Flux(i,j)/Latent_Heat_Flux(i,j);
Molecular_Conduction_Flux_Into_Ground(i,j)=-Net_Radiation(i,j)+Sensible_Heat_Flux(i,j)+Latent_Heat_Flux(i,j);
end
end

for i=1:365;
 EEAVG(i)=mean(EAVG(i,:));
end
figure('Position',[100 100 1700 900])
plot(EEAVG)
set(gca,'XLim',[0 360],'YLim',[0 500])
xlabel('Day of Year','FontSize',12)
ylabel('Average Flux (W/m2)','FontSize',12)
title('Average Radiative Fluxes in York','FontSize',12)
grid on
Picture
Picture
Picture
Picture
Web Hosting by Just Host