Thanks for providing more information.
Firstly as you describe chances of any infection in your case are very rare.
During summer season,thick discharge from penis and reduced urine output can be caused due to dehydration and electrolyte imbalance.
So you should hydrate yourself with plenty of fluids and take Oral rehydration solution.
You can also try Cranberry juice.
Apart from this,Patterns of erectile dysfunction include-
• Occasional inability to obtain a full erection
• Inability to maintain an erection throughout intercourse
• Complete inability to achieve an erection
Psychological factors such as stress, anxiety, guilt, depression, low self-esteem, and fear of sexual failure cause 10 to 20 percent of ED cases.
Monitoring erections that occur during sleep can help rule out certain psychological causes of ED.
Healthy men have involuntary erections during sleep. If nocturnal erections do not occur, then ED is likely to have a physical rather than psychological cause.
Also you should get your detailed physical examination including blood sugar levels,CBC, urinalysis, lipid profile, serum creatinine and LFT, free testosterone to rule out any systemic physical cause of ED as well.
You can try some self care measures-Link1
I suggest you to consult a Urologist if your symptoms persist for further evaluation and management.
I hope I've provided the information you were seeking. If you are happy with my service, please provide a rating. If not, please let me know so l can continue to help you. Thank you.